Skip to content

Repository files navigation

Slug Market

Slug Market is a full-stack e-commerce platform designed around a microservice architecture. The application provides separate interfaces and functionality for shoppers, sellers, administrators, and corporate users, with independent backend services handling authentication, product listings, payments, images, carts, orders, notifications, and other platform functionality.

This repository is a public fork of the original Slug Market project, which is hosted in a private GitLab repository.

Features

  • Role-based interfaces for shoppers, sellers, administrators, and corporate users
  • User authentication and authorization
  • Product listing and inventory management
  • Shopping cart functionality
  • Order management
  • Payment processing
  • Image upload and storage handling
  • Seller management tools
  • Administrative controls
  • Corporate management functionality
  • Notification service
  • RESTful backend APIs
  • Containerized deployment with Docker
  • PostgreSQL database

Tech Stack

Frontend

  • TypeScript
  • React
  • Vite
  • Material UI

Backend

  • TypeScript
  • Node.js
  • Express
  • REST APIs

Database

  • PostgreSQL

Infrastructure

  • Docker
  • Docker Compose
  • GitLab CI/CD

Testing

  • Vitest
  • Supertest
  • Mock Service Worker (MSW)

Architecture

Slug Market separates application interfaces from reusable backend services.

Slug-Market/
├── App/
│   ├── Admin/
│   ├── corporate/
│   │   └── backend/
│   ├── seller/
│   │   ├── frontend/
│   │   └── backend/
│   └── shopper/
│       ├── frontend/
│       └── backend/
│
├── Service/
│   ├── AuthService/
│   ├── CartService/
│   ├── CorporateService/
│   ├── ImageSerivce/
│   ├── ListingService/
│   ├── NotificationService/
│   ├── OrderService/
│   └── PaymentService/
│
├── postgres/
├── scripts/
├── Dockerfile
├── docker-compose.yml
└── package.json

Applications

Application Purpose
Shopper Browse products, manage carts, and place orders
Seller Create and manage product listings
Admin Manage and oversee platform activity
Corporate Corporate-level platform functionality

Services

Service Responsibility
AuthService Authentication and authorization
ListingService Product listings
CartService Shopping cart operations
OrderService Order creation and management
PaymentService Payment processing
ImageService Image upload and storage handling
NotificationService User and system notifications
CorporateService Corporate functionality

Getting Started

Prerequisites

Make sure the following are installed:

  • Node.js
  • npm
  • Docker
  • Docker Compose

Clone the Repository

git clone https://github.com/DatLe7/Slug-Market.git
cd Slug-Market

Environment Variables

Create a .env file in the project root containing the required application and PostgreSQL environment variables.

At minimum, the Docker configuration expects PostgreSQL values such as:

POSTGRES_PORT=
POSTGRES_DB=
POSTGRES_USER=
POSTGRES_PASSWORD=

Additional environment variables may be required by individual services such as authentication, payments, image storage, and external APIs.

Installation

Install dependencies for the root project and all application services:

npm run installs

This installs dependencies for the individual frontend, backend, and microservice projects.

Build

Build all applications and services:

npm run build

Running Locally

Start all application components:

npm start

The root project uses concurrently to launch the individual services and applications.

Some of the primary local ports include:

Component Port
Admin Frontend 3000
Seller Frontend 5173
Shopper Frontend 5174
Seller Backend 3013
Shopper Backend 3012
Payment Service 3016
Image Service 3018
Order Service 4000
Corporate Backend 3040
Corporate Service 3015

Docker

The application can also be run using Docker.

Build and Start Containers

npm run containerised

or:

npm run compose

The Docker Compose configuration starts:

  • app — Slug Market applications and services
  • database — PostgreSQL database

Create Deployment Images

npm run package

This builds the application and PostgreSQL Docker images for linux/amd64 and packages them into a compressed archive.

Testing and CI/CD

The project uses automated testing and build scripts across its applications and services.

Run CI dependency installation and builds with:

npm run cis

The project includes testing tools such as:

  • Vitest for unit testing
  • Supertest for API and integration testing
  • MSW for API mocking

The repository also contains a .gitlab-ci.yml configuration used for continuous integration and automated quality checks.

Project Background

Slug Market was developed as a full-stack software engineering project focused on building a scalable e-commerce platform using service-oriented architecture.

The project emphasizes:

  • separation of application responsibilities
  • reusable backend services
  • RESTful API design
  • automated testing
  • containerized deployment
  • CI/CD workflows
  • collaborative software development

Repository

GitHub: https://github.com/DatLe7/Slug-Market

About

This is a fork of slug market as the original is in a private gitlab

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages