A full-stack web application for managing orders and inventory — built with Spring Boot on the backend and React on the frontend.
| Layer | Technology |
|---|---|
| Frontend | React.js, Axios, React Router |
| Backend | Spring Boot, Spring Data JPA, Spring Security |
| Database | MySQL / PostgreSQL |
| Authentication | JWT (JSON Web Tokens) |
| Build Tools | Maven (backend), npm / Vite (frontend) |
- 📋 Order Management — Create, view, update, and delete orders
- 🗃️ Inventory Tracking — Monitor stock levels, add/remove products
- 🔐 Authentication & Authorization — Secure JWT-based login with role-based access (Admin / User)
- 📊 Dashboard — Overview of current inventory stats and recent orders
- 🔄 RESTful API — Clean API layer separating frontend and backend concerns
- 📱 Responsive UI — Works seamlessly across desktop and mobile
order-inventory-webapp/
│
├── backend/ # Spring Boot Application
│ ├── src/
│ │ ├── main/
│ │ │ ├── java/
│ │ │ │ └── com/example/
│ │ │ │ ├── controller/ # REST Controllers
│ │ │ │ ├── service/ # Business Logic
│ │ │ │ ├── repository/ # JPA Repositories
│ │ │ │ ├── model/ # Entity Classes
│ │ │ │ ├── dto/ # Data Transfer Objects
│ │ │ │ └── security/ # JWT & Spring Security Config
│ │ │ └── resources/
│ │ │ └── application.properties
│ └── pom.xml
│
└── frontend/ # React Application
├── src/
│ ├── components/ # Reusable UI Components
│ ├── pages/ # Page-level Components
│ ├── services/ # Axios API Calls
│ ├── context/ # Auth Context / State Management
│ └── App.jsx
├── public/
└── package.json
- Java 17+
- Node.js 18+ & npm
- MySQL or PostgreSQL
- Maven 3.8+
-
Clone the repository
git clone https://github.com/Gurjot0101/order-inventory-webapp.git cd order-inventory-webapp/backend -
Configure the database in
src/main/resources/application.properties:spring.datasource.url=jdbc:mysql://localhost:3306/order_inventory_db spring.datasource.username=your_username spring.datasource.password=your_password spring.jpa.hibernate.ddl-auto=update spring.jpa.show-sql=true # JWT Secret app.jwt.secret=your_jwt_secret_key app.jwt.expiration=86400000
-
Create the database
CREATE DATABASE order_inventory_db;
-
Run the Spring Boot application
mvn spring-boot:run
The backend starts at
http://localhost:8080
-
Navigate to the frontend directory
cd ../frontend -
Install dependencies
npm install
-
Configure API base URL in
.envor the Axios config:REACT_APP_API_URL=http://localhost:8080/api
-
Start the development server
npm start
The frontend runs at
http://localhost:3000
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| POST | /api/auth/register |
Register a new user | No |
| POST | /api/auth/login |
Login and receive JWT token (Role Based Admin/User) | No |
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| GET | /api/orders |
Get all orders | Yes |
| GET | /api/orders/{id} |
Get order by ID | Yes |
| POST | /api/orders |
Create a new order | Yes |
| PUT | /api/orders/{id} |
Update an order | Yes |
| DELETE | /api/orders/{id} |
Delete an order | Yes (Admin) |
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| GET | /api/products |
Get all products | Yes |
| GET | /api/products/{id} |
Get product by ID | Yes |
| POST | /api/products |
Add a new product | Yes (Admin) |
| PUT | /api/products/{id} |
Update product details | Yes (Admin) |
| DELETE | /api/products/{id} |
Delete a product | Yes (Admin) |
Client Server
| |
|-- POST /auth/login --------> |
| | Validate credentials
|<-- JWT Token ---------------|
| |
|-- GET /api/orders |
| Authorization: Bearer JWT |
| | Validate token
|<-- Orders Data -------------|
All protected routes expect the header:
Authorization: Bearer <your_jwt_token>
# Backend unit and integration tests
cd backend
mvn test
# Frontend tests
cd frontend
npm testmvn clean package
java -jar target/order-inventory-webapp-0.0.1-SNAPSHOT.jarnpm run build
# Serve the /build folder via Nginx, Apache, or any static host- Fork the repository
- Create your feature branch:
git checkout -b feature/your-feature - Commit your changes:
git commit -m 'Add some feature' - Push to the branch:
git push origin feature/your-feature - Open a Pull Request
This project is licensed under the MIT License.