Skip to content

GodPuffin/FamilyPlan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Family Plan Management Application

This is a web application for managing shared family plans and subscriptions, built with HTMX, Go, and PocketBase for a modern, interactive user experience with minimal JavaScript.

Features

  • Create and manage family plans for shared subscriptions
  • Invite members using unique join codes
  • Approve or reject join requests
  • Track monthly costs and membership details
  • Owner controls for updating plan details and managing members
  • Server-side rendering with Go templates
  • HTMX for dynamic content without writing custom JavaScript
  • PocketBase for database and authentication

Prerequisites

  • Go 1.21 or higher
  • Git

Getting Started

  1. Clone this repository:

    git clone https://github.com/yourusername/family-plan-manager.git
    cd family-plan-manager
    
  2. Install dependencies:

    go mod tidy
    
  3. Run the application:

    go run ./src/cmd/server
    

    Alternatively, use the Makefile:

    make run
    
  4. Open your browser and navigate to:

    http://localhost:8090
    
  5. Access the PocketBase Admin UI:

    http://localhost:8090/_/
    

Development

For development, you can use Air for hot reloading:

# Install Air
go install github.com/cosmtrek/air@latest

# Run with Air
air

The project includes an .air.toml configuration file for Air.

Setting up the Database

When you first run the application, you'll need to set up the PocketBase database:

  1. Navigate to http://localhost:8090/_/
  2. Create an admin account

Project Structure

  • src/cmd/server/ - Application entry point
  • src/internal/bootstrap/ - PocketBase bootstrap and server startup
  • src/internal/http/ - Router, middleware, and HTTP handlers
  • src/internal/billing/ - Balance and membership billing logic
  • src/internal/domain/ - View models and shared app structs
  • src/internal/assets/ - Embedded HTML templates and static assets
  • src/internal/support/ - Small shared helpers
  • migrations/ - Database migration files
  • pb_data/ - PocketBase data directory (created automatically)

Deployment

This application is currently deployed at familyplanmanager.xyz using a DigitalOcean Droplet with the following configuration:

  • Ubuntu 24.04 LTS
  • Nginx as a reverse proxy
  • SSL certificates from Let's Encrypt
  • UFW firewall for security
  • Systemd for service management

Common Deployment Notes

  • The application runs on port 8090 by default
  • When deploying, ensure IPv4 binding with --http=0.0.0.0:8090
  • For security, set up a firewall allowing only necessary ports (SSH, HTTP, HTTPS)
  • Use a reverse proxy (like Nginx) for SSL termination and to route traffic to the application

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Technologies Used

License

MIT

About

A web application for managing shared family plans and subscriptions with friends

Resources

Stars

Watchers

Forks

Contributors

Languages