SafeShipping is a blockchain-based logistics platform using smart contracts, decentralized oracles, and IoT integrations to automate, secure, and verify global shipping workflows.
This repository contains a comprehensive directory structure for developing and deploying the SafeShipping platform. For detailed information about the directory structure, please refer to the directory_structure.md file.
- Smart Contracts: Blockchain contracts for secure, transparent shipping workflows
- WASM Assembly Language: Web Assembly Language for performance and efficiency
- Backend API: Server-side application for business logic and data management
- Frontend Application: User interface for interacting with the platform
- IoT Integration: Components for connecting with IoT devices and sensors
- Oracle Services: Decentralized data feeds connecting smart contracts with external data
- Documentation: Comprehensive guides for developers and users
- Clone this repository
- Review the directory structure documentation
- Set up the development environment using Docker
- Begin implementing components based on the provided structure
bash bash ./docker/build/dev_compose.sh
This script was previously docker-compose_local_only.sh, now reorganized into docker/build/.
backend-api for manifest intake
oracle-service for token minting
blockchain-node for ledger simulation
bash
curl -X POST http://localhost:8080/api/intake/manifest
-H "Content-Type: application/json"
-d '{"sender":"Richard", "receiver":"Kalani", "carrier":"FedEx"}'
bash cd frontend npm run dev Which launched the Vite dev server at http://localhost:5173.
Choose your environment:
For manual development without containers.
wsl -d Ubuntu
cd ~/Projects/SafeShipping/backend
uvicorn src.main:app --host 0.0.0.0 --port=8080 --reload
Or launch via Docker Compose:
bash
bash docker/build/dev_compose.sh
🔹 Frontend (Windows Host)
bash
cd frontend
npm install
npm run dev
Access the UI at: http://localhost:5173
🧪 Dev Startup (Full Stack via Docker)
Runs all containers with dev tooling and hot reload.
🔹 Services
backend-api
oracle-service
blockchain-node
frontend
smart-contracts
🔹 Launch All
bash
cd docker
bash ./build/dev_compose.sh
Compose file used: docker/config/docker-compose.yml
Verify containers:
bash
docker ps
🏭 Production Deployment
🔹 Docker Compose (Secure Build)
Use production compose file:
bash
docker compose -f docker/config/docker-compose.prod.yml up -d
Includes HTTPS, env injection, and production images.
🔹 Kubernetes (Optional)
If using K8s, apply manifests from:
k8s/
├── deployment.yaml
├── service.yaml
├── ingress.yaml
bash
kubectl apply -f k8s/
📋 Manifest Workflow (Manual Test)
🔹 Submit Manifest via Curl
bash
curl -X POST http://localhost:8080/api/intake/manifest \
-H "Content-Type: application/json" \
-d '{"sender":"Richard", "receiver":"Kalani", "carrier":"FedEx"}'
🔹 Submit via Frontend Button
Fill out the form
Click "Submit via API"
Paste Manafest for Submission
Example Manafest
---
{
"origin": "80112",
"destination": "80113",
"weight": "5",
"insurance": true,
"carrier": "FedEx",
"departure_time": "07/22/2025 5:00PM",
"arrival_time": "07/25/2025 10:00AM",
"fragility": "Very",
"sender": "Richard O'Brien",
"receiver": "Kalani Weldon",
"priority": "High",
"transportMode": "truck",
"contents": "Electronics",
"departure_location": "Centennial, CO",
"arrival_location": "Highlands Ranch, CO",
"status_dispatch": "Pending",
"status_transit": "Pending",
"status_delivery": "Pending"
}
---
Token will display on successful response
⚙️ Folder Structure Summary
SAFESHIPPING/
├── backend/ # API logic, token minting
├── frontend/ # Vite UI
├── docker/
│ ├── build/ # Shell scripts for builds
│ ├── test/ # Shell scripts for testing
│ ├── dev/ # Dev launchers
│ ├── config/ # Compose YAMLs
│ └── frontend/ # Dockerfile.dev for UI
├── k8s/ # Kubernetes manifests
├── scripts/ # Blockchain test utils (curl)
├── .env # Runtime env vars
├── .env.example # Template env vars
├── cleanup_root.sh # Root cleanup utility
├── README.md # You are here
🧠 Tips for Developers
🟢 Always run backend before frontend if doing local dev
🔄 Use cleanup_root.sh after major file restructuring
📦 Manifest tokens are logged and traceable on-chain
🛡️ Write tests inside tests/ and run with pytest or npm test
👥 Contributors
Name Role
Richard Lead Architect & Token Designer
Richard UX Systems & Compliance Logic
## License
This project is licensed under the GPL-3.0 License - see the [LICENSE](./LICENSE) file for details.