How wreckage0907/penny works
Project Type & Purpose
• Penny is a full-stack, cross-platform personal finance application.
• Frontend: Flutter mobile (iOS, Android, Web, Desktop).
• Backend: Python (FastAPI) API server.
• Purpose: deliver AI-powered courses, chat, practice questions, expense tracking, stock emulator, and news feeds.
File Structure Insights
• Top level:
• Assets, LICENSE, README.md
• backend/ – Python API service
• mobile/ – Flutter app (with android/, ios/, web/, linux/, macos/, windows/ subprojects)
• backend/
• main.py – FastAPI entrypoint
• routers/ – feature modules (chatbot, expenseTracker, questionGen, stockScrape, news, onboarding, profile, livestock)
• schema/ – Pydantic schemas per feature
• database/firebase_init.py – Firebase Admin SDK setup
• Dockerfile & render.yaml – containerization & deployment (Render.com)
• mobile/
• lib/Pages – UI screens matching backend features
• lib/Services/auth.dart – Firebase Auth integration
• lib/consts/backend_url.dart – API base URL
• pubspec.yaml – Flutter dependencies
README Highlights
• Tech stack: Flutter, Python, FastAPI, Firebase, Gemini AI, external stock & news APIs.
• Features powered by backend routes, Firebase, and Google’s Gemini.
• Deployment:
• backend runs in Docker on Render.com
• mobile built & deployed via Flutter SDK
a. Main Components
1. Mobile Client (Flutter App)
– UI Layers: Onboarding, Auth, Course, Chatbot, Practice, Expense Tracker, Stock Emulator, News
– Local persistence (e.g., secure storage for tokens)
2. Backend API (FastAPI)
– Routers (modular endpoints)
– Schema models (Pydantic)
– Firebase Admin (Auth & Firestore)
– External Service Integrations (Gemini API, Stock API, News API)
3. Database & Auth
– Firebase Authentication
– Firestore (user profiles, expenses, emulator portfolios)
4. External Services
– Gemini AI (RAG for chatbot & question generation)
– Financial News API
– Stock Price API
5. Deployment Infrastructure
– Docker container (backend)
– Render.com or similar PaaS
b. Relationships & Data Flows
– Mobile → Backend: HTTPS (REST) calls to routers
– Backend → Firebase: Admin SDK calls for auth, read/write Firestore
– Backend → Gemini AI / Stock / News APIs: HTTP requests, responses processed & returned
– Backend → Mobile: JSON responses (data, chat replies, questions, price data)
– Mobile: renders UI, stores tokens, sends user input & receives updates
c. Architectural Patterns
– Modular Monolith (FastAPI routers isolate feature logic)
– Separation of Concerns:
• Authentication (Firebase Auth)
• Business Logic (each router & service)
• Data Layer (schema + Firestore)
– RAG Pattern for chatbot & questionGen (vector store or document fetch + LLM calls)
d. Key Technologies & Frameworks
– Flutter / Dart
– FastAPI / Python 3.x
– Firebase (Auth, Firestore)
– Gemini AI API
– Docker, render.yaml (Render.com)