Skip to content

sanchit339/FinTracker

Repository files navigation

Portfolio Website with Financial Tracker

A modern, secure portfolio website with integrated financial tracking dashboard using Gmail API for automated transaction extraction from bank emails. Built with React, Node.js, PostgreSQL, and Docker.

πŸš€ Features

Portfolio Website (Public)

  • ✨ Modern, premium UI with glassmorphism effects
  • 🎨 Vibrant gradients and smooth animations
  • πŸ“± Fully responsive design
  • 🎯 Sections: Landing, About, Projects, Contact
  • ⚑ Built with React and Vite for blazing-fast performance

Financial Tracker Dashboard (Private)

  • πŸ” Secure JWT authentication
  • πŸ“§ Gmail API integration for automated transaction tracking
  • πŸ’° Real-time transaction monitoring from bank emails
  • πŸ“Š Transaction history with filtering and search
  • Analytics and spending insights

πŸ› οΈ Tech Stack

  • Frontend: React 18, Vite, React Router
  • Backend: Node.js, Express
  • Database: PostgreSQL 16
  • Authentication: JWT with bcrypt
  • Email API: Gmail API for transaction extraction
  • Containerization: Docker & Docker Compose

πŸ“‹ Prerequisites

  • Docker and Docker Compose installed
  • Gmail API credentials (see docs/GMAIL_SETUP.md)

πŸš€ Quick Start

1. Clone and Navigate

cd /Users/sanchitingale/Development/PortFoliio

2. Set Up Environment Variables

The .env file is already created. Update Gmail credentials:

# Add your Gmail API credentials (see docs/GMAIL_SETUP.md for instructions)
GMAIL_CLIENT_ID=your_gmail_client_id
GMAIL_CLIENT_SECRET=your_gmail_client_secret
GMAIL_REDIRECT_URI=http://localhost:3000/api/gmail/callback

3. Start All Services with Docker

docker-compose up --build

This will start:

  • PostgreSQL database on port 5432
  • Backend API on port 3000
  • Frontend on port 5173

4. Access the Application

5. Login to Banking Dashboard

Click "Banking Dashboard" in the navigation and use:

  • Username: demo
  • Password: demo1234

Or register a new account!

πŸ“ Project Structure

PortFoliio/
β”œβ”€β”€ server/                 # Backend Node.js application
β”‚   β”œβ”€β”€ config/            # Database, Gmail configuration
β”‚   β”œβ”€β”€ middleware/        # Authentication middleware
β”‚   β”œβ”€β”€ routes/            # API routes
β”‚   β”œβ”€β”€ services/          # Gmail sync service layer
β”‚   β”œβ”€β”€ db/                # Database schema
β”‚   └── index.js           # Express server
β”œβ”€β”€ src/                   # Frontend React application
β”‚   β”œβ”€β”€ components/        # React components
β”‚   β”œβ”€β”€ App.jsx           # Main app with routing
β”‚   β”œβ”€β”€ main.jsx          # React entry point
β”‚   └── index.css         # Global styles
β”œβ”€β”€ docs/                  # Documentation
β”‚   └── GMAIL_SETUP.md    # Gmail API setup guide
β”œβ”€β”€ docker-compose.yml    # Docker multi-container setup
β”œβ”€β”€ Dockerfile.dev        # Development Dockerfile
β”œβ”€β”€ vite.config.js        # Vite configuration
└── package.json          # Dependencies

πŸ”§ Development Commands

# Start all services
docker-compose up

# Start in detached mode
docker-compose up -d

# View logs
docker-compose logs -f

# Stop all services
docker-compose down

# Rebuild containers
docker-compose up --build

# Access PostgreSQL
docker exec -it portfoliio-db psql -U portfoliio_user -d portfoliio_db

🎨 Features Breakdown

Frontend Components

  • Landing: Hero section with stats and animations
  • About: Skills showcase with progress bars
  • Projects: Project cards with tags
  • Contact: Contact form and social links
  • Login: Authentication with registration
  • Dashboard: Banking dashboard with account management
  • BankCard: Individual bank account card with balance/transactions

Backend APIs

Authentication

  • POST /api/auth/register - Register new user
  • POST /api/auth/login - User login
  • GET /api/auth/verify - Verify token

Banking (Protected)

  • GET /api/banking/transactions/recent - Get recent transactions
  • GET /api/banking/accounts - List linked accounts
  • POST /api/banking/accounts/link - Link bank account

Gmail Integration

  • GET /api/gmail/connect - Initiate Gmail OAuth
  • GET /api/gmail/callback - OAuth callback
  • POST /api/gmail/sync - Sync transactions from Gmail

πŸ” Security Features

  • βœ… JWT-based authentication
  • βœ… Bcrypt password hashing
  • βœ… HTTPS enforcement (production)
  • βœ… Rate limiting
  • βœ… Helmet security headers
  • βœ… CORS protection
  • βœ… No credential storage (AA framework)
  • βœ… Environment variable protection

πŸ“§ Gmail API Setup

For proper transaction tracking, you need to set up Gmail API access:

  1. See Complete Guide: docs/GMAIL_SETUP.md

  2. Quick Setup:

    • Create Google Cloud Project
    • Enable Gmail API
    • Configure OAuth consent screen
    • Create OAuth 2.0 credentials
    • Add credentials to .env file
  3. Connect Gmail:

    • Login to dashboard
    • Go to Settings
    • Click "Connect Gmail Account"
    • Authorize access

🚒 Deployment to GCP

Prerequisites

  • GCP e2-micro instance running
  • Docker installed on instance
  • Domain with SSL certificate

Deploy

# SSH to your GCP instance
# Clone repository
# Update .env with production values
# Run containers
docker-compose -f docker-compose.prod.yml up -d

πŸ“ Environment Variables

Variable Description Default
DB_USER PostgreSQL username portfoliio_user
DB_PASSWORD PostgreSQL password portfoliio_password
DB_NAME Database name portfoliio_db
JWT_SECRET JWT signing secret (change in production)
GMAIL_CLIENT_ID Gmail API client ID -
GMAIL_CLIENT_SECRET Gmail API client secret -
GMAIL_REDIRECT_URI Gmail OAuth redirect http://localhost:3000/api/gmail/callback

🀝 Contributing

This is a personal project, but suggestions are welcome!

πŸ“„ License

MIT License - feel free to use this for your own projects!

πŸ™ Acknowledgments

  • Google for the Gmail API
  • React and Vite teams
  • All open source contributors

Built with ❀️ using modern web technologies

About

Personal Finance Tracker which I personally use developed using the Transaction mail from the Banks. Using the Gmail API integrated to the Backend. Github cron for syncing the mails after particular Intervals.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors