A containerized application to track transportation expenses and generate Excel reports.
Built with FastAPI, SQLite, and Docker, this app lets you log daily transportation costs, view them, and export them as Excel spreadsheets.
💡 Useful for documenting transportation expenses for tax deductions or tax shield purposes, helping you keep accurate records for filing.
- Add daily/weekly transportation expenses via API.
- View all recorded expenses.
- Export expenses to Excel (
.xlsx) for reporting or tax documentation. - Containerized with Docker and Docker Compose for easy deployment.
- Persistent data storage via Docker volumes.
transportation-expense-tracker/
├── backend/ # FastAPI API code
├── data/ # SQLite DB (persistent storage)
├── exports/ # Excel exports
├── docker-compose.yml
├── README.md
└── .github/ # CI/CD pipelines (optional)- Docker
- Docker Compose
From the project root:
docker-compose up --build -dThe API will be available at http://localhost:8000.
API Endpoints
POST /expenses → Add a new expense.
GET /expenses → Retrieve all expenses.
GET /export → Export all expenses to Excel (exports/transportation_expenses.xlsx).
You can also use the Swagger UI: http://localhost:8000/docs
Example JSON for adding an expense:
{
"amount": 120,
"category": "Grab",
"notes": "Office commute"
}Once you have added expenses, run:
curl http://localhost:8000/exportThe Excel file will appear in the exports/ folder on your host machine.