An open API service indexing awesome lists of open source software.

https://github.com/d-evm/rapidmart

Mimicing the operational flow of modern quick-commerce
https://github.com/d-evm/rapidmart

java maven q-commerce quick-commerce spring spring-boot

Last synced: about 2 months ago
JSON representation

Mimicing the operational flow of modern quick-commerce

Awesome Lists containing this project

README

          

# ๐Ÿ›’ RapidMart โ€“ Quick-Commerce Backend System (Under development)

RapidMart is a Spring Boot-based backend system that mimics the operational flow of modern quick-commerce services like Zepto, Blinkit, and Instamart. The focus is on logistics, zone-based store allocation, and real-time delivery simulation โ€” not just carts and listings.

---

## ๐Ÿš€ Features

- โœ… JWT-based Signup & Login
- โœ… Product listing by user's zone (auto-resolved from pincode)
- โœ… Store selection based on stock & proximity
- โœ… ETA calculation: processing + delivery + buffer
- โœ… Live order tracking via WebSocket
- โœ… Realistic delivery simulation (10km/h, buffers)
- โœ… Inventory deduction on order
- โœ… Scheduler updates order status every 30s

---

## ๐Ÿ“ฆ Tech Stack

| Layer | Tech |
|--------------|------------------------------|
| Backend | Java, Spring Boot |
| Security | Spring Security, JWT |
| Real-time | WebSockets (STOMP + SockJS) |
| Database | PostgreSQL |
| Testing | Postman, HTML Client |

---

## ๐Ÿ” Authentication

Use the `/auth/signup` and `/auth/login` endpoints to get a JWT token.

Then pass it in the `Authorization` header like:
```
Authorization: Bearer
```

---

## ๐Ÿ“ก WebSocket Live Order Tracking

You can test **live order tracking** in real time using this demo page:

๐Ÿ‘‰ [๐Ÿ–ฅ Live WebSocket Demo](https://d-evm.github.io/rapidmart-html-client/)

### How to Use:

1. Place an order via `/orders` (see Postman below)
2. Open the demo link
3. Enter:
- `Order ID` (from response)
- `JWT Token` (from login)
4. You will receive live updates like:
```
Status: Out for Delivery | 6 min left
```

---

## ๐Ÿ” Order Flow

1. User logs in (JWT token)
2. User places order (POST `/orders`)
3. System:
- Selects nearest store with full inventory
- Deducts stock
- Calculates ETA
4. Background scheduler updates order status every 30s
5. User receives WebSocket push updates

---

## ๐Ÿงช Postman Collection

You can import this collection to test signup, login, order placement, etc.

๐Ÿ“ฅ [Download RapidMart Postman Collection](./client-test/RapidMart_Postman_Collection.json)

---

## ๐Ÿ—‚ Project Structure

```
src/main/java/com/rapidmart/
โ”œโ”€โ”€ controllers # REST Controllers
โ”œโ”€โ”€ dtos # Request/Response DTOs
โ”œโ”€โ”€ models # JPA Entities
โ”œโ”€โ”€ repositories # Spring Data JPA Repositories
โ”œโ”€โ”€ schedulers # WebSocket update scheduler
โ”œโ”€โ”€ security # JWT, Filters, Configs
โ”œโ”€โ”€ services # Business logic
โ”œโ”€โ”€ config # WebSocket & app configs
โ””โ”€โ”€ RapidMartApplication.java
```

---

## ๐Ÿ›  Running the App

```bash
# Clone backend
git clone https://github.com/yourusername/rapidmart-backend.git
cd rapidmart-backend

# Configure PostgreSQL (update application.properties)

# Run the app
./mvnw spring-boot:run
```

App runs at: `http://localhost:8084`

---

## ๐ŸŒ GitHub Pages Demo

The real-time HTML WebSocket client is deployed live:

๐Ÿ‘‰ https://d-evm.github.io/rapidmart-html-client/

If you want to run it locally:
```bash
cd client-test
open rapidmart_order_tracker.html
```