Skip to content

raul0r/xpns-tracker

Repository files navigation

ExpenseTracker SaaS - Production-Ready Expense Management

A comprehensive, production-ready expense tracking SaaS application built with modern technologies and best practices.

🚀 Features

Core Functionality

  • Authentication & Security: JWT-based auth with refresh tokens, bcrypt password hashing, rate limiting
  • Transaction Management: Complete CRUD operations, bulk CSV import/export, categorization and tagging
  • Multi-Account Support: Track multiple accounts (cash, bank, credit cards) with automatic balance calculations
  • Advanced Reporting: Monthly, weekly, and custom date range reports with downloadable PDFs
  • Real-time Analytics: Interactive charts, spending insights, and trend analysis
  • Responsive Design: Mobile-first approach with dark/light theme support

Technical Features

  • Security: OWASP Top 10 compliance, Helmet middleware, CORS protection, input validation
  • Performance: Optimized React bundles, database indexing, caching strategies
  • Accessibility: WCAG 2.1 AA compliance, keyboard navigation, screen reader support
  • Testing: Comprehensive unit and integration test coverage
  • Documentation: Complete API documentation with Swagger/OpenAPI

🛠 Tech Stack

Frontend

  • React 18 with TypeScript
  • Vite for blazing-fast development
  • Tailwind CSS for styling
  • Framer Motion for animations
  • Zustand for state management
  • React Hook Form with Zod validation
  • Recharts for data visualization

Backend

  • Node.js with Express
  • TypeScript for type safety
  • Prisma ORM with PostgreSQL
  • JWT authentication with refresh tokens
  • Redis for session management
  • Winston for logging
  • Swagger for API documentation

Infrastructure

  • Docker & Docker Compose for containerization
  • PostgreSQL 15 database
  • Redis for caching and sessions

🚦 Quick Start

Prerequisites

  • Node.js 18+ and npm
  • Docker and Docker Compose
  • PostgreSQL 15+ (if running locally)

One-Command Setup

# Clone and start the entire application
git clone <repository-url>
cd expense-tracker-saas
docker-compose up --build

The application will be available at:

Development Setup

  1. Install dependencies
npm run setup
  1. Environment setup
# Backend
cp backend/.env.example backend/.env
# Update database and JWT secrets

# Frontend
cp frontend/.env.example frontend/.env
# Update API URL if needed
  1. Database setup
cd backend
npm run generate
npm run migrate
  1. Start development servers
npm run dev

📁 Project Structure

expense-tracker-saas/
├── frontend/                 # React frontend application
│   ├── src/
│   │   ├── components/      # Reusable UI components
│   │   ├── pages/           # Page components
│   │   ├── store/           # Zustand state management
│   │   ├── contexts/        # React contexts
│   │   └── utils/           # Utility functions
│   ├── public/              # Static assets
│   └── package.json
├── backend/                  # Node.js backend API
│   ├── src/
│   │   ├── routes/          # API route handlers
│   │   ├── middleware/      # Express middleware
│   │   ├── utils/           # Utility functions
│   │   └── server.ts        # Main server file
│   ├── prisma/              # Database schema and migrations
│   └── package.json
├── docs/                     # Project documentation
├── docker-compose.yml        # Development environment
└── README.md

🧪 Testing

# Run all tests
npm run test

# Frontend tests
npm run test:frontend

# Backend tests
npm run test:backend

# Linting
npm run lint

🏗 Building & Deployment

Production Build

npm run build

Environment Variables

See .env.example files in both frontend and backend directories for required environment variables.

Deployment Options

  • Docker: Use provided Dockerfile and docker-compose.yml
  • Cloud Platforms: Compatible with AWS, Google Cloud, Azure
  • Static Hosting: Frontend can be deployed to Netlify, Vercel, etc.

📊 API Documentation

Complete API documentation is available at /api/docs when running the backend server. The API follows REST conventions with comprehensive error handling and validation.

Key Endpoints

  • GET /api/transactions - List transactions with filtering
  • POST /api/transactions - Create new transaction
  • POST /api/transactions/bulk-import - CSV bulk import
  • GET /api/reports - Generate financial reports
  • GET /api/accounts - Manage user accounts

🔒 Security

  • Authentication: JWT tokens with automatic refresh
  • Authorization: Role-based access control
  • Input Validation: Server-side validation with express-validator
  • Rate Limiting: Configurable rate limits per endpoint
  • HTTPS: SSL/TLS encryption in production
  • Data Protection: Encrypted sensitive data storage

🎨 UI/UX Features

  • Responsive Design: Optimized for mobile, tablet, and desktop
  • Dark/Light Mode: System preference detection with manual toggle
  • Smooth Animations: Framer Motion powered micro-interactions
  • Accessibility: Full keyboard navigation and screen reader support
  • Loading States: Skeleton loaders and progress indicators
  • Toast Notifications: User feedback for all actions

📈 Performance

  • Frontend: Code splitting, lazy loading, optimized bundle size
  • Backend: Database query optimization, caching, connection pooling
  • Monitoring: Health checks, error tracking, performance metrics

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🆘 Support

For support, email support@expensetracker.com or join our Slack channel.


Next Steps for v1.1: Enhanced mobile app, advanced analytics with ML insights, team collaboration features, third-party bank integrations, and multi-currency support.

About

Created with StackBlitz ⚡️

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages