Broadway on Demand is the frontend web application for the CS 341 autograder at the University of Illinois.
This README will guide you through the setup and development process.
- Node.js (latest LTS version recommended)
- Yarn (v1.22.22 or newer)
- Git
git clone https://github.com/cs341-illinois/on-demand
cd on-demand
yarn install
This will also automatically run the Prisma generate command to create the Prisma client.
Create a .env
file in the root of the project with the following variables:
# Node environment (development, production, test)
NODE_ENV="development"
# Azure AD authentication settings
AZURE_CLIENT_ID="your-azure-client-id"
AZURE_CLIENT_SECRET="your-azure-client-secret"
AZURE_TENANT_ID="your-azure-tenant-id"
# Application settings
BASE_URL="/on-demand"
HOST="http://localhost:3000"
PORT=3000
# Security
COOKIE_SECRET="a-secure-random-string-at-least-32-characters"
GRADER_TOKEN="a-secure-random-string-at-least-32-characters"
# Database URL for Prisma
DATABASE_URL="postgresql://local:local@localhost:5432/broadway_on_demand"
All environment variables are validated using Zod schema validation at application startup. The required variables include:
AZURE_CLIENT_ID
,AZURE_CLIENT_SECRET
, andAZURE_TENANT_ID
for Azure AD authenticationHOST
for server hosting configurationGRADER_TOKEN
for secure grader communicationCOOKIE_SECRET
(minimum 32 characters) for session security
Create and set up your database:
docker compose up -d
yarn prisma:migrate-dev
yarn dev
This will start the development server with UI hot reloading enabled (changes to the API server currently require a manual restart). The application will be available at http://localhost:3000 (or the port you specified in your .env
file).
yarn build
- Build both the server and client for productionyarn build:server
- Build only the server TypeScript filesyarn lint
- Run ESLint with automatic fixes where possibleyarn prettier
- Format code using Prettieryarn dev
- Start the development server with hot reloadingyarn start:prod
- Start the production server (after building)yarn prisma:generate
- Generate Prisma clientyarn prisma:studio
- Open Prisma Studio to view and edit database datayarn setup
- Configure Git to use the blame ignore file
To deploy the application to a production environment:
-
Build the application:
yarn build
-
Start the production server:
node dist/server.js
- Create a feature branch from
main
- Make your changes
- Run tests and ensure code quality with ESLint and Prettier
- Submit a pull request
This project is licensed under the BSD-3-Clause License.