E-Comerce Tailwind Templates

E Comerce

E-Commerce project using Event-Driven architecture with Kafka, MongoDB, and Node.js. Includes a React frontend with Vite and Tailwind CSS. Simulates flows like user registration, cart, and orders with event storage and mock notifications. Great for learning microservices and event sourcing.

๐Ÿš€ E-Commerce Platform | Event-Driven Architecture

A modern e-commerce platform built with an event-driven architecture using Node.js, TypeScript, Kafka, MongoDB, and PostgreSQL.


๐Ÿ“‹ Table of Contents


๐Ÿ“Œ Overview

This platform supports complete e-commerce flows including product management, shopping carts, orders, notifications, and admin tools. It is built with scalability and modularity in mind using event-driven patterns.


๐Ÿ—๏ธ Architecture

The system follows:

  • Event Sourcing โ€“ all changes are stored as a sequence of events.
  • CQRS โ€“ separation between commands (write) and queries (read).
  • Kafka โ€“ asynchronous communication between microservices.

๐Ÿงฉ Components

๐Ÿ”™ Backend Services

  • User Service โ€“ user registration, authentication, and profiles
  • Product Service โ€“ catalog, pricing, and inventory
  • Cart Service โ€“ shopping cart management
  • Order Service โ€“ payment and order processing
  • Notification Service โ€“ email and user alerts

๐Ÿ“ฆ Event Consumers

  • Welcome Flow
  • Notification Dispatcher
  • Abandoned Cart Handler
  • Invoice Generator

๐Ÿ’ป Frontend

  • Built using React with Vite
  • TailwindCSS for UI
  • React Router + Context API

โš™๏ธ Installation

# Clone the project
git clone https://github.com/yourusername/e-commerce.git
cd e-commerce

# Install backend dependencies
npm install

# Create the environment file
echo "PORT=3000
MONGODB_URI=mongodb://localhost:27017/ecommerce
POSTGRES_HOST=localhost
POSTGRES_PORT=5432
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_DB=ecommerce
KAFKA_BROKERS=localhost:9092
EMAIL_HOST=smtp.ethereal.email
EMAIL_PORT=587
EMAIL_USER=your_email_user
EMAIL_PASS=your_email_password" > .env

# Install frontend
cd E-Commerce-Front
npm install

๐Ÿš€ Running the Application

With Docker

docker-compose up -d
npm run migrations
npm run seed
npm start

Without Docker

Ensure MongoDB, PostgreSQL, and Kafka are running, then:

npm run migrations
npm run seed
npm start

In another terminal:

cd E-Commerce-Front
npm run dev

Access the app at:


๐Ÿงช Testing

npm test
npm test -- --testPathPattern=user.service
npm test -- --coverage

๐Ÿ“˜ API Documentation

Swagger UI is available at:

http://localhost:3000/api-docs


๐Ÿ“ธ Screenshots

Coming soon...


๐Ÿ› ๏ธ Technologies Used

Backend

  • Node.js
  • TypeScript
  • Express
  • Kafka
  • MongoDB
  • PostgreSQL
  • Jest

Frontend

  • React
  • Vite
  • Tailwind CSS
  • React Router
  • Context API

DevOps

  • Docker
  • Docker Compose
  • GitHub Actions

๐Ÿค Contributing

# Fork the repository
# Create a feature branch
git checkout -b feature/amazing-feature

# Commit your changes
git commit -m "Add amazing feature"

# Push the changes
git push origin feature/amazing-feature

# Open a pull request ๐ŸŽ‰

๐Ÿ“„ License

This project is licensed under the MIT License. See the LICENSE file for more information.

Top categories

Loading Svelte Themes