A full-stack Invoice Management System built with Golang Backend, Vue 3 Frontend, and PostgreSQL Database. Fully containerized with Docker for easy deployment.
- π Authentication & Authorization - JWT-based authentication with bcrypt password hashing
- π Invoice Management - Full CRUD operations with automatic invoice numbering
- π’ Auto Invoice Numbering - Format: INV-YYYY-MM-DD-XXXX
- π PDF Generation - Automatic invoice PDF generation
- π§ Email Notifications - Send invoices via email with PDF attachments
- π¦ Multiple Bank Accounts - Manage multiple bank accounts per user
- π Dashboard Analytics - Track total invoices, paid/unpaid status, and revenue statistics
- π Security - Rate limiting, CORS, XSS protection, and SQL injection prevention
- π¨ Responsive UI - Modern design with Tailwind CSS
- Docker & Docker Compose
- Gmail Account (for SMTP)
- Login to your Gmail account
- Go to: https://myaccount.google.com/apppasswords
- Generate an App Password for "Mail"
- Copy the 16-digit password generated
# Clone repository
git clone https://github.com/qyqyardy/invoice-app.git
cd invoice-app
# Create .env file
cat > .env << 'EOF'
SMTP_FROM=your-email@gmail.com
SMTP_PASSWORD=your-16-digit-app-password
EOF
# Build and run
docker compose up -d --build
# Access application
# Frontend: http://localhost:8081
# Backend API: http://localhost:8080/apiinvoice-app/
βββ backend/ # Golang backend
βββ frontend/ # Vue 3 frontend
βββ nginx/ # Nginx reverse proxy config
βββ docker-compose.yml # Docker orchestration
βββ .env # Environment variables
- Open http://localhost:8081
- Click "Register" to create a new account
- Login with your newly created credentials
- Navigate to "Bank Accounts" to add payment information
- Start creating invoices!
- Dashboard β "Create New Invoice"
- Fill in client information
- Select a bank account for payment
- Add invoice items (description, quantity, unit price)
- Review totals
- Submit
- Navigate to "/bank-accounts"
- Add multiple bank accounts
- Set a default bank (auto-selected when creating invoices)
- Edit or delete existing bank accounts
- View - See complete invoice details
- Download PDF - Generate and download invoice PDF
- Send Email - Send invoice to client via email
- Update Status - Mark as paid/unpaid
- Delete - Remove invoice
- β Password hashing (bcrypt cost 14)
- β JWT Authentication
- β Rate Limiting (100 requests per minute)
- β SQL Injection Prevention (prepared statements)
- β CORS Configuration
- β Input Validation
- β XSS Prevention (Vue's built-in escaping)
- β CSRF Protection (JWT in headers)
- β Route Guards (authentication required)
- β Security Headers (X-Frame-Options, X-XSS-Protection)
- β Rate Limiting
- β SSL/TLS Ready
POST /api/register Register new user
POST /api/login Login user
GET /api/me Get current user
PUT /api/me Update current user
GET /api/bank-accounts List all bank accounts
POST /api/bank-accounts Create bank account
PUT /api/bank-accounts/:id Update bank account
DELETE /api/bank-accounts/:id Delete bank account
POST /api/bank-accounts/:id/set-default Set default bank
GET /api/dashboard Get dashboard statistics
GET /api/invoices List all invoices
GET /api/invoices/:id Get invoice details
POST /api/invoices Create new invoice
PUT /api/invoices/:id Update invoice status
DELETE /api/invoices/:id Delete invoice
GET /api/invoices/:id/pdf Download invoice PDF
POST /api/invoices/:id/send-email Send invoice via email
id SERIAL PRIMARY KEY
email VARCHAR(255) UNIQUE NOT NULL
password_hash VARCHAR(255) NOT NULL
name VARCHAR(255) NOT NULL
bank_account VARCHAR(255)
created_at TIMESTAMPid SERIAL PRIMARY KEY
user_id INTEGER REFERENCES users(id)
bank_name VARCHAR(100) NOT NULL
account_number VARCHAR(50) NOT NULL
account_holder VARCHAR(255) NOT NULL
is_default BOOLEAN
created_at TIMESTAMPid SERIAL PRIMARY KEY
invoice_number VARCHAR(50) UNIQUE NOT NULL
user_id INTEGER REFERENCES users(id)
bank_account_id INTEGER REFERENCES bank_accounts(id)
client_name VARCHAR(255) NOT NULL
client_email VARCHAR(255) NOT NULL
client_address TEXT
issue_date DATE NOT NULL
due_date DATE NOT NULL
subtotal DECIMAL(15,2) NOT NULL
tax DECIMAL(15,2)
total DECIMAL(15,2) NOT NULL
status VARCHAR(20) DEFAULT 'unpaid'
notes TEXT
created_at TIMESTAMP
updated_at TIMESTAMPid SERIAL PRIMARY KEY
invoice_id INTEGER REFERENCES invoices(id)
description TEXT NOT NULL
quantity INTEGER NOT NULL
unit_price DECIMAL(15,2) NOT NULL
amount DECIMAL(15,2) NOT NULL# Check container status
docker compose ps
# View logs
docker compose logs backend
docker compose logs frontend
docker compose logs postgres
# Restart specific service
docker compose restart backend
# Rebuild specific service
docker compose up -d --build backend# Check if postgres is healthy
docker compose ps postgres
# Connect to postgres
docker exec -it invoice_postgres psql -U invoiceapp -d invoicedb
# Reset database
docker compose down -v
docker compose up -d- Ensure SMTP_FROM and SMTP_PASSWORD are correct in .env
- Use App Password, not your regular Gmail password
- Check backend logs:
docker compose logs backend
- Deployment Guide - Complete deployment instructions
- Multiple Banks Guide - Bank accounts feature documentation
Backend:
- Golang 1.21
- Gin Framework
- PostgreSQL 15
- JWT Authentication
- GOFPDF (PDF generation)
- SMTP (Email sending)
Frontend:
- Vue 3 (Composition API)
- Vue Router
- Pinia (State Management)
- Tailwind CSS
- Axios
- Vite
Infrastructure:
- Docker & Docker Compose
- Nginx (Reverse Proxy)
- PostgreSQL (Database)
- Backend: Gin framework with response time < 50ms
- Frontend: Vue 3 Composition API with lazy loading
- Database: PostgreSQL with proper indexing
- Caching: Nginx static file caching
MIT License - Free to use for personal and commercial projects.
Created by Rizki
Contributions, issues, and feature requests are welcome!
Feel free to check the issues page.
Give a βοΈ if this project helped you!
For questions or support, please open an issue in the repository.
Made with β€οΈ