This repository contains the end-to-end codebase for Ledgerline, a full-stack, AI-integrated financial manager. The codebase is organized as a professional mono-repo containing a Next.js frontend client and a Python FastAPI backend service.
ledgerline-finance-app/
├── frontend/ # Next.js App Router Frontend
│ ├── app/ # Application pages (Upload, Dashboard, Alerts, Chat, Trends)
│ ├── components/ # Custom React UI components (MetricCard, AlertBanner, etc.)
│ ├── lib/ # Frontend API client and helpers
│ ├── package.json # React / NextJS dependencies
│ └── tailwind.config.js# Styling theme configuration & tokens
│
├── backend/ # Python FastAPI Backend
│ ├── app/
│ │ ├── api/ # Router endpoints (Auth, Transactions, Alerts, Insights, Agent)
│ │ ├── core/ # JWT Security, Database engines, App configs
│ │ ├── models/ # SQLAlchemy Postgres models
│ │ ├── schemas/ # Pydantic validation models
│ │ └── services/ # Statement parser, ML categorizer, Anomaly detector, Time-series forecasting
│ ├── requirements.txt # Python packages
│ └── init_db.py # Database bootstrap tool
│
├── docker-compose.yml # Development PostgreSQL and pgAdmin setup
└── README.md # Workspace documentation
Spin up a local PostgreSQL database using Docker Compose, or make sure you have local PostgreSQL running:
docker-compose up -dThis runs:
- Postgres Database:
localhost:5432(User/Password:postgres/postgres) - pgAdmin Console: http://localhost:5050 (User/Password:
admin@ledgerline.com/admin)
- Navigate to the
backend/directory:cd backend - Set up virtual environment and install packages:
python -m venv venv .\venv\Scripts\Activate.ps1 # On Windows source venv/bin/activate # On macOS/Linux pip install -r requirements.txt
- Initialize the database tables:
python init_db.py
- Run the Uvicorn server:
uvicorn app.main:app --reload --port 8000
The Swagger UI will be available at http://127.0.0.1:8000/docs.
- Navigate to the
frontend/directory:cd frontend - Install npm packages:
npm install
- Start the Next.js development server:
npm run dev
The application will be available at http://localhost:3000.