Skip to content

itertius/subscription-hub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Subscription Hub

A modern web application to manage and track your subscription payments in one place. Built with React and Node.js.

Features

  • πŸ“¦ Subscription Management: Add, edit, and delete subscriptions
  • πŸ’³ Payment Tracking: Record and track payment history
  • πŸ“Š Dashboard: View statistics and insights about your subscriptions
  • πŸ” Filtering: Filter subscriptions by status and category
  • πŸ“… Upcoming Payments: See upcoming billing dates
  • 🏷️ Categories: Organize subscriptions by category
  • πŸ’° Multiple Currencies: Support for USD, EUR, GBP, JPY, CAD, AUD, THB
  • 🎨 Modern UI: Beautiful, responsive design

Tech Stack

Backend

  • Node.js with Express.js
  • LowDB (JSON file-based database)
  • RESTful API

Frontend

  • React 18
  • Vite
  • Axios for API calls
  • date-fns for date formatting

Quick Start

Option 1: Using the Start Script (Recommended)

./start.sh

This will:

Option 2: Using Docker Compose

# Build and start all services
docker-compose up -d

# View logs
docker-compose logs -f

# Stop services
docker-compose down

The application will be available at:

Option 3: Manual Setup

  1. Install dependencies:

    npm run install:all
  2. Start backend:

    npm run start:backend
  3. Start frontend (in another terminal):

    npm run start:frontend
  4. Open your browser:

Docker

Build Images

docker-compose build

Run Services

docker-compose up -d

View Logs

docker-compose logs -f

Stop Services

docker-compose down

CI/CD

GitHub Actions

The project includes GitHub Actions workflows for:

  1. CI Pipeline (.github/workflows/ci.yml):

    • Tests backend and frontend
    • Builds Docker images
    • Runs linting
  2. Deploy to GitHub Pages (.github/workflows/deploy.yml):

    • Builds frontend for production
    • Deploys to GitHub Pages
  3. Docker Publish (.github/workflows/docker-publish.yml):

    • Builds and publishes Docker images to GitHub Container Registry

Setting up GitHub Pages

  1. Go to your repository Settings β†’ Pages
  2. Set source to "GitHub Actions"
  3. The frontend will be deployed automatically on push to main/master branch

Environment Variables

For GitHub Pages deployment, set the following secret in your repository:

  • VITE_API_URL: Your backend API URL (e.g., https://your-api.com)

API Endpoints

Subscriptions

  • GET /api/subscriptions - Get all subscriptions
  • GET /api/subscriptions/:id - Get subscription by ID
  • POST /api/subscriptions - Create new subscription
  • PUT /api/subscriptions/:id - Update subscription
  • DELETE /api/subscriptions/:id - Delete subscription
  • GET /api/subscriptions/stats/summary - Get subscription statistics

Payments

  • GET /api/payments - Get all payments
  • GET /api/payments/:id - Get payment by ID
  • POST /api/payments - Create new payment record
  • PUT /api/payments/:id - Update payment
  • DELETE /api/payments/:id - Delete payment

Database

The application uses LowDB, a JSON file-based database. The database file is stored at:

  • backend/db.json

Note: Make sure to backup this file regularly!

Project Structure

subscription-hub/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”œβ”€β”€ subscriptions.js
β”‚   β”‚   └── payments.js
β”‚   β”œβ”€β”€ database.js
β”‚   β”œβ”€β”€ server.js
β”‚   β”œβ”€β”€ Dockerfile
β”‚   └── package.json
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ App.jsx
β”‚   β”‚   └── main.jsx
β”‚   β”œβ”€β”€ Dockerfile
β”‚   β”œβ”€β”€ nginx.conf
β”‚   └── package.json
β”œβ”€β”€ .github/
β”‚   └── workflows/
β”‚       β”œβ”€β”€ ci.yml
β”‚       β”œβ”€β”€ deploy.yml
β”‚       └── docker-publish.yml
β”œβ”€β”€ docker-compose.yml
β”œβ”€β”€ start.sh
└── README.md

Development

Backend Development

cd backend
npm run dev  # Auto-reload on file changes

Frontend Development

cd frontend
npm run dev  # Vite dev server with hot reload

Production Deployment

Using Docker

  1. Build images:

    docker-compose build
  2. Start services:

    docker-compose up -d

Using GitHub Pages

The frontend is automatically deployed to GitHub Pages when you push to the main branch.

Backend Deployment

For production backend deployment, you can:

  • Use Docker and deploy to any container platform
  • Deploy to services like Railway, Render, Heroku, etc.
  • Use the Docker image from GitHub Container Registry

License

MIT License - see LICENSE file for details

Author

About

Subscription Hub - A modern web application to manage and track your subscription payments in one place. Features payment tracking, statistics dashboard, multi-currency support, and Docker deployment. Built with React, Node.js, and GitHub Actions CI/CD.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors