How yasubdemissie/express_setup works
This repository is a small Express API for user registration, login, token refresh, and user lookup/creation. Clients send HTTP requests through the app’s middleware and routes; controllers delegate to services, which use Prisma for user records and authentication helpers for credentials and tokens. The README is empty, and some supporting files (notably database configuration and route aggregation) were not sampled, so the graph omits uncertain wiring and does not assume schema or middleware behavior beyond the available evidence.
Main entry points: app.ts Express app · auth.services.ts Auth service · index.ts Route index · auth.routes.ts Auth routes
Components 19
HTTP entry
- HTTP server
src/server.ts - Express app
src/app.ts - Route index
src/routes/index.ts - Rate limiting
src/middleware/ratelimit.middleware.ts - Error handling
src/middleware/error.middleware.ts - Not-found handling
src/middleware/notFound.middleware.ts
Authentication
- Auth routes
src/routes/auth.routes.ts - Auth controller
src/controllers/auth.controllers.ts - Auth service
src/services/auth.services.ts - Auth schemas
src/validator/auth.validator.ts - Token middleware
src/middleware/auth.middleware.ts
User management
- User routes
src/routes/user.routes.ts - User controller
src/controllers/user.controllers.ts - User service
src/services/user.services.ts
Persistence and utilities
- User database
prisma/schema.prisma - Prisma connection
src/config/db.ts - JWT utilities
src/utils/jwt.ts - Password utilities
src/utils/password.ts
Other components
- API client
Connections 20
- API client → HTTP server: sends HTTP
- HTTP server → Express app: starts
- Express app → Route index: mounts API
- Express app → Rate limiting: applies limits
- Express app → Error handling: handles errors
- Express app → Not-found handling: handles misses
- Route index → Auth routes: routes auth
- Route index → User routes: routes users
- Auth routes → Rate limiting: limits registration/login
- Auth routes → Auth controller: dispatches
- User routes → User controller: dispatches
- Auth controller → Auth service: calls
- Auth service → User database: reads/writes users
- Auth service → JWT utilities: signs/verifies tokens
- Auth service → Password utilities: hashes/checks passwords
- Auth service → Prisma connection: uses Prisma
- User controller → User service: calls
- User service → User database: reads/writes users
- User service → Prisma connection: uses Prisma
- Token middleware → JWT utilities: verifies access token