Files
pos-system/services/_template/README.md
Ho Ngoc Hai 4da46b5b8e Sure! Pl
2025-12-27 01:31:10 +07:00

939 B

Service Template

Template for creating new microservices in the monorepo.

Usage

  1. Copy this template to create a new service:

    cp -r services/_template services/new-service
    
  2. Update package.json:

    • Change name to @goodgo/new-service
    • Update description
  3. Update .env.example:

    • Set appropriate PORT
    • Set SERVICE_NAME
    • Configure database URL
  4. Implement your features:

    • Add modules in src/modules/
    • Update routes in src/routes/index.ts
    • Add Prisma schema if needed
  5. Update Dockerfile:

    • Change EXPOSE port if different
  6. Remove this README and create your own

Structure

  • src/modules/ - Feature modules (controller, service, dto, module)
  • src/config/ - Configuration files
  • src/middlewares/ - Express middlewares
  • src/routes/ - Route definitions
  • prisma/ - Database schema and migrations
  • tests/ - Unit and integration tests