HabitTrove
HabitTrove is a gamified habit tracking application that helps you build and maintain positive habits by rewarding you with coins, which you can use to exchange for rewards.
⚠️ Important: HabitTrove is currently in beta. Please regularly backup your
data/directory to prevent any potential data loss.
Try the Demo
Want to try HabitTrove before installing? Visit the public demo instance to experience all features without any setup required. (do not store personal info. Data on the demo instance is reset daily)
Features
- 🎯 Create and track daily habits
- 🏆 Earn coins for completing habits
- 💰 Create a wishlist of rewards to redeem with earned coins
- 📊 View your habit completion streaks and statistics
- 📅 Calendar heatmap to visualize your progress (WIP)
- 🌙 Dark mode support (WIP)
- 📲 Progressive Web App (PWA) support (Planned)
Usage
-
Creating Habits: Click the "Add Habit" button to create a new habit. Set a name, description, and coin reward.
-
Tracking Habits: Mark habits as complete on your dashboard. Each completion earns you the specified coins.
-
Wishlist: Add rewards to your wishlist that you can redeem with earned coins.
-
Statistics: View your progress through the heatmap and streak counters.
Docker Deployment
HabitTrove can be run using Docker in several ways, depending on your needs:
Using Pre-built Images
The easiest way to run HabitTrove is using our pre-built Docker images from DockerHub:
- First, prepare the data directory with correct permissions:
mkdir -p data
chown -R 1001:1001 data # Required for the nextjs user in container
- Then run using either method:
# Using docker-compose (recommended)
docker compose up -d
# Or using docker run directly
docker run -d -p 3000:3000 -v ./data:/app/data dohsimpson/habittrove
Available image tags:
latest: Stable release version, recommended for most usersvX.Y.Z(e.g.,v0.1.4): Specific version for reproducible deployments and rollbacksdev: Latest development build from the main branch, may contain unstable features
Choose your tag based on needs:
- Use
latestfor general production use - Use version tags (e.g.,
v0.1.4) for reproducible deployments - Use
devfor testing new features
Building Locally
If you want to build the image locally (useful for development):
# Build the Docker image
npm run docker-build
# Run the container
npm run docker-run
The application data will be persisted in the data directory in both cases.
Building the Project
To contribute to HabitTrove, you'll need to set up a development environment. Here's how to get started:
Prerequisites
- Node.js 20 or later
- npm package manager
- Git (for version control)
- bun (for running tests)
Setting Up the Development Environment
- Clone the repository and navigate to the project directory:
git clone https://github.com/dohsimpson/habittrove.git
cd habittrove
- Install project dependencies:
npm install --force
- Set up the development environment:
npm run setup:dev
- Start the development server:
npm run dev
- Open http://localhost:3000 in your browser to access the development version.
Running Tests
Before contributing, make sure to run the test suite:
npm test
Building for Production
To build the project for production:
npm run build
This will create an optimized production build in the .next directory.
Code Quality Tools
The project uses several tools to maintain code quality:
- ESLint for linting:
npm run lint - TypeScript type checking:
npm run type-check
Run these commands regularly during development to catch issues early.
Contributing
Contributions are welcome! We appreciate both:
- Issue submissions for bug reports and feature requests
- Pull Requests for code contributions
For major changes, please open an issue first to discuss what you would like to change.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
License
This project is licensed under the GNU Affero General Public License v3.0 - see the LICENSE file for details.
Support
If you encounter any issues or have questions, please file an issue on the GitHub repository.