Habitica
repository·develop·Indexed 12 days ago
https://github.com/habitrpg/habiticaAn open-source habit-building application and productivity tracker that gamifies goals using RPG mechanics. Version 5.49.0 includes a web/server component and mobile applications, with documentation covering Kubernetes deployment on AWS, Docker Compose setup, and development guidelines for the Vue-based client and Node.js server.
What's inside Habitica
- As of August 4, 2026, Habitica has paused acceptance of code-based contributions (Blacksmith tiers). Additionally, the repository enforces a strict No AI-Generated Code Policy: all code must be authored entirely by humans. Submissions containing code generated by LLMs, AI coding assistants, or automated tools will be rejected during pull request reviews.
Understand the role of the Common package
developThecommondirectory contains code and data shared between the Habitica server and the client. This includes logic that must execute in both environments and core game data definitions, such as weapons, armor, and pets.Understand static asset processing and caching
developCertain static asset subfolders are excluded from Webpack processing. Because they are not processed by Webpack, their filenames are not hashed. These assets are cached by the browser for 1 week.
Affected subfolders:
audioemailsiconsmerchpresskit
Important for updates: If you need to update an asset in one of these folders, you should change the filename to ensure the new version is fetched instead of the cached version. For implementation details regarding how these are served, refer to
website/server/middlewares/static.js.Deployment Notes and Best Practices
developData Persistence
MongoDB data is persistent. If you want to start with a fresh database, you must manually remove the EBS volume and re-create it.
AWS Instance Sizing
When running on AWS, it is recommended to use at least
t2.mediumminion nodes for your Kubernetes cluster. The defaultt2.smallinstances are insufficient for running more than two Habitica nodes.Organize components and pages in the Vue structure
developThe project follows a specific directory structure to maintain clarity between pages and reusable components:
/src/pages: Contains page-level components. Each page can have its own subfolder containing sub-components that are only used by that specific page./src/components: Contains reusable components that are shared across multiple different pages.
Best Practice: Avoid mixing pages and components in
/src/components. Move page-specific logic to/src/pagesand keep only truly global, shared components in/src/components.Deploy Habitica in Kubernetes on AWS
developThis guide provides sample Kubernetes configuration files to launch Habitica on AWS. You can deploy it as either a single-node web frontend or a multi-node web frontend.
Prerequisites
- An AWS account.
- A working Kubernetes installation.
- A persistent volume for MongoDB data.
- Docker images of Habitica (you can use the ones included in the YAML files or your own).
Before you begin
- Set up your Kubernetes cluster.
- Create an EBS volume for MongoDB data and note its name for later configuration.
Lint and fix files in the Habitica Client
developTo run linting and automatically fix style issues, use the
lintscript.npm run lintStart a Multi-node Web Frontend
developTo deploy a multi-node instance of the Habitica web frontend, run:
kubectl.sh create -f habitica-rc.yaml kubectl.sh create -f habitica-service.yamlWait for the frontend pods to start up.
How to update text and translations in Habitica
developHabitica's translations are managed via an external translation platform at https://translate.habitica.com/.
To change any text in the application, follow these rules:
- Edit only the American-English strings: All text changes must be made directly in the
locales/endirectory via GitHub. - Do not edit other locales: Never edit files in any other locale directory (e.g.,
locales/fr,locales/es). These files are automatically pulled from the translation platform. - Automatic Sync: Once you update the
locales/enfiles, you do not need to request translations. Changes are automatically copied to the translation website on a regular basis for linguists to process.
- Edit only the American-English strings: All text changes must be made directly in the
Compile spritesheets manually
developBecause spritesheet compilation is not part of the standard production build process (due to Heroku environment constraints), you must manually compile spritesheets whenever new images are added to the repository. Run the following command from the project root:
npm run spritesAccess the Habitica Web Interface
developTo find the address of your deployment:
- Run
kubectl describe svc habiticawebto retrieve the generated hostname for the service. - Open a browser and navigate to
http://<hostname>:3000.
kubectl describe svc habiticaweb- Run
Shut down Habitica in Kubernetes
developTo shut down the deployment, delete the resources in reverse order of creation:
kubectl.sh delete -f habitica-service.yaml kubectl.sh delete -f habitica.yaml # (or habitica-rc.yaml if using multi-node) kubectl.sh delete -f mongo-service.yaml kubectl.sh delete -f mongo.yamlkubectl.sh delete -f habitica-service.yaml kubectl.sh delete -f habitica.yaml kubectl.sh delete -f mongo-service.yaml kubectl.sh delete -f mongo.yaml