Skip to content

Ankit0217/onebill

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OneBill - Ecommerce and Order Management System

A complete, full-stack billing and inventory management system designed to automate and streamline retail operations.

Badges

Java Spring Boot React MySQL AWS S3 Docker

📖 About The Project

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

✨ Key Features

  • Secure Authentication: JWT-based secure login system for authorized access.
  • Role-Based Access Control: Separate dashboards and permissions for Admin and Cashier roles.
    • 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.

🚀 Tech Stack

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

🏁 Getting Started

To get a local copy up and running, follow these simple steps.

Prerequisites

  • Java (JDK 21)
  • Maven
  • Node.js & npm
  • MySQL Server
  • Docker (Optional, for containerized deployment)

Backend Installation

  1. Clone the repository:
    git clone [https://github.com/Ankit0217/onebill.git](https://github.com/Ankit0217/onebill.git)
    cd onebill
  2. Create a MySQL database:
    CREATE DATABASE onebilldb;
  3. Configure Environment Variables: Create an application.properties file in src/main/resources or 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
  4. Run the application:
    ./mvnw spring-boot:run

Frontend Installation

  1. Navigate to the frontend directory: (Assuming your React code is in a frontend subfolder)
    cd frontend
  2. Install NPM packages:
    npm install
  3. Start the development server:
    npm start

6. API Endpoints Section

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 |

📄 License

Distributed under the MIT License. See LICENSE.txt for more information.

About

A full-stack retail billing and inventory management system built with Spring Boot and React.

Topics

Resources

Stars

Watchers

Forks