Express + GraphQL + Prisma (Postgres)
- Node.js: v18+ recommended
- PostgreSQL (local or remote)
- npm or yarn
express— HTTP serverapollo-server-express— GraphQL serverprisma&@prisma/client— ORMclass-validator&class-transformer— input validationuuid— IDs & sample seedsdotenv— environment configcors— CORS middleware
prisma/— Prisma schema + seed scriptsrc/— app source coderesolvers/— GraphQL typeDefs & resolversservices/— business logic to access Prismadtos/— validation DTOsmiddleware/— jwt & api-key helpersprisma.ts— prisma clientserver.ts— express + graphql server
- Client — id, name, email
- Product — id, clientId, name, description, stock, price
- ApiKey — id, clientId, key, expiration
git clone https://github.com/YOUR_USER/my-store.gitnpm install
# or
yarn installDATABASE_URL="postgresql://USER:PASSWORD@HOST:PORT/DATABASE"npm run prisma:seednpm run devGraphQL queries require an API key in the request header, but the API key retrieval endpoint is public.