Expense management application for Indian users with automated bank statement parsing.
- Bank Statement Import: Parse statements from HDFC, ICICI, Axis, SBI banks
- Smart Categorization: Rule-based automatic expense categorization
- Analytics: Spending insights and trends
- JWT Authentication: Secure auth with token refresh
- Dark/Light Theme: Responsive UI with theme switching
- Backend: Go 1.25, Gin, PostgreSQL, Ginkgo testing, Goose migrations
- Frontend: Next.js 15, React 19, TypeScript, Tailwind CSS 4, Shadcn UI, TanStack Query, Bun
# Install dependencies
just install
# Set up database
cp server/.env.example server/.env
# Edit server/.env with your DB credentials
just db-upgrade
just db-seed
# Start development servers
just dev
The backend will run on http://localhost:8080 and frontend on http://localhost:3000.
Note: Ensure Bun is installed and activated in your shell. If using mise, run: eval "$(mise activate zsh)"
Create server/.env with:
DB_HOST=localhost
DB_PORT=5432
DB_USER=your_username
DB_PASSWORD=your_password
DB_NAME=neurospend_dev
DB_SCHEMA=public
JWT_SECRET=your-jwt-secret
JWT_REFRESH_SECRET=your-refresh-secret
JWT_EXPIRY=15m
JWT_REFRESH_EXPIRY=7d
PORT=8080
GIN_MODE=debug
CORS_ORIGINS=http://localhost:3000
# Development
just install # Install Go tools and npm packages
just dev # Start both servers
just server # Backend with hot-reload
just frontend # Frontend dev server
# Database
just db-create <name> # Create migration
just db-upgrade # Apply migrations
just db-downgrade # Rollback migration
just db-seed # Seed database
# Testing
just test # Run all tests
just test "Pattern" # Run specific test
# Code quality
just format # Format all code
expenses/
├── server/ # Go backend
│ ├── cmd/neurospend/ # Entry point
│ ├── internal/
│ │ ├── api/ # Controllers, routes
│ │ ├── service/ # Business logic
│ │ ├── repository/ # Database layer
│ │ ├── models/ # DTOs
│ │ ├── parser/ # Bank statement parsers
│ │ ├── errors/ # Custom errors
│ │ └── database/ # Migrations
│ └── e2e_test.sh # Test runner
├── frontend/ # Next.js
│ ├── app/ # Pages
│ ├── components/ # React components
│ │ ├── ui/ # Shadcn UI
│ │ ├── custom/ # Feature components
│ │ └── hooks/ # TanStack Query hooks
│ └── lib/
│ ├── api/ # API clients
│ └── models/ # TypeScript types
└── justfile # Command runner
Backend: Clean architecture with layered design
- Controller: HTTP handlers, error handling
- Service: Business logic with debug logging
- Repository: Database operations (pgx/v5)
- Models: Request/response DTOs
- Wire: Dependency injection (Google Wire)
Frontend: Next.js 15 App Router
- Server Components by default
- TanStack Query for server state
- Shadcn UI for components
- Context for global state
See detailed guides in:
AGENTS.md- Project quick referenceserver/AGENTS.md- Backend conventions, testing, Go patternsfrontend/AGENTS.md- React patterns, component architectureREADME.md- This file
Backend:
- Create model in
internal/models/ - Add repository in
internal/repository/ - Implement service in
internal/service/ - Create controller in
internal/api/controller/ - Add route in
internal/api/routes.go - Write tests with Ginkgo
- Run
just test "YourTestName"
Frontend:
- Add types in
lib/models/ - Create API function in
lib/api/ - Write hook in
components/hooks/ - Build component in
components/custom/ - Add page in
app/ - Use Shadcn UI from
components/ui/
Backend (Ginkgo):
- Real database with migrations (no external mocks)
- Run specific test:
just test "ServiceName.*" - Test files end with
_test.go
Frontend:
- No test framework configured yet
The backend REST API runs on port 8080. Key endpoints:
POST /api/auth/signup- Create userPOST /api/auth/login- LoginPOST /api/auth/refresh- Refresh tokenGET /api/accounts- List accountsGET /api/transactions- List transactionsPOST /api/statements- Import statement
See server/internal/api/routes.go for full API.