How curelo-health/node-express-graphql-boilerplate works
This repository scaffolds a Node.js, Express, GraphQL, and Prisma project. The primary workflow is a developer invoking the CLI or setup script, which produces a project from template/; the generated app then serves REST and GraphQL APIs backed by Prisma. The graph also preserves the template’s distinct user and product domains. Scaffold-copy relationships follow the root README; runtime links cite sampled source or SOURCE INDEX references, so unsampled internals are not expanded beyond supported relationships.
Main entry points: index.js GraphQL mount · server.js Server startup · prisma.js Prisma client · app.js Express app
Components 24
Project scaffolding
- Scaffold CLI
bin/create.js - Setup script
create-project.sh - Project template
template
Application runtime
- Server startup
template/src/server.js - Express app
template/src/app.js - Runtime config
template/src/config/index.js - Error middleware
template/src/middlewares/errorHandler.js - Logger
template/src/utils/logger.js
REST user domain
- REST routes
template/src/routes/index.js - User routes
template/src/routes/user.routes.js - User controller
template/src/controllers/user.controller.js - User service
template/src/services/user.service.js
GraphQL domains
- GraphQL mount
template/src/graphql/index.js - User schema
template/src/graphql/user/user.schema.js - User resolvers
template/src/graphql/user/user.graphql.js - User GraphQL service
template/src/graphql/user/user.service.js - Product schema
template/src/graphql/product/product.schema.js - Product resolvers
template/src/graphql/product/product.graphql.js - Product service
template/src/graphql/product/product.service.js
Persistence and shared services
- User model
template/src/models/user.model.js - Product model
template/src/models/product.model.js - Prisma client
template/src/config/prisma.js - Database
template/prisma/schema.prisma
Other components
- Developer
Connections 29
- Developer → Scaffold CLI: invokes
README.md - Developer → Setup script: runs
README.md - Scaffold CLI → Project template: scaffolds from
- Setup script → Project template: copies contents
README.md - Server startup → Express app: starts
template/src/server.js - Server startup → Runtime config: reads settings
template/src/server.js - Server startup → Prisma client: connects
template/src/server.js - Server startup → GraphQL mount: mounts
template/src/server.js - Express app → REST routes: mounts
template/src/app.js - Express app → Error middleware: registers
template/src/app.js - REST routes → User routes: registers
template/src/routes/index.js - User routes → User controller: routes to
template/src/routes/user.routes.js - User controller → User service: calls
template/src/controllers/user.controller.js - User service → User model: queries
template/src/services/user.service.js - User model → Prisma client: uses
template/src/models/user.model.js - Prisma client → Database: accesses
- GraphQL mount → User schema: merges
template/src/graphql/index.js - GraphQL mount → User resolvers: merges
template/src/graphql/index.js - GraphQL mount → Product schema: merges
template/src/graphql/index.js - GraphQL mount → Product resolvers: merges
template/src/graphql/index.js - User resolvers → User GraphQL service: delegates
template/src/graphql/user/user.graphql.js - User GraphQL service → User service: reuses
template/src/graphql/user/user.service.js - Product resolvers → Product service: delegates
template/src/graphql/product/product.graphql.js - Product service → Product model: queries
template/src/graphql/product/product.service.js - Product model → Prisma client: uses
template/src/models/product.model.js - GraphQL mount → Runtime config: reads settings
template/src/graphql/index.js - Error middleware → Runtime config: checks environment
template/src/middlewares/errorHandler.js - Error middleware → Logger: logs errors
template/src/middlewares/errorHandler.js - Server startup → Logger: logs lifecycle
template/src/server.js