Skip to content

Repository files navigation

🛒 ElastiCart

Scalable Shopping Cart Application

Node.js Docker SvelteKit CouchDB Azure License

A microservices-based e-commerce platform built with Docker, Node.js, SvelteKit, and CouchDB. Designed for scalability, independent service deployment, and production-ready containerization with Docker Swarm.

FeaturesArchitectureQuick StartDocumentation


Checkout Page    Trending Products Admin Dashboard    Shopping Cart

Overview

ElastiCart is a full-stack e-commerce application demonstrating modern microservices architecture with:

  • 8 independent backend microservices (Auth, Products, Carts, Orders, Reviews, Recommendations, Images, Logs)
  • API Gateway for centralized routing and authentication
  • SvelteKit frontend with TypeScript and TailwindCSS
  • Docker Swarm orchestration with elastic auto-scaling
  • CouchDB for NoSQL data persistence
  • Azure Blob Storage for image management
  • Redis for job queue and caching

Key Features

  • 🔐 JWT Authentication with HTTP-only cookies
  • 🛒 Shopping Cart with real-time total calculations
  • 📦 Order Management with checkout and history
  • Product Reviews with rating system
  • 🤖 Smart Recommendations with personalized suggestions and trending products
  • 🖼️ Image Upload with Azure Blob Storage integration
  • 📊 Centralized Logging for monitoring and analytics
  • 🚀 Auto-Scaling policies for high-traffic services
  • 🧪 Comprehensive Testing (unit, integration, load tests)
  • 🐳 Containerized deployment with Docker Compose and Swarm

Project Structure

├── assets/                 # Images and visual assets for README
├── src/                    # Source code (see src/README.md)
│   ├── api-gateway/        # API Gateway service
│   ├── back-end/           # Backend microservices
│   ├── front-end/          # SvelteKit web application
│   └── scalability/        # Scaling policies and monitoring
├── config/                 # Shared configuration files
├── tutorials/              # Project tutorials and guides
├── scripts/                # Deployment and utility scripts
├── .env                    # Environment configuration for deployment
├── .env.example            # Example Environment configuration for deployment
├── .gitignore              # Git ignore file
├── docker-compose.yml      # Local development deployment
├── scapp.yml               # Docker Swarm stack definition
├── Makefile                # All deployment and testing commands
├── Grading.md              # Grading criteria and instructions
├── Report-LINFO2145-...    # Final project report
└── package.json            # Monorepo workspace configuration

📁 config/

Shared development configuration for code quality and testing:

  • ESLint configuration for JavaScript/TypeScript linting
  • Prettier configuration for code formatting
  • Jest configurations (unit and integration tests)

📁 scripts/

Deployment scripts and utilities for local and production environments:

  • Deployment automation (deploy-local.sh, deploy-swarm.sh and deploy-azure.sh)
  • Test data setup (create-admin-user.sh, create-sample-products.sh and setup-test-data.sh)
  • Local management helpers (Display URLs, propagate .env, etc.)
  • Swarm management helpers (VM setup, build and push images, stack deployment, etc.)
  • Azure management helpers (Azure VM setup, etc.)

See scripts/README.md for detailed documentation.

📁 src/

Application source code organized by service type:

  • api-gateway/: Central routing and authentication verification
  • back-end/: 8 independent microservices + shared utilities
  • front-end/: SvelteKit web application
  • scalability/: Auto-scaling policies (horizontal and vertical) and monitoring tools

See src/README.md for architecture overview and service details.

Makefile Commands

The project includes a comprehensive Makefile with all commands needed to deploy, test, monitor, and manage the application.

Quick Reference

Run make or make help to see the complete list of available commands.

Technology Stack

Backend:

  • Node.js + Express.js
  • CouchDB (NoSQL database)
  • JWT authentication
  • Docker + Docker Compose + Docker Swarm

Frontend:

  • SvelteKit 2.x
  • TypeScript 5.x
  • TailwindCSS 3.x
  • Axios for HTTP

Infrastructure:

  • Docker Swarm orchestration
  • Azure Blob Storage and Azure Queue Storage
  • Redis for caching and job queuing
  • Multipass for local VM management
  • Azure Virtual Machines for cloud deployment
  • Azure Container Registry (ACR) for image storage

Services Overview

ElastiCart consists of 10 containerized services. Each service has its own README with complete API documentation.

Backend Microservices

Service Role Technologies Port Documentation
Auth User authentication and JWT management Express.js, CouchDB, bcrypt, JWT 3003 src/back-end/auth/README.md
Products Product catalog management (CRUD) Express.js, CouchDB 3002 src/back-end/products/README.md
Carts Shopping cart operations Express.js, CouchDB 3005 src/back-end/carts/README.md
Orders Order creation and history Express.js, CouchDB 3004 src/back-end/orders/README.md
Reviews Product reviews and ratings Express.js, CouchDB, Axios 3007 src/back-end/reviews/README.md
Recommendations Intelligent product recommendations using MapReduce Express.js, CouchDB, Nano 3009 src/back-end/recommendations/README.md
Images Image upload and processing Express.js, Azure Blob, Azure Queue, Redis, Sharp, Multer 3008 src/back-end/images/README.md
Logs Centralized logging and monitoring Express.js, CouchDB 3006 src/back-end/logs/README.md

Infrastructure Services

Service Role Technologies Port Documentation
API Gateway Request routing, authentication, rate limiting Express.js, express-http-proxy, JWT 3000 src/api-gateway/README.md
Front-End User interface web application SvelteKit, TypeScript, TailwindCSS, Axios 3001 src/front-end/README.md

Technology Justification

Microservices Architecture

  • Independent Scalability: Each service can scale independently based on load
  • Technology Flexibility: Services can use different tech stacks if needed
  • Fault Isolation: Service failures don't cascade to the entire system
  • Development Velocity: Teams can work on different services in parallel

Node.js + Express.js

  • Performance: Non-blocking I/O ideal for microservices
  • JavaScript Ecosystem: Vast npm package ecosystem
  • Developer Productivity: Same language for frontend and backend
  • Easy Containerization: Lightweight Docker images

CouchDB (NoSQL)

  • Schema Flexibility: Easy to evolve data models without migrations
  • Horizontal Scalability: Built-in clustering and sharding
  • HTTP REST API: Natural fit for microservices
  • Conflict Resolution: Multi-master replication support
  • Document Model: Perfect for JSON-based microservices communication

Docker Swarm

  • Built-in Orchestration: No external orchestrator needed
  • Ease of Use: Simpler than Kubernetes for small-to-medium deployments
  • Native Docker Integration: Uses standard Docker Compose files
  • Auto-scaling: Built-in service scaling and load balancing
  • Rolling Updates: Zero-downtime deployments

SvelteKit Frontend

  • Performance: Compiled to vanilla JavaScript, smaller bundle sizes
  • Developer Experience: Reactive programming, less boilerplate
  • SSR Support: Server-side rendering for better SEO
  • TypeScript: Type safety and better IDE support

Azure Blob Storage

  • Scalability: Unlimited storage capacity
  • Cost-Effective: Pay-per-use pricing model
  • CDN Integration: Fast global image delivery
  • SDK Support: Official Node.js SDK with good documentation

Azure Queue Storage

  • Asynchronous Processing: Decouples image processing from upload requests
  • Reliability: Guaranteed message delivery with retry mechanisms
  • Scalability: Handles millions of messages efficiently
  • Integration: Native integration with Azure Blob Storage

Azure Infrastructure as a Service (IaaS)

  • Virtual Machines: Flexible compute resources with various VM sizes
  • Global Availability: Multiple regions for low-latency deployment
  • Resource Management: Centralized resource group management
  • Network Security: Built-in Network Security Groups (NSG) and firewall rules
  • Cost Control: Pay-as-you-go pricing with resource tagging
  • Integration: Seamless integration with other Azure services

Multipass (Local VM Management)

  • Lightweight: Fast VM creation and management on local machines
  • Development Parity: Simulates production Swarm environment locally
  • Easy Cleanup: Simple VM lifecycle management
  • Cross-Platform: Works on macOS, Linux, and Windows

Redis

  • In-Memory Speed: Fast job queue processing
  • Pub/Sub: Real-time communication between services
  • TTL Support: Automatic job status expiration
  • Reliability: Persistence options for durability

JWT with HTTP-Only Cookies

  • Stateless: No server-side session storage needed
  • XSS Protection: HTTP-only cookies prevent JavaScript access
  • Scalability: No shared session store required
  • Standard: Industry-standard authentication method

Deployment Scripts

All deployment automation is in the scripts/ directory:

Script Purpose Usage
deploy-local.sh Docker Compose deployment make deploy-local
deploy-swarm.sh Multipass VM-based Swarm deployment make deploy-swarm
deploy-azure.sh Azure VM-based Swarm deployment make deploy-azure

Features Showcase

Product Management

Product Creation from File    Product Creation from URL

Create products with images uploaded from local files or external URLs. The image service handles processing and storage via Azure Blob Storage.

Smart Recommendations

User-Based Recommendations    Cart-Based Recommendations    Product-Based Recommendations

The recommendation engine provides personalized suggestions using MapReduce algorithms:

  • User-based: Recommendations based on user purchase history
  • Cart-based: Suggestions based on current cart contents
  • Product-based: Similar products based on category and co-purchases
  • Trending: Popular products across all users

Reviews System

Reviews Overview    Writing a Review    Review Display

Full review system with star ratings, feeding into the recommendation engine for better suggestions.


Authors

Mathis DELSART
Alex KHALIL

License

This project is developed for academic purposes as part of university coursework.


Built for LINFO2145 - Cloud Computing @ UCLouvain (Université catholique de Louvain).

A modern e-commerce platform demonstrating cloud-native microservices architecture, containerization, and scalable deployment strategies.

About

ElastiCart — a scalable microservices-based e-commerce platform featuring custom recommendations, smart ranking systems, and dynamic shopping experiences.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages