{"id":25089631,"url":"https://github.com/tushar-swarnkar/cafe-management-system","last_synced_at":"2026-04-17T07:31:44.552Z","repository":{"id":276195888,"uuid":"926009479","full_name":"tushar-swarnkar/cafe-management-system","owner":"tushar-swarnkar","description":"A backend service for a Cafe Management System built with Java, Spring Boot, and MySQL. It provides JWT-based authentication, role-based access control, email notifications, and PDF bill generation. The system allows admins to manage users, categories, products, and orders efficiently while ensuring secure access and smooth operations. 🚀","archived":false,"fork":false,"pushed_at":"2025-02-06T19:51:34.000Z","size":59,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-01T17:27:11.378Z","etag":null,"topics":["backend-services","java","jpa-hibernate","jwt-authentication","jwt-token","maven-pom","mysql","rest-api","spring-boot","spring-mvc","spring-security","web-application"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tushar-swarnkar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-02T10:20:07.000Z","updated_at":"2025-02-06T19:59:53.000Z","dependencies_parsed_at":"2025-02-06T20:34:59.894Z","dependency_job_id":"44ca988e-72e4-49de-a768-427e182edaa3","html_url":"https://github.com/tushar-swarnkar/cafe-management-system","commit_stats":null,"previous_names":["tushar-swarnkar/cafe-management-system"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tushar-swarnkar/cafe-management-system","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tushar-swarnkar%2Fcafe-management-system","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tushar-swarnkar%2Fcafe-management-system/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tushar-swarnkar%2Fcafe-management-system/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tushar-swarnkar%2Fcafe-management-system/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tushar-swarnkar","download_url":"https://codeload.github.com/tushar-swarnkar/cafe-management-system/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tushar-swarnkar%2Fcafe-management-system/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31919896,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T18:22:33.417Z","status":"online","status_checked_at":"2026-04-17T02:00:06.879Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backend-services","java","jpa-hibernate","jwt-authentication","jwt-token","maven-pom","mysql","rest-api","spring-boot","spring-mvc","spring-security","web-application"],"created_at":"2025-02-07T11:18:11.201Z","updated_at":"2026-04-17T07:31:44.145Z","avatar_url":"https://github.com/tushar-swarnkar.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cafe Management System (Backend)\n\n## 📌 Project Overview\nThis repository contains the backend implementation of the **Cafe Management System** built using **Java** and **Spring Boot**. It provides a robust API for managing cafe-related operations, including authentication, user management, and data handling. The project follows a well-structured package hierarchy and integrates **Spring Security** with JWT authentication.\n\n## 📌 Features\n✔️ User Authentication \u0026 Authorization (JWT-based)  \n✔️ Secure API Endpoints with Role-Based Access Control  \n✔️ Database Integration with MySQL  \n✔️ Modular and Clean Code Structure  \n✔️ RESTful API Design  \n✔️ Sends mail to registered users using **JavaMailSender**  \n✔️ Only **Admin** can change the user status (active/inactive)  \n✔️ All **Admins** receive an email notification when an admin updates a user’s status  \n✔️ Generates a **PDF bill** for purchased products, including name, category, quantity, price, subtotal \u0026 total price  \n✔️ PDF bill contains user details (name, contact, email, payment method) and a **Thank You** note  \n✔️ Forgot Password functionality – sends reset password mail to the registered user  \n\n## 🛠️ Tech Stack\n- **Java**\n- **Spring Boot 3.x**\n- **Spring Security 6**\n- **Maven**\n- **MySQL**\n- **Git \u0026 GitHub**\n\n### 🏗️ Spring Boot Dependencies\n- **Spring Boot Starter Web** – For building RESTful web applications\n- **Spring Boot Starter Security** – For implementing authentication \u0026 authorization\n- **Spring Boot Starter Data JPA** – For database interactions using MySQL\n- **Spring Boot Starter Mail** – For sending emails using JavaMailSender\n- **Spring Boot Starter Thymeleaf** – For generating PDF files\n- **Spring Boot Starter Validation** – For handling validation of request data\n\n## 🔐 Authentication \u0026 Security\nThis project implements **JWT (JSON Web Token) authentication** using **Spring Security**. \n- The `JWT` package contains utility classes for generating, validating, and parsing JWT tokens.\n- It ensures secure access to API endpoints by restricting unauthorized requests.\n\n### 🔑 JWT Package Overview\n- **JwtUtil.java** – Utility class for JWT operations:\n  - Generates, extracts, and validates JWT tokens to ensure secure authentication.\n  - Retrieves claims such as username and expiration details from tokens.\n  - Checks for token expiration and ensures validity.\n\n- **JwtFilter.java** – Handles JWT-based authentication:\n  - Intercepts HTTP requests to extract and validate JWT tokens.\n  - If the token is valid, sets authentication in the security context.\n  - Provides methods to check user roles and retrieve the current user.\n\n- **CustomerUserDetailsService.java** – Implements user authentication:\n  - Loads user details from the database during authentication.\n  - Retrieves and provides user-specific data for security processing.\n\n- **SecurityConfig.java** – Configures security settings:\n  - Defines JWT authentication filter and request authorization rules.\n  - Manages password encoding, authentication manager, and security filter chain.\n\n\n## 📖 API ENDPOINT GUIDE\n\n### APIs without security authentication:\n- **`/login`** – Authenticate and login user\n- **`/signup`** – Register new users\n- **`/forgot-password`** – Sends password reset email using JavaMailSender\n\n### APIs with security authentication \u0026 validation:\n\n#### 📊 DASHBOARD:\n- Get **dashboard details** (categories, products, bills)\n\n#### 👤 USER:\n- **`/update`** – Update user details\n- **`/change-password`** – Change user password\n\n#### 🛠️ ADMIN:\n- Get all registered users with their status (active/inactive)\n\n#### 📂 CATEGORY:\n- **`POST`** Add new category\n- **`GET`** Get all categories\n- **`PUT`** Update category\n\n#### 🏷️ PRODUCT:\n- **`POST`** Add new product\n- **`GET`** Get all products\n- **`GET`** Get products by category (only available products)\n- **`GET`** Get product by ID\n- **`PUT`** Update product\n- **`PUT`** Update product status\n- **`DELETE`** Delete product by ID\n\n#### 🧾 BILL:\n- **`POST`** Generate bill\n- **`GET`** Get bills by username\n- **`POST`** Get PDF bill by UUID\n- **`DELETE`** Delete bill by ID (different from UUID)\n\n---\n\n## 📂 Package Structure\n```yaml\n📂 inn.cafe\n├── 📦 constants         # Contains application-wide constants\n├── 📂 dao               # Data Access Objects (Repositories for database interactions)\n├── 🔐 JWT               # Handles JWT authentication \u0026 token management\n├── 📦 POJO              # Plain Old Java Objects (Models representing database entities)\n├── 🌍 rest              # Controller layer (Handles API requests)\n├── ⚙️ restImpl          # Implementation of REST APIs\n├── 🔧 service           # Service interfaces (Business logic layer)\n├── 🏗️ serviceImpl       # Implementation of service interfaces\n├── 🛠️ utils             # Utility classes (Helper methods, validations, etc.)\n└── 📦 wrapper           # Custom response wrappers for API responses\n\n📂 resources\n└── 📄 application.properties  # Spring Boot configuration file (Database, JWT settings, etc.)\n```\n\n## 🚀 How to Run the Project\n### 1️⃣ Clone the Repository\n```sh\ngit clone https://github.com/tushar-swarnkar/cafe-management-system.git\ncd cafe-management-system\n```\n\n### 2️⃣ Configure Database\n- Update `application.properties` with your **MySQL database credentials**.\n\n### 3️⃣ Build and Run the Project\n```sh\nmvn clean install\nmvn spring-boot:run\n```\n\n### 4️⃣ API Testing\nUse **Postman** or any API testing tool to test the endpoints.\n---\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftushar-swarnkar%2Fcafe-management-system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftushar-swarnkar%2Fcafe-management-system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftushar-swarnkar%2Fcafe-management-system/lists"}