Skip to content

Commit ef7eb99

Browse files
committed
done
1 parent 5019449 commit ef7eb99

1 file changed

Lines changed: 37 additions & 10 deletions

File tree

freight_project/readme.md

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,36 +18,62 @@ Updating everything live so you can see trucks move toward their destinations.
1818

1919
It’s a simplified way to explore how freight trading works without having to charter real ships or trucks.
2020

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
27+
│ └── requirements.txt # Python packages: FastAPI, Uvicorn, Pandas, NumPy
28+
29+
├── frontend/
30+
│ ├── 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
2238

2339
What each file does
2440

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.
2643

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.
2846

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).
3049

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.
3252

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.
3455

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.
3658

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.
3861

39-
How to Run Backend
62+
How to Run
63+
Backend
4064

4165
Go into the backend/ folder and activate your virtual environment.
4266

4367
Install dependencies:
4468

4569
pip install -r requirements.txt
4670

71+
4772
Start the FastAPI server:
4873

4974
uvicorn app:app --reload
5075

76+
5177
Server runs on http://127.0.0.1:8000.
5278

5379
Frontend
@@ -66,6 +92,7 @@ Run:
6692

6793
python main.py
6894

95+
6996
Follow the prompts to simulate trucks and loads step by step.
7097

7198
Features
@@ -82,4 +109,4 @@ Optional CLI version for terminal-based simulation.
82109

83110
Notes
84111

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

Comments
 (0)