A full-stack personal finance application (Nexus) built with FastAPI backend and Next.js frontend.
- User authentication and authorization
- Account management (checking, savings, credit cards, etc.)
- Transaction tracking with categories
- Budget management with spending tracking
- Financial goals tracking
- Junior Smart Savings — parent-controlled accounts for children: goal-based saving, automated deposits, progress tracking, rewards, and financial education
- Dashboard with financial summaries
- Reports and analytics
- Expense forecasting
- FastAPI - Modern Python web framework
- SQLAlchemy - ORM for database operations
- PostgreSQL - Database
- JWT - Authentication
- Pydantic - Data validation
- Next.js 14+ - React framework
- TypeScript - Type safety
- Tailwind CSS - Styling
- Zod - Schema validation
- Recharts - Data visualization
- Python 3.11+
- Node.js 18+
- PostgreSQL 15+ (or use Docker)
- Docker and Docker Compose (optional)
- Navigate to the backend directory:
cd backend- Create a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Create a
.envfile in the backend directory (seebackend/.env.example). PostgreSQL is required.
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/personalfinance
AUTO_CREATE_DB=true
SECRET_KEY=your-secret-key-change-in-production
DEBUG=trueEnsure PostgreSQL is running and the database exists (e.g. createdb personalfinance).
-
Initialize the database (choose one):
- Quick start (create tables only):
python -m app.db.init_db - Production (Alembic migrations):
alembic upgrade head
To create a new migration after model changes:alembic revision --autogenerate -m "description"
- Quick start (create tables only):
-
Run the development server:
uvicorn app.main:app --reloadThe API will be available at http://localhost:8000
API documentation at http://localhost:8000/docs
- Navigate to the frontend directory:
cd frontend- Install dependencies:
npm install- Create a
.env.localfile:
NEXT_PUBLIC_API_URL=http://localhost:8000/api/v1- Run the development server:
npm run devThe frontend will be available at http://localhost:3000
- Start all services:
docker compose up -d --build- Access the application:
- Backend API:
http://localhost:8000 - Frontend:
http://localhost:3000(run separately withcd frontend && npm run dev; Docker Compose runs backend + Postgres only)
- Backend API:
For production deployment (env vars, CORS, migrations, health check, Docker prod override), see docs/DEPLOYMENT.md.
nexus/ # rename repo/folder from personal-finance-app to nexus if desired
├── backend/
│ ├── app/
│ │ ├── api/v1/ # API endpoints
│ │ ├── core/ # Core configuration
│ │ ├── db/ # Database setup
│ │ ├── models/ # SQLAlchemy models
│ │ ├── schemas/ # Pydantic schemas
│ │ └── services/ # Business logic
│ ├── requirements.txt
│ └── Dockerfile
├── frontend/
│ ├── app/ # Next.js app directory
│ ├── components/ # React components
│ └── lib/ # Utilities
├── docs/ # Documentation
└── docker-compose.yml
POST /api/v1/auth/register- Register a new userPOST /api/v1/auth/login- Login and get tokensPOST /api/v1/auth/refresh- Refresh access tokenGET /api/v1/auth/me- Get current user info
GET /api/v1/accounts- Get all accountsPOST /api/v1/accounts- Create accountGET /api/v1/accounts/{id}- Get accountPUT /api/v1/accounts/{id}- Update accountDELETE /api/v1/accounts/{id}- Delete account
GET /api/v1/transactions- Get transactions (with filters)POST /api/v1/transactions- Create transactionGET /api/v1/transactions/{id}- Get transactionPUT /api/v1/transactions/{id}- Update transactionDELETE /api/v1/transactions/{id}- Delete transaction
GET /api/v1/budgets- Get all budgetsPOST /api/v1/budgets- Create budgetGET /api/v1/budgets/{id}- Get budget with spendingPUT /api/v1/budgets/{id}- Update budgetDELETE /api/v1/budgets/{id}- Delete budget
GET /api/v1/goals- Get all goalsPOST /api/v1/goals- Create goalGET /api/v1/goals/{id}- Get goal with progressPUT /api/v1/goals/{id}- Update goalDELETE /api/v1/goals/{id}- Delete goal
GET /api/v1/dashboard/summary- Get dashboard summary
GET /api/v1/reports/expenses-by-category- Expenses by categoryGET /api/v1/reports/income-vs-expenses- Income vs expenses
Phased development is tracked in docs/PHASES.md and via GitHub issues. User journeys (swimlane-style flows for transactions, accounts, budgets, goals, auth) are in docs/USER_FLOWS.md.
# Backend tests
cd backend
pytest
# Frontend tests
cd frontend
npm test# Backend
black app/
isort app/
# Frontend
npm run lint
npm run formatMIT