The project is now split into a backend in BE/ and a lightweight browser frontend in FE/.
BE/
src/
prisma/
package.json
tsconfig.json
prisma.config.ts
FE/
index.html
app.jsx
server.ts
styles.css
package.json
.env
package.json
The API lives in BE/ and still uses Bun, Express, Prisma, PostgreSQL, JWT, and Zod.
Useful commands from the repo root:
bun run dev:be
bun run typecheck:be
bun run prisma:generate
bun run prisma:migrateThe backend loads environment variables from the repo root .env.
The frontend proxy can also read BACKEND_URL from the same file.
Example:
DATABASE_URL=postgresql://user:password@localhost:5432/contestdb
JWT_SECRET=your_secret_key
SALT_ROUNDS=10
PORT=3000
BACKEND_URL=http://localhost:3000The frontend lives in FE/ as a React app bundled with Bun and served by a small Bun server.
That FE server also proxies /api/* calls to the backend, so the browser can talk to the API through the frontend origin.
It supports:
- signup and login
- token storage
- listing contests
- contest detail and leaderboard lookup
- creator flows for contest, MCQ, and DSA creation
- contestant flows for MCQ and DSA submission
Run it from the repo root:
bun run build:fe
bun run dev:feThen open http://localhost:5173.
- The frontend now defaults to
${window.location.origin}/api, and the FE server proxies that toBACKEND_URLorhttp://localhost:3000. - The React entry point is
FE/app.jsxand Bun emits the browser bundle toFE/dist/app.js. - A new authenticated route,
GET /api/contests, was added to make the frontend contest list possible. - CORS headers are enabled in the backend so the static frontend can call the API during development.
