This repository contains the backend code for the Smart Point of Sale (POS) System, designed using a microservices architecture. The backend is powered by Node.js, TypeScript, PostgreSQL, and fully containerized using Docker for scalable and efficient deployment. It handles core services such as user authentication, inventory management, product catalog, sales, and payment processing.
The system is built using a microservices approach, where each core feature—like user management, inventory, and payment processing—is managed by independent services that communicate over APIs. This ensures:
- 🔄 Scalability: Services can scale independently based on load.
- 🛠️ Modularity: Easy to maintain and upgrade each service without affecting others.
- 🔐 Security: Each service has its own security layers.
- 🟢 Node.js with TypeScript – Fast, scalable server-side processing
- 🐘 PostgreSQL – Robust relational database
- ⚙️ TypeORM – Powerful ORM for managing database connections and models
- 🐳 Docker – Containerization for easy and consistent deployments
- 🔑 JWT – Secure authentication and authorization
- 🔒 bcryptjs – Strong password hashing for user security
- 👤 User Management with role-based access control (Admin, Cashier, Manager)
- 🏪 Real-time Inventory Management with automatic stock updates
- 🛒 Product Catalogue (Create, Read, Update, Delete operations)
- 💳 Sales & Payment Processing supporting multiple payment methods
- 🔐 JWT-based Authentication for secure user sessions
- 👨💼 Super Admin Setup for centralized control using migrations
The backend is fully containerized using Docker 🐳, making it portable and easy to deploy across any environment. Each microservice runs in its own Docker container, ensuring isolation, scalability, and fault tolerance.
- Docker Compose: Used to manage multi-container applications with a single command.
- Scaling: Easily scale specific services using Docker's scaling capabilities.
- Network Management: Microservices communicate internally within the Docker network, ensuring smooth interaction without external exposure.
- 🐳 Docker and Docker Compose installed
- 🟩 Node.js (v14 or higher)
- 🐘 PostgreSQL – Set up locally or use a cloud database service like Heroku
-
Clone the repository:
git clone https://github.com/Smart-POS-System/Server.git
-
Install server dependencies:
npm install
-
Set up environment variables:
Rename the.env.example
file to.env
and configure your database and JWT secrets. -
Start the services with Docker:
docker-compose up -d --build
-
Run Backend Tests: Ensure everything is running correctly by testing the backend:
npm run test
- Start services:
docker-compose up -d
- Stop services:
docker-compose down
- View logs:
docker-compose logs -f
Use the built-in tests to validate functionality and ensure all services are working:
npm run test
We recommend running tests before deploying to ensure smooth operation of the POS system.
We welcome all contributions to improve this POS system. If you want to contribute, feel free to open an issue or submit a pull request. 🙌
This project is licensed under the MIT License. See the LICENSE file for details.