first build commit
This commit is contained in:
128
README.md
128
README.md
@@ -1,36 +1,120 @@
|
||||
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).
|
||||
# Finance App
|
||||
|
||||
## Getting Started
|
||||
Personal finance web app for tracking bank transactions, monitoring net worth, and visualizing spending. Self-hosted via Docker Compose — no cloud services required.
|
||||
|
||||
First, run the development server:
|
||||
## Features
|
||||
|
||||
```bash
|
||||
npm run dev
|
||||
# or
|
||||
yarn dev
|
||||
# or
|
||||
pnpm dev
|
||||
# or
|
||||
bun dev
|
||||
- Import transactions from CSV exports (Discover Savings, Discover Credit Card, Huntington Checking, Fidelity)
|
||||
- Net worth tracking across bank accounts
|
||||
- Browse, filter, and annotate transactions
|
||||
- Assign transactions to budgets with optional monthly caps
|
||||
- Dashboard: net worth snapshot, cash flow, recent transactions, budget summary
|
||||
- Charts: net worth trend, monthly cash flow, spending by category, budget performance
|
||||
|
||||
## Quick start
|
||||
|
||||
**Prerequisites:** Docker and Docker Compose
|
||||
|
||||
```sh
|
||||
# 1. Copy the example env file
|
||||
cp .env.example .env
|
||||
```
|
||||
|
||||
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
|
||||
Edit `.env`:
|
||||
- Set `NEXTAUTH_SECRET` to the output of `openssl rand -base64 32`
|
||||
- Set `SEED_EMAIL` and `SEED_PASSWORD` to your desired login credentials
|
||||
- Change `POSTGRES_PASSWORD` to a strong password
|
||||
|
||||
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
|
||||
```sh
|
||||
# 2. Build and start the stack
|
||||
docker compose up --build -d
|
||||
|
||||
This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.
|
||||
# 3. First-run only: apply the schema and create your user
|
||||
docker compose exec app npx prisma db push
|
||||
docker compose exec app npx prisma db seed
|
||||
|
||||
## Learn More
|
||||
# 4. Open the app
|
||||
open http://localhost:3000
|
||||
```
|
||||
|
||||
To learn more about Next.js, take a look at the following resources:
|
||||
Sign in with the `SEED_EMAIL` / `SEED_PASSWORD` you set.
|
||||
|
||||
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
|
||||
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
|
||||
## Environment variables
|
||||
|
||||
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
|
||||
| Variable | Description |
|
||||
|---|---|
|
||||
| `NEXTAUTH_SECRET` | Secret for JWT signing — run `openssl rand -base64 32` |
|
||||
| `NEXTAUTH_URL` | Public URL of the app (default: `http://localhost:3000`) |
|
||||
| `SEED_EMAIL` | Login email created by the seed script |
|
||||
| `SEED_PASSWORD` | Login password created by the seed script |
|
||||
| `POSTGRES_USER` | PostgreSQL username |
|
||||
| `POSTGRES_PASSWORD` | PostgreSQL password |
|
||||
| `POSTGRES_DB` | PostgreSQL database name |
|
||||
| `DATABASE_URL` | Full connection string — set automatically by Compose |
|
||||
|
||||
## Deploy on Vercel
|
||||
## Useful commands
|
||||
|
||||
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
|
||||
```sh
|
||||
# View logs
|
||||
docker compose logs -f app
|
||||
|
||||
Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
|
||||
# Stop the stack
|
||||
docker compose down
|
||||
|
||||
# Stop and wipe the database volume
|
||||
docker compose down -v
|
||||
|
||||
# Re-seed after a wipe
|
||||
docker compose exec app npx prisma db push
|
||||
docker compose exec app npx prisma db seed
|
||||
|
||||
# Check health
|
||||
curl http://localhost:3000/api/health
|
||||
```
|
||||
|
||||
## CSV import
|
||||
|
||||
Upload CSV files at `/upload`. The bank profile is auto-detected from the header row. Supported profiles:
|
||||
|
||||
| Bank | Account type |
|
||||
|---|---|
|
||||
| Discover High Yield Savings | BANK |
|
||||
| Discover Credit Card | CREDIT_CARD |
|
||||
| Huntington Checking | BANK |
|
||||
| Fidelity (cash activity only) | BANK |
|
||||
|
||||
If auto-detection fails, a column mapper is shown for manual field assignment.
|
||||
|
||||
**BANK** accounts count toward net worth and cash flow. **CREDIT_CARD** accounts are tracked only.
|
||||
|
||||
## Development
|
||||
|
||||
```sh
|
||||
# Start the database
|
||||
docker compose up db -d
|
||||
|
||||
# Install dependencies
|
||||
npm install
|
||||
|
||||
# Apply schema
|
||||
npx prisma db push
|
||||
|
||||
# Seed a user
|
||||
npx prisma db seed
|
||||
|
||||
# Start the dev server
|
||||
npm run dev
|
||||
```
|
||||
|
||||
The app is at http://localhost:3000.
|
||||
|
||||
## Architecture
|
||||
|
||||
| Layer | Choice |
|
||||
|---|---|
|
||||
| Framework | Next.js 16 App Router + TypeScript |
|
||||
| Database | PostgreSQL 16 + Prisma ORM |
|
||||
| Auth | NextAuth.js v5 (JWT sessions, bcrypt) |
|
||||
| UI | Tailwind CSS + shadcn/ui |
|
||||
| Charts | Recharts |
|
||||
| Deployment | Docker Compose |
|
||||
|
||||
Reference in New Issue
Block a user