The Supply Chain Visualizer is a comprehensive web application designed to provide powerful visualization and analysis of supply chain networks. By combining React frontend technology with a robust Spring Boot/Java backend, this platform enables businesses to interactively map their supply chains, track inventory levels, and monitor shipment status in real-time. The application provides actionable insights through performance metrics and data visualizations, allowing users to identify bottlenecks and opportunities for optimization. With a user-friendly interface integrating Leaflet maps and Chart.js visualizations, the Supply Chain Visualizer transforms complex supply chain data into accessible, meaningful information.
The ultimate goal is to equip businesses with the analytical tools and visual insights needed to strengthen their supply chain resilience, improve operational efficiency, and make data-driven decisions in an increasingly complex global logistics environment. ππ
- Features
- Technology Stack
- Installation
- Project Structure
- Core Components
- API Documentation
- Deployment
- Development
- Troubleshooting
- Contributing
- Contact
- Supply Chain Map: Visualize your supply chain network with an interactive map
- Inventory Dashboard: Track inventory levels across facilities
- Shipment Tracker: Monitor shipment status and delivery timelines
- Performance Metrics: View key performance indicators for your supply chain
- Data Management: Add and update supply chain nodes, connections, and inventory data
- Basic Optimization: Get suggestions for improving your supply chain efficiency
- React for the user interface
- JavaScript (ES6+)
- Chart.js for data visualization
- Leaflet for map-based visualization
- Bootstrap for styling
- Axios for API requests
- Java with Spring Boot
- Spring Data JPA with Hibernate for ORM
- Spring Security with JWT for authentication
- RESTful API design
- PostgreSQL
- Git/GitHub for version control
- Docker for containerization (optional)
- AWS (EC2 for application hosting, S3 for static assets)
- Node.js (v14+)
- Java 11+ with Maven
- PostgreSQL
- Git
-
Clone the repository:
git clone https://github.com/mariarodr1136/SupplyChainVisualizer.git cd SupplyChainVisualizer -
Set up the database:
# Create a PostgreSQL database createdb supply_chain_db -
Configure database connection:
# Edit the application.properties file nano backend/src/main/resources/application.properties -
Build and run the backend:
cd backend cd supply-chain-visualizer mvn clean install mvn spring-boot:run
The backend server will start on http://localhost:3000
-
Install frontend dependencies:
cd ../frontend npm install -
Start the development server:
npm start
-
Access the application at http://localhost:3000
SupplyChainVisualizer.Demo.mov
supply-chain-visualizer/
βββ frontend/ # React frontend
β βββ public/ # Static files
β βββ src/
β βββ components/ # Reusable components
β βββ pages/ # Page components
β βββ services/ # API services
β βββ context/ # React context providers
β βββ App.js # Main App component
β βββ index.js # Entry point
β
βββ backend/ # Java Spring Boot backend
β βββ src/
β β βββ main/
β β β βββ java/
β β β β βββ controller/ # API controllers
β β β β βββ dto/ # Data Transfer Objects
β β β β βββ model/ # Entity models
β β β β βββ repository/ # JPA repositories
β β β β βββ security/ # JWT and security config
β β β β βββ service/ # Business logic
β β β βββ resources/ # Configuration files
β β βββ test/ # Test code
β βββ pom.xml # Maven dependencies
β
βββ .gitignore # Git ignore file
βββ README.md # Project documentation
The interactive map shows your supply chain network with:
- Nodes representing facilities (factories, warehouses, stores)
- Connections showing transportation routes
- Color coding to indicate performance status
Track and manage inventory across your network:
- Current stock levels by location
- Historical inventory trends
- Low stock alerts
Monitor the movement of goods:
- Active shipments with status indicators
- Delivery timelines and delays
- Historical shipment data
Measure the efficiency of your supply chain:
- On-time delivery rates
- Inventory turnover
- Fulfillment times
- Cost metrics
This section describes how to authenticate and interact with the Supply Chain Visualizer backend.
POST /api/auth/register
Content-Type: application/json
{
"username": "<your_username>",
"email": "<your_email>",
"password": "<your_password>"
}POST /api/auth/login
Content-Type: application/json
{
"username": "<your_username>",
"password": "<your_password>"
}Sample Response
{
"token": "eyJhbGciOiJIUzUxMiJ9...",
"type": "Bearer",
"id": 3,
"username": "james",
"email": "james@gmail.com",
"roles": ["ROLE_USER"]
}Include the JWT in the Authorization header for all protected requests:
Authorization: Bearer <your_token_here>
| Category | Method | Endpoint | Description |
|---|---|---|---|
| Nodes | GET | /api/nodes |
List all supply chain nodes |
| GET | /api/nodes/:id |
Retrieve a specific node | |
| POST | /api/nodes |
Create a new node | |
| PUT | /api/nodes/:id |
Update an existing node | |
| DELETE | /api/nodes/:id |
Delete a node | |
| Connections | GET | /api/connections |
List all connections |
| POST | /api/connections |
Create a new connection | |
| PUT | /api/connections/:id |
Update a connection | |
| DELETE | /api/connections/:id |
Delete a connection | |
| Inventory | GET | /api/inventory |
List inventory across all nodes |
| GET | /api/inventory/:nodeId |
Inventory for a specific node | |
| POST | /api/inventory |
Add or update inventory data | |
| Shipments | GET | /api/shipments |
List all shipments |
| GET | /api/shipments/:id |
Retrieve a specific shipment | |
| POST | /api/shipments |
Create a new shipment | |
| PUT | /api/shipments/:id |
Update a shipment | |
| PUT | /api/shipments/status/:id |
Update shipment status | |
| Products | POST | /api/products |
Create a new product |
| GET | /api/products |
List all products | |
| GET | /api/products/sku/:sku |
Retrieve a product by SKU |
POST /api/nodes
Content-Type: application/json
Authorization: Bearer <your_token_here>
{
"name": "Warehouse Alpha",
"type": "warehouse",
"latitude": 25.7617,
"longitude": -80.1918,
"capacity": 1000,
"status": "active"
}POST /api/connections
Content-Type: application/json
Authorization: Bearer <your_token_here>
{
"sourceId": 1,
"targetId": 2,
"transportationType": "truck",
"distance": 300.5,
"travelTime": 6,
"costPerUnit": 2.75,
"status": "active"
}POST /api/inventory
Content-Type: application/json
Authorization: Bearer <your_token_here>
{
"nodeId": 1,
"productId": 10,
"quantity": 500,
"minThreshold": 100,
"maxThreshold": 1000
}POST /api/shipments
Content-Type: application/json
Authorization: Bearer <your_token_here>
{
"sourceId": 1,
"destinationId": 2,
"status": "in_transit",
"departureDate": "2025-04-20",
"estimatedArrival": "2025-04-21",
"actualArrival": null,
"items": [
{ "productId": 101, "quantity": 50 },
{ "productId": 102, "quantity": 75 }
]
}POST /api/products
Content-Type: application/json
Authorization: Bearer <your_token_here>
{
"name": "Laptop Model X",
"description": "High performance laptop",
"unitPrice": 999.99,
"weight": 2.5,
"sku": "LT-X-001",
"status": "active"
}GET /api/products
Authorization: Bearer <your_token_here>GET /api/products/sku/LT-X-001
Authorization: Bearer <your_token_here># Build and start the containers
docker-compose up -d- Launch an EC2 instance with appropriate security groups
- Install dependencies (Node.js, Java, PostgreSQL)
- Clone the repository and set up the application
- Use a process manager like PM2 to run the application
- Set up an Nginx reverse proxy for the frontend and API
- (Optional) Create an S3 bucket for static assets
To add a new feature to the supply chain visualizer:
-
Backend:
- Create a new entity model
- Create a repository interface
- Create a service interface and implementation
- Create a controller with REST endpoints
-
Frontend:
- Create an API service
- Create the UI components
- Add the feature to the relevant page
- Update the navigation as needed
# Backend tests
cd backend
cd supply-chain-visualizer
mvn test
# Frontend tests
cd frontend
npm testCommon issues and their solutions:
- Database connection errors: Verify your PostgreSQL service is running and credentials are correct in application.properties
- JWT authentication issues: Check that the secret key is properly configured
- CORS errors: Ensure that the backend is properly configured to accept requests from the frontend origin
Feel free to submit issues or pull requests for improvements or bug fixes. You can also open issues to discuss potential changes or enhancements. All contributions are welcome to enhance the appβs features or functionality!
To contribute, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix:
git checkout -b feat/your-feature-name
- Alternatively, for bug fixes:
git checkout -b fix/your-bug-fix-name
- Make your changes and run all tests before committing the changes and make sure all tests are passed.
- After all tests are passed, commit your changes with descriptive messages:
git commit -m 'add your commit message' - Push your changes to your forked repository:
git push origin feat/your-feature-name.
- Submit a pull request to the main repository, explaining your changes and providing any necessary details.
If you have any questions or feedback, feel free to reach out at mrodr.contact@gmail.com.