A modern, open-source budget and expense planning web application built with Next.js, TypeScript, and PostgreSQL.
- 📊 Beautiful dashboard with statistics and graphs
- 💼 Budget planning with category grouping
- 💳 Expense tracking
- 🏦 Savings goals management
- 🔒 Secure authentication
- 📱 Responsive design
- 🐳 Easy deployment with Docker
- Frontend: Next.js 14, TypeScript, Tailwind CSS, shadcn/ui
- Backend: Next.js API Routes, Prisma ORM
- Database: PostgreSQL
- Authentication: NextAuth.js
- Deployment: Docker, Docker Compose
- Node.js 18+
- PNPM 8+
- Docker and Docker Compose (for database)
- Clone the repository
git clone https://github.com/yourusername/financeflow.git
cd financeflow- Install dependencies
pnpm install- Set up environment variables
# Option 1: Use the setup script (recommended)
./setup.sh
# or
pnpm setup
# Option 2: Manual setup
cp .env.example .env
# Generate a secure NEXTAUTH_SECRET
openssl rand -base64 32
# Update .env with the generated secret- Start the database
docker compose up -d- Run migrations
pnpm db:migrate- Start the development server
pnpm devVisit http://localhost:3000 to see the application.
If you see [next-auth][error][NO_SECRET] errors, make sure you have a secure NEXTAUTH_SECRET in your .env file. You can generate one with:
openssl rand -base64 32Or run the fix script:
./fix-env.sh
# or
pnpm fix-envIf you see [next-auth][error][JWT_SESSION_ERROR] errors, this usually happens when the NEXTAUTH_SECRET was changed after sessions were created. Fix this by running:
./fix-sessions.sh
# or
pnpm fix-sessionsThis will generate a new secret and clear all existing sessions.
If you're experiencing multiple issues, run the comprehensive fix script:
./fix-all.sh
# or
pnpm fix-allThis script will fix all common issues including environment variables, JWT sessions, and dependencies.
If you encounter database connection issues:
- Make sure Docker is running
- Check that the database containers are up:
docker compose ps - Verify your
DATABASE_URLin.envmatches the Docker Compose configuration - If you get "Environment variable not found: DATABASE_URL" errors, run:
./fix-env.sh
The application requires these environment variables:
DATABASE_URL: PostgreSQL connection stringNEXTAUTH_SECRET: Secure random string for session encryptionNEXTAUTH_URL: Your application URL (http://localhost:3000 for development)GOOGLE_CLIENT_IDandGOOGLE_CLIENT_SECRET: Optional, for Google OAuth
Contributions are welcome! Please read our [[Contributing Guide]] for details.
This project is licensed under the MIT License - see the LICENSE file for details.