A complete, full-stack billing and inventory management system designed to automate and streamline retail operations.
OneBill is a comprehensive, real-world application built to solve the daily challenges faced by retail businesses. It provides a robust platform for managing sales, generating invoices, tracking inventory in real-time, and processing payments seamlessly.
The system is architected with a secure, stateless backend using Spring Boot and a responsive, dynamic frontend using React.js, ensuring a reliable and user-friendly experience for both administrators and cashiers. This project demonstrates a full software development lifecycle, from system design and database integration to securing APIs and integrating third-party services.## 📸 Screenshots
| Login | Admin Dashboard |
| Point of Sale (POS) Interface | Inventory Management |
| Generated Invoice | |
- Secure Authentication: JWT-based secure login system for authorized access.
- Role-Based Access Control: Separate dashboards and permissions for
AdminandCashierroles.- Admin: Full access to inventory management, sales reports, and user management.
- Cashier: Access limited to the billing system and invoice generation.
- Real-Time Product Cart: Dynamically add, update, and remove items from the cart.
- Automated Invoice Generation: Instantly generate and print professional invoices for sales transactions.
- Inventory Management: A complete CRUD (Create, Read, Update, Delete) system for managing products and stock levels.
- Payment Gateway Integration: Seamlessly process payments using the Razorpay API, including secure signature verification.
- Cloud Storage: Integrated with AWS S3 for storing product images securely in the cloud.
- Dashboard Analytics: A dedicated endpoint that aggregates real-time sales data and recent order history.
The project is built using a modern, scalable technology stack:
- Backend: Java 21, Spring Boot, Spring Security, Spring Data JPA (Hibernate)
- Frontend: React.js, HTML5, CSS3
- Database: MySQL
- Security: JSON Web Tokens (JWT)
- Cloud Services: AWS S3
- Payment Gateway: Razorpay
- Build & Dependency: Maven
- Containerization: Docker
To get a local copy up and running, follow these simple steps.
- Java (JDK 21)
- Maven
- Node.js & npm
- MySQL Server
- Docker (Optional, for containerized deployment)
- Clone the repository:
git clone [https://github.com/Ankit0217/onebill.git](https://github.com/Ankit0217/onebill.git) cd onebill - Create a MySQL database:
CREATE DATABASE onebilldb;
- Configure Environment Variables:
Create an
application.propertiesfile insrc/main/resourcesor set environment variables with your credentials:# Database SPRING_DATASOURCE_URL=jdbc:mysql://localhost:3306/onebilldb SPRING_DATASOURCE_USERNAME=your_db_user SPRING_DATASOURCE_PASSWORD=your_db_password SPRING_JPA_HIBERNATE_DDL_AUTO=update # Services AWS_ACCESS_KEY=your_aws_key AWS_SECRET_KEY=your_aws_secret AWS_REGION=your_aws_region AWS_BUCKET_NAME=your_s3_bucket JWT_SECRET_KEY=your_jwt_secret RAZORPAY_KEY_ID=your_razorpay_id RAZORPAY_KEY_SECRET=your_razorpay_secret
- Run the application:
./mvnw spring-boot:run
- Navigate to the frontend directory:
(Assuming your React code is in a
frontendsubfolder)cd frontend - Install NPM packages:
npm install
- Start the development server:
npm start
This makes your API understandable.
⚙️ API Endpoints
A brief overview of the core API endpoints.
| HTTP Method | Endpoint | Description | Access |
|-------------|--------------------------|------------------------------------------------|-------------|
| `POST` | `/login` | Authenticates a user and returns a JWT. | Public |
| `POST` | `/admin/register` | Registers a new user (Admin only). | Admin |
| `GET` | `/categories` | Fetches all product categories. | Authenticated |
| `POST` | `/admin/items` | Adds a new item to the inventory. | Admin |
| `GET` | `/items` | Fetches all items. | Authenticated |
| `POST` | `/orders` | Creates a new order. | Authenticated |
| `POST` | `/payments/create-order` | Creates a Razorpay payment order. | Authenticated |
| `POST` | `/payments/verify` | Verifies the payment signature. | Authenticated |
| `GET` | `/dashboard` | Gets aggregated sales and order data. | Authenticated |
Distributed under the MIT License. See LICENSE.txt for more information.