Skip to content

Deployment of a budget management application (Angular/Node.js/PostgreSQL) on a Docker Swarm cluster with 3 DigitalOcean droplets featuring service replication and high availability.

Notifications You must be signed in to change notification settings

Mehdirben/budget-tracker-angular-docker

Repository files navigation

Budget Tracker PWA

A modern, full-stack budget tracking application built with Angular (PWA), Node.js/Express, PostgreSQL, and Docker.

✨ Features

  • 📊 Dashboard - Overview with income/expense charts and statistics
  • 💰 Transaction Management - Track income and expenses with categories
  • 📁 Category System - Custom categories with colors and icons
  • 📱 PWA Support - Install on mobile, works offline
  • 🔐 Authentication - Secure JWT-based auth
  • 🎨 Modern Design - Glassmorphism, dark theme, smooth animations

📖 Documentation

🚀 Quick Start

Prerequisites

  • Docker & Docker Compose
  • Node.js 20+ (for local development)

Running with Docker (Recommended)

# Clone and navigate to the project
cd budget-tracker-angular

# Start all services
docker compose up -d

# View logs
docker compose logs -f

Access the application:

pgAdmin Login:

Connect to PostgreSQL in pgAdmin:

  • Host: postgres
  • Port: 5432
  • Database: budget_tracker
  • Username: budget_user
  • Password: budget_password

Local Development

# Backend
cd backend
npm install
npm run dev

# Frontend (new terminal)
cd frontend
npm install
npm start

📱 PWA Installation

  1. Open http://localhost:4200 in Chrome
  2. Click the install icon in the address bar
  3. Or use "Add to Home Screen" on mobile

🛠️ Tech Stack

Component Technology
Frontend Angular 17, SCSS, ng2-charts
Backend Node.js, Express, TypeORM
Database PostgreSQL 15
Auth JWT (JSON Web Tokens)
Container Docker, Docker Compose
Web Server Nginx

📁 Project Structure

budget-tracker-angular/
├── backend/
│   ├── src/
│   │   ├── controllers/    # API controllers
│   │   ├── entities/       # TypeORM entities
│   │   ├── middleware/     # Auth middleware
│   │   ├── routes/         # API routes
│   │   └── index.ts        # Entry point
│   └── Dockerfile
├── frontend/
│   ├── src/
│   │   ├── app/
│   │   │   ├── pages/      # Page components
│   │   │   ├── services/   # API services
│   │   │   └── models/     # TypeScript interfaces
│   │   └── styles.scss     # Global styles
│   ├── nginx.conf
│   └── Dockerfile
├── docker-compose.yml
└── .env

🔧 Environment Variables

Variable Description Default
POSTGRES_USER Database username budget_user
POSTGRES_PASSWORD Database password budget_password
POSTGRES_DB Database name budget_tracker
PGADMIN_EMAIL pgAdmin email admin@budget.com
PGADMIN_PASSWORD pgAdmin password admin123
JWT_SECRET JWT signing secret (change in prod!)

📝 API Endpoints

Method Endpoint Description
POST /api/auth/register Register new user
POST /api/auth/login Login
GET /api/auth/profile Get user profile
GET /api/transactions List transactions
POST /api/transactions Create transaction
PUT /api/transactions/:id Update transaction
DELETE /api/transactions/:id Delete transaction
GET /api/categories List categories
POST /api/categories Create category
GET /api/dashboard/stats Get dashboard stats

About

Deployment of a budget management application (Angular/Node.js/PostgreSQL) on a Docker Swarm cluster with 3 DigitalOcean droplets featuring service replication and high availability.

Resources

Stars

Watchers

Forks