This is a fork of Habitica which I host at home for my family.
These are the changes I will make:
- Turn off third party services, firstly analytics and payment services.
- Enable Group plans.
- Work with Windows.
- Work well for development in Visual Studio Code.
Any changes I make which might be accepted by the upstream project will be submitted for their review.
Canonical link: https://github.com/HabitRPG/habitica/wiki/Setting-Up-Habitica-for-Local-Development
Production Habitica runs on Ubuntu Linux, so these instructions are for similar environments, i.e., Debian-based Linux distros. Running Habitica on other architectures, like Windows, may require additional setup not documented here.
- Install system packages:
sudo apt install -y curl git libkrb5-dev - install libssl-1.1:
- `wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb
sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2_amd64.deb
- Install Node Version Manager:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash - Restart your terminal session, then
nvm install 20 - Clone the Habitica repository and install dependencies:
git clone https://github.com/HabitRPG/habiticacd habiticanpm icp config.json.example config.json
When you're ready to start a Habitica webserver:
npm run mongo:dev
- If this command fails on your system, you may need to install MongoDB Community Server. Then instead of
npm run mongo:dev, usesudo service mongod start.
- In a separate terminal session,
npm start
- If the process silently halts, throws
EPIPEerrors, etc., your system may not have sufficient RAM. Check your swap file size and increase it to at least 4 GB. - You may additionally need to increase the file watchers limit:
echo fs.inotify.max_user_watches=524288 | sudo tee /etc/sysctl.d/50-max-user-watches.conf && sudo sysctl --system
- In a third terminal session,
npm run client:dev - Visit http://localhost:8080 in your browser and get started by setting up a Habitica account on your local site!
Most code changes will result in the process automatically restarting, such that a browser refresh will show your work live. Some files in website/common, notably website/common/locales, may require you to halt and restart the Express server (the npm start session).
Habitica is an open-source habit-building program that treats your life like a role-playing game. Level up as you succeed, lose HP as you fail, and earn Gold to buy weapons and armor!
Want to contribute code to Habitica? We're always looking for assistance on any issues in our repo with the "Help Wanted" label. The wiki pages below and the additional linked pages will tell you how to start contributing code and where you can seek further help or ask questions:
- Guidance for Blacksmiths - an introduction to the technologies used and how the software is organized.
- Setting up Habitica Locally - how to set up a local install of Habitica for development and testing.
Interested in contributing to Habitica’s mobile apps? Visit the links below for our mobile repositories.
Habitica's code is licensed as described at https://github.com/HabitRPG/habitica/blob/develop/LICENSE
Found a bug? Please report it to admin email rather than create an issue (an admin will advise you if a new issue is necessary; usually it is not).
Creating a third-party tool? Please review our API Usage Guidelines to ensure that your tool is compliant and maintains the best experience for Habitica players.
Have any questions about Habitica or contributing? See the links in the Habitica website's Help menu. There’s FAQ’s, guides, and the option to reach out to us with any further questions!