Raqeeb is a backend system that integrates IoT sensor data, smart contracts, and a dashboard for logistics management. It consists of three servers, each handling a distinct aspect of the system.
Raqeeb is built using three different backend technologies:
-
Sensor Server (TypeScript)
- Handles sensor data from trucks.
- Provides a
GETrequest to retrieve the truck destination. - Sends real-time GPS data via WebSocket.
- Calls the Django server to determine the destination.
- Logs all events in Redis for event-driven architecture.
-
Contract Server (Express + Ethereum.js)
- Manages Ethereum smart contracts.
- Handles three main events:
route_end: Signals the completion of a shipment.alert: Sends real-time WebSocket alerts.ok: Verifies shipment completion and creates a smart contract.
- Uses Solidity for smart contract development.
- Utilizes Foundry for running and deploying contracts locally.
- Provides two main API routes:
GET /route- Retrieves the latest shipment data.WS /alert- Provides real-time WebSocket alerts.
-
Dashboard Server (Django)
- Provides CRUD operations (
GET,POST,PUT) for trucks and packages. - Serves as the central dashboard for logistics management.
- Implements authentication with MetaMask using Wagmi.
- Provides CRUD operations (
- TypeScript (Sensor Server)
- Express + Ethereum.js + Solidity (Contract Server)
- Django (Dashboard Server)
- Redis (Event-driven architecture)
- Foundry (Smart contract deployment and testing)
- Wagmi (MetaMask authentication and Ethereum interactions)
- Node.js
- Python + Django
- Redis
- Foundry
- Ethereum.js
- wagmi
- next
- metamask
- Clone the repository:
git clone https://github.com/wailbentafat/Tatweer- cd raqeeb - Install dependencies for each server:
- Sensor Server (TypeScript)
cd sensor-server npm install - Contract Server (Express + Ethereum.js)
cd contract-server npm install - Dashboard Server (Django)
cd dashboard-server run django
- Sensor Server (TypeScript)
- Start Redis:
redis-server
- Start each server:
- Sensor Server:
suive bun run protocole
- Contract Server:
suivre bun run protocole
- Dashboard Server:
python manage.py runserver
- Sensor Server:
GET /destination- Retrieves truck destination.WS /ws- WebSocket route that provides real-time GPS data.
GET /route- Retrieves latest shipment data.WS /alert- Real-time WebSocket alerts.
crud /truck- Retrieves truck data. .crud /package- Adds a package.
-build with wagmi and next and metamask
- Written in Solidity.
- Deployed using Foundry.
- Handles shipment validation and verification.
- Redis is used for logging events.
- WebSockets are used for real-time tracking and alerts.
- Fork the repository.
- Create a new branch:
git checkout -b feature-branch
- Commit changes:
git commit -m "Your message" - Push and create a pull request.
MIT License
