Skip to content

DReaper55/omncart

Repository files navigation

Omncart

A modern, scalable e-commerce platform built with microservices architecture using NestJS, React, and Nx monorepo.

πŸ—οΈ Architecture

Omncart is built as a microservices-based system with the following services:

Backend Services

Frontend Applications

πŸš€ Technologies

Backend

  • Framework: NestJS
  • Language: TypeScript
  • Databases: PostgreSQL, MongoDB
  • Caching: Redis
  • Messaging: Kafka, gRPC
  • Queue: BullMQ
  • Authentication: JWT, Passport.js

Frontend

  • Framework: React
  • Build Tool: Vite
  • Styling: Tailwind CSS

Infrastructure

  • Monorepo: Nx
  • Containerization: Docker & Docker Compose
  • API Documentation: Swagger/OpenAPI

πŸ“‹ Prerequisites

πŸ› οΈ Getting Started

1. Install Dependencies

pnpm install

2. Set Up Environment Variables

Each service requires its own .env file. Refer to individual service READMEs for specific configuration:

3. Start Infrastructure Services

Start the required infrastructure (PostgreSQL, MongoDB, Redis, Kafka):

cd apps/core-monolith
docker compose up -d postgres redis zookeeper kafka

4. Run Services

Development Mode

Run all services in development mode:

# Core Monolith
pnpm nx serve core-monolith

# Authentication Service
pnpm nx serve authentication-service

# Payment Service
pnpm nx serve payment-service

# Notification Service
pnpm nx serve notification-service

# Search Service
pnpm nx serve search-service

# Rule Management UI
pnpm nx serve rule-management-ui

Production Build

# Build all services
pnpm nx run-many --target=build --all

# Or build specific service
pnpm nx build core-monolith

🐳 Docker Deployment

Each service has its own Docker Compose configuration. To deploy a service:

cd apps/<service-name>
docker compose up -d

πŸ“š API Documentation

The Core Monolith exposes Swagger documentation at:

http://localhost:3333/api

πŸ§ͺ Testing

Run tests for all projects:

pnpm nx run-many --target=test --all

Run tests for a specific service:

pnpm nx test core-monolith

πŸ“¦ Project Structure

omncart/
β”œβ”€β”€ apps/
β”‚   β”œβ”€β”€ authentication-service/    # User authentication & authorization
β”‚   β”œβ”€β”€ core-monolith/             # Core business logic
β”‚   β”œβ”€β”€ notification-service/      # Notification delivery
β”‚   β”œβ”€β”€ payment-service/           # Payment processing
β”‚   β”œβ”€β”€ rule-management-ui/        # Business rules management UI
β”‚   └── search-service/            # Product search & indexing
β”œβ”€β”€ packages/                      # Shared libraries
└── tools/                         # Build tools and scripts

πŸ”§ Development Tools

Nx Console

Install the Nx Console extension for your IDE:

Useful Commands

# View project graph
npx nx graph

# Run affected tests
npx nx affected:test

# Build affected projects
npx nx affected:build

# Lint all projects
pnpm nx run-many --target=lint --all

🌐 Service Ports

Service Port Protocol
Core Monolith 3333 HTTP
Core Monolith gRPC 50052 gRPC
Authentication Service 4000 HTTP
Authentication gRPC 50051 gRPC
Payment Service 4001 HTTP
Notification Service 4002 HTTP
Search Service 4003 HTTP
Rule Management UI 4200 HTTP

🀝 Contributing

  1. Create a feature branch
  2. Make your changes
  3. Run tests: pnpm nx affected:test
  4. Submit a pull request

πŸ“„ License

This project is private and proprietary.

πŸ”— Additional Resources

About

A modern, scalable e-commerce platform built with microservices architecture using NestJS, React, and Nx monorepo.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors