BudgetBuddy Backend is a RESTful API server built with FastAPI (Python) that powers the BudgetBuddy personal finance app. It manages users, goals, piggy banks, lessons, stories, and chatbot features, providing secure endpoints for all app data and logic.
- User authentication and management
- Goal creation, progress tracking, and deletion
- Piggy bank (balance) management
- Educational lessons and stories
- AI-powered chatbot endpoint
- CORS support for frontend integration
app/
main.py # FastAPI app entrypoint
routers/ # API route modules (users, goals, piggybank, etc.)
models.py # Database models
...
alembic/ # Database migrations
requirements.txt # Python dependencies
- Clone the repository:
git clone <repo-url> cd HackathonBackend
- Create a virtual environment:
python3 -m venv venv source venv/bin/activate - Install dependencies:
pip install -r requirements.txt
- Set up environment variables:
- Create a
.envfile in the root directory. - Add required variables (see below).
- Create a
The backend uses a .env file for configuration. Example:
DATABASE_URL=sqlite:///./test.db
SECRET_KEY=your-secret-key
FIREBASE_CREDENTIALS=path/to/firebase.json
Start the FastAPI server (default: http://127.0.0.1:8000):
uvicorn app.main:app --reload- Base URL:
/ - Docs: Swagger UI
- Key Endpoints:
/users/- User registration, login, profile/goals/- CRUD for savings goals/piggy_bank/- Balance management/lessons/- Financial lessons/stories/- Educational stories/chatbot/- AI chatbot interface
- FastAPI
- Uvicorn
- SQLAlchemy
- Alembic
- python-dotenv
- firebase-admin
- See
requirements.txtfor full list
- Use
alembicfor database migrations. - All API changes should be documented in the OpenAPI schema (auto-generated by FastAPI).
- CORS is enabled for local frontend development.
- For production, review security and environment settings.
For questions or contributions, please open an issue or pull request.