You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: freight_project/readme.md
+37-10Lines changed: 37 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,36 +18,62 @@ Updating everything live so you can see trucks move toward their destinations.
18
18
19
19
It’s a simplified way to explore how freight trading works without having to charter real ships or trucks.
20
20
21
-
Project Structure freight_project/ │ ├── backend/ │ ├── app.py # FastAPI backend that handles all the simulation endpoints │ ├── freight_trading.py # All the simulation logic: trucks, loads, assignments, movement │ └── requirements.txt # Python packages: FastAPI, Uvicorn, Pandas, NumPy │ ├── frontend/ │ ├── index.html # My web dashboard with map, inputs, and controls │ ├── script.js # JS code for fetching backend data and updating the map │ └── style.css # Styles for the dashboard UI │ ├── cli/ │ └── main.py # Optional command-line interface version of the simulation │ └── README.md # This file
21
+
Project Structure
22
+
freight_project/
23
+
│
24
+
├── backend/
25
+
│ ├── app.py # FastAPI backend that handles all the simulation endpoints
26
+
│ ├── freight_trading.py # All the simulation logic: trucks, loads, assignments, movement
│ ├── index.html # My web dashboard with map, inputs, and controls
31
+
│ ├── script.js # JS code for fetching backend data and updating the map
32
+
│ └── style.css # Styles for the dashboard UI
33
+
│
34
+
├── cli/
35
+
│ └── main.py # Optional command-line interface version of the simulation
36
+
│
37
+
└── README.md # This file
22
38
23
39
What each file does
24
40
25
-
backend/app.py This is where the backend API lives. It starts the simulation, updates truck positions, and lets the frontend ask for the current status or create new loads.
41
+
backend/app.py
42
+
This is where the backend API lives. It starts the simulation, updates truck positions, and lets the frontend ask for the current status or create new loads.
26
43
27
-
backend/freight_trading.py All the logic for the simulation happens here. Trucks, loads, assignment rules, distance calculations, and movement step-by-step are all handled in this file.
44
+
backend/freight_trading.py
45
+
All the logic for the simulation happens here. Trucks, loads, assignment rules, distance calculations, and movement step-by-step are all handled in this file.
28
46
29
-
backend/requirements.txt Lists all the Python libraries you need to run the backend (FastAPI, Uvicorn, Pandas, NumPy).
47
+
backend/requirements.txt
48
+
Lists all the Python libraries you need to run the backend (FastAPI, Uvicorn, Pandas, NumPy).
30
49
31
-
frontend/index.html The dashboard where you control the simulation. You can input the number of trucks and loads, start the simulation, and watch everything happen on a map.
50
+
frontend/index.html
51
+
The dashboard where you control the simulation. You can input the number of trucks and loads, start the simulation, and watch everything happen on a map.
32
52
33
-
frontend/script.js This JS handles fetching the backend data, updating truck markers, drawing lines to loads, and keeping the map live and dynamic.
53
+
frontend/script.js
54
+
This JS handles fetching the backend data, updating truck markers, drawing lines to loads, and keeping the map live and dynamic.
34
55
35
-
frontend/style.css Simple styling for the dashboard—makes the inputs, buttons, and map look clean.
56
+
frontend/style.css
57
+
Simple styling for the dashboard—makes the inputs, buttons, and map look clean.
36
58
37
-
cli/main.py A command-line version of the simulation. Lets you run everything step by step in the terminal without using the web interface.
59
+
cli/main.py
60
+
A command-line version of the simulation. Lets you run everything step by step in the terminal without using the web interface.
38
61
39
-
How to Run Backend
62
+
How to Run
63
+
Backend
40
64
41
65
Go into the backend/ folder and activate your virtual environment.
42
66
43
67
Install dependencies:
44
68
45
69
pip install -r requirements.txt
46
70
71
+
47
72
Start the FastAPI server:
48
73
49
74
uvicorn app:app --reload
50
75
76
+
51
77
Server runs on http://127.0.0.1:8000.
52
78
53
79
Frontend
@@ -66,6 +92,7 @@ Run:
66
92
67
93
python main.py
68
94
95
+
69
96
Follow the prompts to simulate trucks and loads step by step.
70
97
71
98
Features
@@ -82,4 +109,4 @@ Optional CLI version for terminal-based simulation.
82
109
83
110
Notes
84
111
85
-
I built this for OwlHacks 2025 to explore freight logistics and trading in a visual, interactive way. It’s not a real freight market, but it gives a sense of how capacity, demand, and delivery timing all interact.
112
+
I built this for OwlHacks 2025 to explore freight logistics and trading in a visual, interactive way. It’s not a real freight market, but it gives a sense of how capacity, demand, and delivery timing all interact.
0 commit comments