This is a User Microservice built with TypeScript, Node.js, Prisma, following DDD and Clean Code principles, and using Docker Compose for database setup.
src/
├── application/ # Use cases
│ ├── usecases/
├── domain/ # Entities (pure business rules)
│ ├── entities/
├── infrastructure/ # Infrastructure (drivers and frameworks)
│ ├── models/
│ ├── controllers/
│ ├── repositories/
├── main/ # Interface adapters (API)
│ ├── api/
│ │ ├── routes/
├── shared/ # Shared modules
│ ├── utils/
│ └── index.ts
└── index.ts # Entry point
- Clone the repository:
git clone https://github.com/username/user-microservice.git
cd user-microservice- Setup Husky:
npm run prepare- Install dependencies:
npm install- Set up the database with Docker Compose:
docker-compose up --build- Apply Prisma migrations:
npx prisma migrate devStart the microservice:
npm run start:devThe service will be available at http://localhost:3000.
- To stop and remove the containers:
docker-compose down- Fork the repository.
- Create a branch for your feature (
git checkout -b feature/feature-name). - Commit your changes (
git commit -am 'Add new feature'). - Push the branch (
git push origin feature/feature-name). - Create a Pull Request.
Licensed under the MIT License.