Skip to content

chemystery09/ghh25

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Girls Hoo Hack 2025

This repository contains a Flask-based API (in the api/ folder) used for the Girls Hoo Hack 2025 project.

Run API locally

cd api python -m venv venv source venv/bin/activate pip install -r requirements.txt python app.py

API Endpoints

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

Health

  • GET / basic health check. Returns a short message indicating the API is running.

Merchants

  • GET /merchants/fetch fetch merchants from the external Nessie API and store new merchants in the DB. Returns number inserted.
  • GET /merchants return all stored merchants (JSON array).
  • POST /merchants/add add a merchant. Expects a JSON object for the merchant.
  • PUT /merchants/update/<merchant_id> update merchant identified by merchant_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"
}

Budgets

  • POST /budgets/add add a new budget item. Expects JSON body.
  • GET /budgets list 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 to user_id.

Example add budget body:

{
  "_id": "budget_1",
  "user_id": "user_123",
  "name": "Groceries",
  "amount": 300
}

Transactions

  • POST /transactions/add add a transaction. Expects JSON body.
  • GET /transactions list 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"
}

Users

  • POST /users/add create a user (JSON body).
  • GET /users list 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"
}

Savings Goals

  • POST /savings_goals/add add a savings goal (JSON body).
  • GET /savings_goals list 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
}

Notes

  • Request/response shapes are not strictly enforced in the README they follow the JSON stored in the MongoDB collections used by services.db.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors