This repository contains a Flask-based API (in the api/ folder) used for the Girls Hoo Hack 2025 project.
cd api python -m venv venv source venv/bin/activate pip install -r requirements.txt python app.py
Base URL (when running locally): http://localhost:5000
Below are the available endpoints (extracted from api/app.py). For POST/PUT endpoints the API expects JSON bodies. Fields depend on your app's collections (merchants, budgets, transactions, users, savings_goals).
GET /basic health check. Returns a short message indicating the API is running.
GET /merchants/fetchfetch merchants from the external Nessie API and store new merchants in the DB. Returns number inserted.GET /merchantsreturn all stored merchants (JSON array).POST /merchants/addadd a merchant. Expects a JSON object for the merchant.PUT /merchants/update/<merchant_id>update merchant identified bymerchant_id. Expects JSON body with fields to update.DELETE /merchants/delete/<merchant_id>delete merchant by id.
Example add merchant body (minimal):
{
"_id": "merchant_123",
"name": "Merchant Name",
"category": "shopping"
}POST /budgets/addadd a new budget item. Expects JSON body.GET /budgetslist all budgets.DELETE /budgets/delete/<budget_id>delete a budget by id.PUT /budgets/update/<budget_id>update a budget by id. Expects a JSON body with updates.GET /budgets/user/<user_id>get budgets belonging touser_id.
Example add budget body:
{
"_id": "budget_1",
"user_id": "user_123",
"name": "Groceries",
"amount": 300
}POST /transactions/addadd a transaction. Expects JSON body.GET /transactionslist all transactions.PUT /transactions/<transaction_id>update a transaction by id. Expects JSON body with updates.DELETE /transactions/delete/<transaction_id>delete a transaction by id.GET /transactions/user/<user_id>list transactions for a user.
Example add transaction body:
{
"_id": "txn_001",
"user_id": "user_123",
"merchant_id": "merchant_123",
"amount": 12.50,
"date": "2025-10-01"
}POST /users/addcreate a user (JSON body).GET /userslist all users.PUT /users/update/<user_id>update user by id (JSON body).DELETE /users/delete/<user_id>delete user by id.
Example add user body:
{
"_id": "user_123",
"name": "Jane Doe",
"email": "jane@example.com"
}POST /savings_goals/addadd a savings goal (JSON body).GET /savings_goalslist all savings goals.PUT /savings_goals/update/<goal_id>update a savings goal by id.DELETE /savings_goals/delete/<goal_id>delete a savings goal by id.
Example add savings goal body:
{
"_id": "goal_1",
"user_id": "user_123",
"name": "New Phone",
"target_amount": 500
}- Request/response shapes are not strictly enforced in the README they follow the JSON stored in the MongoDB collections used by
services.db.