Skip to content
This repository was archived by the owner on Jun 10, 2026. It is now read-only.

0-sayed/easyGen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

easyGen

Full-stack authentication test task for a React/Vite frontend and NestJS/MongoDB backend.

Setup

Use Node 22.14.0 and pnpm 10.26.2.

pnpm install
cp .env.example .env
pnpm infra:up
pnpm migrate:up
pnpm validate

Run the API and web app together:

pnpm --parallel --stream --filter @easygen/api --filter @easygen/web run dev

Or use the Makefile shortcuts:

make setup
make infra
make dev
make validate

Project Structure

apps/
  api/          NestJS API, Swagger docs, MongoDB module, tests
  web/          React + Vite app shell
migrations/     migrate-mongo migration files
packages/       Shared workspace packages
planning/       Business and technical planning context

Environment

Copy .env.example to .env.

Variable Purpose Default
PORT API HTTP port 3000
LOG_LEVEL Pino/Nest logger level info
WEB_PORT Vite dev server port 5173
VITE_API_URL API URL used by the frontend http://127.0.0.1:3000
MONGODB_PORT MongoDB host port 27018
MONGODB_URI API and migration MongoDB connection string mongodb://127.0.0.1:27018/easygen?directConnection=true
JWT_SECRET JWT signing secret required by the API empty; set in local .env
JWT_EXPIRES_IN JWT access token lifetime 15m

Local Services

docker-compose.yml starts MongoDB 8.0 on 127.0.0.1:${MONGODB_PORT:-27018}. The Compose file avoids fixed container names so worktree-specific stacks can be isolated.

For parallel git worktrees, use worktree-compose with the committed .wtcrc.json; keep migrations, app URLs, and browser QA pointed at the current worktree's .env.

API Endpoints

  • GET /health
  • POST /auth/signup
  • POST /auth/signin
  • GET /auth/me - requires a bearer token
  • GET /docs
  • GET /docs-json

Authentication Flow

  • POST /auth/signup creates a user and returns an access token.
  • POST /auth/signin returns an access token for valid credentials.
  • GET /auth/me verifies the stored token and powers the protected application page.
  • The React app provides /signup, /signin, and /app.

Validation

pnpm validate runs format check, lint, type-check, tests, Knip, dependency audit, and build.

Run the browser smoke test when you want full-stack UI confidence:

pnpm --filter @easygen/web exec playwright install chromium
pnpm test:browser
pnpm infra:down

License: MIT

About

Full-stack authentication test task with React/Vite, NestJS, and MongoDB

Topics

Resources

License

Stars

Watchers

Forks

Contributors