Skip to content

Quick Start

Get the DoCurious frontend running locally in under five minutes.

Prerequisites

ToolMinimum VersionCheck
Node.js20+node -v
npm10+npm -v
Git2.xgit --version

Clone and Install

bash
git clone <repository-url> docurious-FE
cd docurious-FE
npm install

Environment Setup

Create a .env file in the project root (or copy from .env.example if available):

bash
# Mock API mode (default: true)
# Set to 'false' to switch to the real backend API
VITE_USE_MOCK_API=true

# Backend API URL (only used when VITE_USE_MOCK_API=false)
VITE_API_URL=http://localhost:8000/api/portal

# OAuth / Third-party services (optional for local dev)
VITE_GOOGLE_CLIENT_ID=
VITE_STRIPE_PUBLIC_KEY=
VITE_RECAPTCHA_SITE_KEY=
VITE_GOOGLE_MAPS_API_KEY=
VITE_APPLE_CLIENT_ID=
VITE_APPLE_REDIRECT_URI=

By default, the app runs entirely with mock APIs -- no backend required. The mock database seeds itself on first load with demo users, challenges, communities, and all other data.

NPM Scripts

ScriptCommandDescription
devnpm run devStart Vite dev server with HMR
buildnpm run buildTypeScript check + production build
previewnpm run previewPreview production build locally
lintnpm run lintRun ESLint across the project
formatnpm run formatAuto-format with Prettier
format:checknpm run format:checkCheck formatting without writing
testnpm testRun Vitest in watch mode
test:runnpm run test:runSingle Vitest run (CI mode)
test:coveragenpm run test:coverageRun tests with V8 coverage report
test:e2enpm run test:e2eRun Playwright E2E tests (headless Chromium)
test:e2e:uinpm run test:e2e:uiRun Playwright with interactive UI
test:e2e:headednpm run test:e2e:headedRun Playwright in headed browser
test:allnpm run test:allRun Vitest + Playwright back-to-back
storybooknpm run storybookLaunch Storybook on port 6006
build-storybooknpm run build-storybookBuild static Storybook
docs:devnpm run docs:devDev server for this documentation site
docs:buildnpm run docs:buildBuild documentation (TypeDoc + VitePress)
docs:previewnpm run docs:previewPreview built documentation

Start the Dev Server

bash
npm run dev

The app opens at http://localhost:5173. The mock database auto-seeds on first load.

Full-Stack Mode

The backend Express server lives in server/ — 129 Prisma models, 23 route files, 18 domain services, 164 passing tests.

bash
# Terminal 1 — Install and start the backend
cd server && npm install
cp .env.example .env        # edit DATABASE_URL, JWT_SECRET, JWT_REFRESH_SECRET
npx prisma generate && npx prisma db push
npm run dev                  # http://localhost:8000

# Terminal 2 — Start the frontend with real API
VITE_USE_MOCK_API=false npm run dev

# Run backend tests
cd server && npm test        # 19 test files, 164 tests (Vitest + Supertest)

Required environment variables: DATABASE_URL, JWT_SECRET, JWT_REFRESH_SECRET. See server/.env.example for the full list including Cloudinary and Stripe keys.

See server/README.md for full API route tables, auth documentation, and database details.

Project Structure Overview

docurious-FE/
  src/              Frontend source code
    adapters/       SQL-to-FE data adapters (UUID mapping, status enums)
    api/            Mock + real API layer (26 modules)
    components/     Reusable UI components (26 directories, ~148 components)
    hooks/          Custom React hooks (useFeatureFlag, useLocation, useAddressSearch)
    lib/            Utility functions (cn class merge, contextHelpers)
    i18n/           Internationalization (en/es/fr)
    pages/          Route page components (189 pages)
    routes/         Router config + 7 guards (Auth, Role, Tier, Age, Consent, Context, Parent)
    store/          Zustand stores (30 stores)
    theme/          Theme system (7 presets, CSS variable injection)
    types/          TypeScript type definitions (32 files)
    App.tsx         Root component
    main.tsx        Entry point
  server/           Backend Express server
    prisma/         Prisma schema (~129 models) + seed
    src/
      routes/       23 route files (21 domain + prodData + index)
      controllers/  19 controllers
      services/     18 domain services
      middleware/   Auth, role guard, validation, error handler
      config/       Environment + CORS config
      utils/        JWT, password, pagination, response helpers
      __tests__/    19 test files, 164 tests (Vitest + Supertest)

Demo User Accounts

The mock database includes pre-seeded accounts for every role. Use the UserSwitcher dropdown in the application header to instantly switch between personas without logging out.

PersonaEmailPasswordHome RouteRole Guide
Studentstudent@lincoln-elementary.eduStudent1234/Student
Teacherteacher@lincoln-elementary.eduTeacher1234/schoolTeacher
Parentparent@example.comParent1234/parentParent
School Adminadmin@lincoln-elementary.eduAdmin1234/schoolSchool Admin
Vendorvendor@craftbox.comVendor1234/vendorVendor
Platform Adminplatform@docurious.comPlatform1234/admin/analyticsPlatform Admin

There is also a dedicated demo landing page at /demo that presents these personas with descriptions and one-click login.

Debug Panel

Press Ctrl+Shift+D to open the Debug Panel -- a 6-tab development overlay for inspecting stores, network requests, feature flags, and other app internals. This panel is only available in development mode.

Next Steps

DoCurious Platform Documentation