A simple web application to track experience points (XP) and unlock achievements as you complete tasks. Built with Go, HTMX, and Tailwind CSS.
- 🎯 Create and complete tasks to earn XP
- 📊 Track progress with a visual XP bar
- 🏆 Define and unlock achievements at different levels
- 🔄 Real-time updates using HTMX
- 💾 Persistent storage using PostgreSQL
- Backend: Go
- Frontend: HTMX + Tailwind CSS
- Deployment: Fly.io
- Storage: PostgreSQL
- Make sure you have Go 1.22.2 or later installed
- Clone the repository
- Create a PostgreSQL database
- Create a
.env
file with your database connection string:
DATABASE_URL=postgres://username:password@localhost:5432/dbname?sslmode=disable
- Run the SQL schema to create the tables:
CREATE TABLE tasks (
id SERIAL PRIMARY KEY,
name VARCHAR(255) NOT NULL,
xp INTEGER NOT NULL,
completed BOOLEAN DEFAULT FALSE
);
CREATE TABLE unlockables (
id SERIAL PRIMARY KEY,
level INTEGER NOT NULL,
description TEXT NOT NULL
);
CREATE TABLE app_state (
id INTEGER PRIMARY KEY DEFAULT 1,
total_xp INTEGER DEFAULT 0,
CHECK (id = 1)
);
CREATE TABLE unlocked_levels (
level INTEGER PRIMARY KEY,
unlocked BOOLEAN DEFAULT TRUE
);
- Run the application:
go run main.go
The application will be available at http://localhost:8080
- Each task has an XP value
- Completing tasks adds XP to your total
- Every 1000 XP equals one level
- Unlockables become available when you reach their required level
- Progress is automatically saved to PostgreSQL
The application is configured to deploy on Fly.io. To deploy:
- Install the Fly.io CLI
- Authenticate with Fly.io
- Set up your PostgreSQL database URL as a secret:
fly secrets set DATABASE_URL="postgres://username:password@host:5432/dbname"
- Deploy using:
fly deploy
main.go
- Main application logic and HTTP handlerstemplates/
- HTML templatesindex.html
- Base templateapp.html
- Main application layouttasks.html
- Task list componentprogress.html
- XP progress barunlockables.html
- Unlockables listadd_task.html
- Task creation form
MIT License
Feel free to open issues or submit pull requests for any improvements or bug fixes.