Skip to content

sachin11063/Sweet-Shop-Management-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

16 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🍬 TDD Kata: Sweet Shop Management System

A full-stack Sweet Shop Management System built to manage real-world shop operations.
This project demonstrates RESTful API development, authentication, inventory management, frontend SPA design, Test-Driven Development principles, and transparent AI usage.

🌐 Live Demo
πŸ‘‰ https://sweet-shop-management-system-mauve.vercel.app


🎯 Objective

The goal of this kata is to design, build, and test a complete Sweet Shop Management System while showcasing:

  • Backend API development
  • Secure authentication
  • Database-backed inventory management
  • Frontend implementation using a modern framework
  • Test-driven thinking
  • Responsible and transparent use of AI tools

πŸš€ Overview

The system supports two roles:

  • Admin: Manages sweets inventory (add, update, restock, delete)
  • User: Browses sweets, searches with filters, adds to cart, and purchases items

The application features a clean UI, responsive layout, smooth animations, and dark/light mode support.


🧠 Tech Stack

πŸ–₯️ Frontend

  • React.js
  • React Router
  • JavaScript (ES6+)
  • Custom CSS
  • Responsive Design
  • Dark / Light Theme
  • CSS Animations & Transitions

πŸ› οΈ Backend

  • Node.js
  • Express.js
  • MongoDB
  • JWT Authentication
  • bcrypt for password hashing

☁️ Deployment

  • Vercel (Frontend)
  • Render (Backend)

πŸ§ͺ Test-Driven Development (TDD)

This project follows the Red β†’ Green β†’ Refactor approach.

Approach

  • Tests are written to define expected behavior before or alongside feature development
  • Core business logic is validated using automated tests
  • Refactoring is performed after tests pass

Covered Areas

  • Authentication flows
  • Sweet CRUD operations
  • Inventory purchase and restock logic
  • Authorization and role-based access control

Tests focus on validating business logic and edge cases, not just happy paths.


πŸ§ͺ Testing & Test Report

Tools

  • Jest
  • Supertest

Run Backend Tests

cd backend
npm install
npm test

Tests focus on validating business logic and edge cases, not just happy paths.


πŸ€– My AI Usage

AI tools were used as development assistants while ensuring all final logic, decisions, and implementations were done manually.

πŸ”§ AI Tools Used

  • ChatGPT – for requirement clarification, logic validation, and documentation refinement
  • GitHub Copilot – for inline suggestions and reducing repetitive boilerplate code

🧠 How I Used AI

  • Used ChatGPT to brainstorm API endpoint structures and application flow
  • Used ChatGPT to understand and validate TDD practices and edge cases
  • Used GitHub Copilot to accelerate repetitive patterns such as CRUD handlers and test scaffolding
  • Reviewed, modified, and finalized all AI-assisted code manually

πŸͺž Reflection on AI Impact

AI improved development efficiency and helped reduce time spent on boilerplate tasks.
It allowed greater focus on system design, business logic, and UI quality.
Core problem-solving, debugging, and architectural decisions were made independently to ensure correctness and learning integrity.


πŸ“Έ Project Screenshots

Below are real screenshots showcasing admin and user workflows, inventory management, dark/light modes, and cart functionality.

🏠 Landing Page

Landing Page

πŸ” Authentication

Register Page Login Page

πŸ›  Admin Dashboard & Inventory

Admin Dashboard Admin Inventory Table

πŸŒ™ Admin Dark Mode

Admin Dark Mode Admin Dark Mode Filters

πŸ§‘β€πŸ’» User Dashboard

User Dashboard

πŸ›’ Cart & Checkout

User Cart

πŸ‘₯ User Roles

πŸ” Admin

Admins have full control over shop inventory:

  • Add new sweets
  • Update sweet details
  • Restock inventory
  • Delete sweets
  • View real-time inventory status

πŸ›’ User

Users enjoy a seamless shopping experience:

  • Search sweets with multiple filters
  • Add items to cart
  • Increase or decrease quantities
  • View total cart value in real time
  • Purchase directly or via cart

🧩 Application Flow

  1. User or Admin registers or logs in
  2. System identifies role automatically
  3. Admin manages sweets inventory
  4. Users browse and filter sweets
  5. Items added to cart or purchased directly
  6. Total price updates in real time
  7. Checkout completes the order

πŸ› οΈ Local Setup Instructions

Backend

cd backend
npm install
npm run dev

Create a .env file:

MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_secret_key

Frontend

cd frontend
npm install
npm start

🎯 Why This Project Stands Out

  • Real-world shop workflow implementation
  • Clean and modern UI design
  • Role-based access control
  • Scalable backend architecture
  • Responsive across all devices
  • Test-driven development approach

πŸ“Œ Future Enhancements

  • Order history and invoice generation
  • Sales analytics dashboard
  • Order tracking system
  • Low-stock notifications
  • Online payment gateway integration

πŸ‘¨β€πŸ’» Author

Sachin
Software Engineer passionate about building clean, scalable web applications with strong backend logic and modern UI design.


⭐ If you like this project, consider giving it a star on GitHub. It really helps and means a lot.

Releases

No releases published

Packages

No packages published