939 B
939 B
Service Template
Template for creating new microservices in the monorepo.
Usage
-
Copy this template to create a new service:
cp -r services/_template services/new-service -
Update
package.json:- Change
nameto@goodgo/new-service - Update
description
- Change
-
Update
.env.example:- Set appropriate
PORT - Set
SERVICE_NAME - Configure database URL
- Set appropriate
-
Implement your features:
- Add modules in
src/modules/ - Update routes in
src/routes/index.ts - Add Prisma schema if needed
- Add modules in
-
Update Dockerfile:
- Change
EXPOSEport if different
- Change
-
Remove this README and create your own
Structure
src/modules/- Feature modules (controller, service, dto, module)src/config/- Configuration filessrc/middlewares/- Express middlewaressrc/routes/- Route definitionsprisma/- Database schema and migrationstests/- Unit and integration tests