Sign inSign up

abhijeet14d/expense-tracker

By abhijeet14d

•Updated 10 months ago

A beautiful expense tracking application built with React.js and Tailwind CSS

Buildkit cache
Image
0

1.5K

abhijeet14d/expense-tracker repository overview

ā šŸ’° Expense Tracker

A beautiful and intuitive expense tracking application built with React.js and Tailwind CSS. Track your spending, set budgets, and manage your finances with ease.

Expense Tracker Tailwind CSS Vite Docker CI/CD

⁠✨ Features

  • šŸ’µ Budget Management - Set and track your monthly budget
  • šŸ“ Add Expenses - Quickly add expenses with amount, category, and description
  • šŸ—‘ļø Delete Expenses - Remove expenses with a single click
  • šŸ“Š Visual Progress - Real-time budget usage tracking with progress bar
  • šŸŽØ Category Icons - Color-coded categories for easy identification
    • šŸ” Food
    • šŸš— Transport
    • šŸ›ļø Shopping
    • šŸ’” Bills
    • šŸŽ® Entertainment
    • šŸ“¦ Other
  • šŸ’¾ Data Persistence - Automatically saves your data using localStorage
  • šŸ“± Responsive Design - Works seamlessly on desktop, tablet, and mobile devices
  • šŸŽÆ User-Friendly Interface - Clean, modern design with smooth animations

ā šŸš€ Getting Started

⁠Prerequisites
  • Node.js (v14 or higher)
  • npm or yarn
⁠Installation
  1. Clone the repository
git clone <repository-url>
cd ExpenseTracker
  1. Install dependencies
npm install
  1. Start the development server
npm run dev
  1. Open your browser and navigate to http://localhost:5173

ā šŸ› ļø Built With

  • React.js - JavaScript library for building user interfaces
  • Tailwind CSS - Utility-first CSS framework for styling
  • Vite - Next-generation frontend tooling for fast development
  • Lucide React - Beautiful and consistent icon library

ā šŸ“¦ Project Structure

ExpenseTracker/
ā”œā”€ā”€ .github/
│   └── workflows/
│       └── docker-publish.yml  # GitHub Actions CI/CD pipeline
ā”œā”€ā”€ src/
│   ā”œā”€ā”€ App.jsx                 # Main application component
│   ā”œā”€ā”€ main.jsx                # Application entry point
│   └── index.css               # Global styles and Tailwind imports
ā”œā”€ā”€ .dockerignore               # Docker ignore file
ā”œā”€ā”€ docker-compose.yml          # Docker Compose configuration
ā”œā”€ā”€ Dockerfile                  # Multi-stage Docker build
ā”œā”€ā”€ nginx.conf                  # Nginx server configuration
ā”œā”€ā”€ index.html                  # HTML template
ā”œā”€ā”€ package.json                # Project dependencies and scripts
ā”œā”€ā”€ vite.config.js              # Vite configuration
ā”œā”€ā”€ tailwind.config.js          # Tailwind CSS configuration
ā”œā”€ā”€ postcss.config.js           # PostCSS configuration
└── README.md                   # Project documentation

ā šŸ’” Usage

  1. Set Your Budget: Enter your monthly budget in the input field at the top
  2. Add Expenses:
    • Enter the expense amount
    • Select a category from the dropdown
    • Add a description (optional)
    • Click "Add Expense"
  3. Track Progress: Watch the progress bar update as you add expenses
  4. Delete Expenses: Click the trash icon next to any expense to remove it
  5. Your Data is Safe: All data is automatically saved to your browser's localStorage

ā šŸŽØ Color Scheme

  • Primary Gradient: Purple to Pink (from-purple-600 to-pink-600)
  • Success: Green (text-green-600)
  • Warning: Yellow (text-yellow-600)
  • Danger: Red (text-red-600)
  • Categories: Color-coded for quick visual identification

ā šŸ“± Responsive Design

The application is fully responsive and optimized for:

  • šŸ“± Mobile devices (320px and up)
  • šŸ“± Tablets (768px and up)
  • šŸ’» Desktop (1024px and up)

ā šŸ”§ Available Scripts

  • npm run dev - Start development server
  • npm run build - Build for production
  • npm run preview - Preview production build

⁠🐳 Docker Deployment

  1. Build and run the application:
docker-compose up -d
  1. Access the application at http://localhost:3000

  2. Stop the application:

docker-compose down
⁠Using Docker CLI
  1. Build the Docker image:
docker build -t expense-tracker .
  1. Run the container:
docker run -d -p 3000:80 --name expense-tracker-app expense-tracker
  1. Stop and remove the container:
docker stop expense-tracker-app
docker rm expense-tracker-app
⁠Docker Hub

The Docker image is automatically built and pushed to Docker Hub via GitHub Actions on every push to the main branch.

Pull the latest image:

docker pull abhijeet14d/expense-tracker:latest

Run the pre-built image:

docker run -d -p 3000:80 abhijeet14d/expense-tracker:latest

ā šŸ”„ CI/CD Pipeline

This project uses GitHub Actions to automatically:

  • Build Docker images for multiple architectures (amd64, arm64)
  • Push images to Docker Hub with proper tags
  • Update Docker Hub description
  • Support version tags and branch-based tags
⁠Setting up GitHub Actions
  1. Go to your GitHub repository settings
  2. Navigate to Secrets and variables → Actions
  3. Add the following secrets:
    • DOCKER_USERNAME - Your Docker Hub username
    • DOCKER_PASSWORD - Your Docker Hub password or access token
⁠Workflow Triggers

The pipeline runs on:

  • Push to main or master branch
  • Pull requests to main or master branch
  • Version tags (e.g., v1.0.0)
  • Manual workflow dispatch

⁠🌟 Future Enhancements

  • Monthly/Yearly expense reports
  • Export data to CSV
  • Multiple budget categories
  • Expense charts and analytics
  • Dark mode support
  • User authentication
  • Cloud data sync

Tag summary

Content type

Image

Digest

sha256:27cd666c9…

Size

21.6 MB

Last updated

10 months ago

docker pull abhijeet14d/expense-tracker