Skip to content

A scalable user microservice, developed with typescript and nodejs for user domain using postgres and rabbitmq.

Notifications You must be signed in to change notification settings

scalify-xyz/user-microservice

Repository files navigation

user-microservice

This is a User Microservice built with TypeScript, Node.js, Prisma, following DDD and Clean Code principles, and using Docker Compose for database setup.

Project Structure

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

Installation

  1. Clone the repository:
git clone https://github.com/username/user-microservice.git
cd user-microservice
  1. Setup Husky:
npm run prepare
  1. Install dependencies:
npm install
  1. Set up the database with Docker Compose:
docker-compose up --build
  1. Apply Prisma migrations:
npx prisma migrate dev

Run the Service

Start the microservice:

npm run start:dev

The service will be available at http://localhost:3000.

Docker Commands

  • To stop and remove the containers:
docker-compose down

Contributing

  1. Fork the repository.
  2. Create a branch for your feature (git checkout -b feature/feature-name).
  3. Commit your changes (git commit -am 'Add new feature').
  4. Push the branch (git push origin feature/feature-name).
  5. Create a Pull Request.

License

Licensed under the MIT License.

About

A scalable user microservice, developed with typescript and nodejs for user domain using postgres and rabbitmq.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published