Skip to content

nayefserag/Grocery

Repository files navigation

🛒 Grocery Service

NestJS TypeScript RabbitMQ MySQL License CI

A NestJS microservice that manages grocery items, shopping lists, and customer orders inside a larger microservices ecosystem. It owns grocery business logic and coordinates with Auth and Notification services over HTTP and RabbitMQ.

✨ Features

  • 🧺 CRUD for grocery items, shopping lists, and orders
  • 🔄 Order lifecycle & status tracking
  • 📨 Event-driven inter-service communication via RabbitMQ
  • 🔐 JWT validation against an external Auth service
  • 🔔 Order notifications through a Notification service (RabbitMQ + HTTP)
  • 📈 Structured logging (Winston) and error tracking (Sentry)

🏗️ Architecture

Layered / clean-architecture structure under src/app/modules:

modules/
├── api/             # Controllers & HTTP layer
├── application/     # Use cases / business logic
├── database/        # Entities, repositories (TypeORM / Mongoose)
├── infrastructure/  # External integrations, config
├── rabbitmq/        # Producers & consumers
└── shared/          # Cross-cutting utilities

🧰 Tech Stack

Area Tech
Framework NestJS
Language TypeScript
Databases MySQL (TypeORM), MongoDB (Mongoose)
Messaging RabbitMQ
Auth JWT
Observability Winston, Sentry
Testing Jest

🚀 Getting Started

# 1. Install
npm install

# 2. Configure environment
cp .env.example .env   # set DB, RabbitMQ, JWT, and service URLs

# 3. Run
npm run start:dev      # watch mode
npm run start:prod     # production

A Postman collection (postman_collection.json) is included for trying the API.

🧪 Testing

npm test           # unit tests
npm run test:e2e   # end-to-end
npm run test:cov   # coverage

📄 License

MIT


If this project helped you, consider giving it a ⭐

Built with ❤️ — contributions welcome.

About

NestJS microservice for grocery items, lists & orders (RabbitMQ, MySQL, MongoDB)

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors