Sweet Shop Management System

Inventory and request-approval system with admin and user roles. TypeScript API with Prisma, a React front end, 24 Jest tests and a Jenkins pipeline that pushes versioned Docker images.

CompletedDevOps & Cloud

Problem

A shop needs inventory management where admins and users have different powers, and where users can raise requests that an admin approves.

How it works

Jenkins pipeline. Select a step to read what happens there.

Checkout

Source is cloned from GitHub using the declarative pipeline in the Jenkinsfile.

Request path. Select a step to read what happens there.

React front end

Built with Vite and served by nginx in its own container.

Approach

A TypeScript Express API with Prisma, JWT authentication and role separation, a React front end, and Docker Compose files for development and production-style runs.

What I implemented

  • REST API with JWT authentication, admin and auth guards, Zod-style request validators and a domain error type handled in one error middleware.
  • Inventory, purchase and request-approval workflows, with Prisma migrations.
  • Backend tests with Jest covering auth, guards, inventory, search and delete (24 test cases).
  • Separate Dockerfiles for backend and frontend, with the frontend served by nginx, and dev and prod compose files with a backend health check.
  • Jenkins running in Docker with its own compose setup, and a pipeline that builds and pushes versioned images.

Technical challenges

  • Running the backend tests inside the Jenkins container needed several fixes (workspace mounts, npm ci for determinism). The pipeline was then simplified to build and push (visible in the commit history).

Decisions and trade-offs

  • Tests run locally and are not enforced in the pipeline. The README records this as a deliberate choice to keep builds reproducible; a CI test stage is the next step.

Limitations and next steps

  • Uses SQLite, so it suits a single instance. Tests are not part of the pipeline.

Are you sure?