supplied-service
Netlify Functions backend for the supplied mall H5 project.
Stack
- Netlify Functions
- TypeScript
- Prisma ORM
- Neon Postgres
@prisma/adapter-neon+@neondatabase/serverless
Directory
netlify/
functions/ # API entrypoints
utils/ # shared function utilities
types/ # shared API types
prisma/
schema.prisma # Prisma models
Environment
Copy .env.example to .env and set:
DATABASE_URL: Neon Postgres connection string for Netlify Functions runtime and Prisma CLIJWT_SECRET: auth signing secretUPLOAD_TOKEN: upload guard tokenPOINTS_MALL_OPEN_API_BASE: main platform bridge base URL, for examplehttp://localhost/open
Supplier H5 uses VUE_APP_SUPPLIER_IDENTIFICATION to request supplier config from this service. The supplier clientSecret stays in the database and is only used by the Netlify Function when requesting the platform bridge token.
Scripts
npm run dev
npm run build
npm run typecheck
npm run prisma:generate
npm run prisma:migrate
npm run prisma:studio
Function Routes
Netlify exposes functions under /.netlify/functions/<name>.
Current placeholders:
loginproduct-listproduct-detailcart-addorder-createorder-payuser-infouploadsupplier-infosupplier-token