Test analysis app with a Vite + React frontend and an Express + Prisma backend.
- Frontend: Vite, React, shadcn UI, Tailwind
- Backend: Express, Prisma (SQLite by default)
- Node.js 18+
- npm
- Optional: Playwright browsers for the scraper
Frontend (repo root):
cp .env.example .envVariables:
VITE_API_BASE_URL: preferred API base URL (used bysrc/lib/api.ts).VITE_API_URL: legacy fallback used bysrc/api.ts.
Backend (server):
cp server/.env.example server/.envVariables:
DATABASE_URL: Prisma connection string (SQLite example:file:./dev.db).JWT_SECRET: long random secret for signing auth tokens.ENCRYPTION_KEY: 32-byte key (base64, hex, or raw) for credential encryption.PORT: API port (default4000).SERVER_HOST: bind host (default0.0.0.0).CORS_ORIGIN: comma-separated list of allowed frontend origins.SCRAPER_*: scraper runtime settings.TEST_Z7I_*: credentials for the Playwright helper scripts.
- Install dependencies.
npm install
cd server
npm install-
Configure env files (see above).
-
Run Prisma migrations.
cd server
npx prisma migrate dev --name init- Optional: install Playwright browsers if you plan to run the scraper.
cd server
npx playwright install- Start the API.
cd server
npm run dev- Start the frontend (new terminal).
npm run dev- Open the app at
http://localhost:5173.
Backend:
cd server
npm install
npm run build
npx prisma migrate deploy
npm run startFrontend:
npm install
npm run buildServe dist/ with your preferred static host (NGINX, Vercel, Netlify, etc). For a local production preview, run npm run preview.
Production checklist:
- Set
VITE_API_BASE_URL(and/orVITE_API_URL) to your public API URL before building the frontend. - Set
CORS_ORIGINto the production frontend URL(s). - Provide secure
JWT_SECRETandENCRYPTION_KEYvalues.