TrackBear is a writing tracker service. If you're writing, editing, or otherwise engaged in some sort of authorial project, you can track that project on TrackBear!
You'll need a Postgres database to back TrackBear up. The easiest way to make this work is by using the included docker-compose.yaml file.
docker compose upThe first time you set up your docker stack, you will need to manually create the queue database. This is a limitation of the Postgres docker container. Exec into the container (docker exec -it /bin/bash trackbear-db-1) and run:
createdb -U $POSTGRES_USER queue# install dependencies
npm install
# copy the .env file and then fill it out
cp .env.example .envSee the environment variable documentation for more details on environment variables.
To start TrackBear in development mode:
npm run startYou can also start TrackBear in production mode:
# compile the app first
npm run compile
# then start it up
npm run start:prodYou can run tests thus:
npm run testor you can look at the results in a web-based UI:
npm run test:webuiThere is also coverage reporting available, which will deposit a coverage report in coverage/:
npm run coverageBuilding and running the docker containers should take care of any migrations that Prisma can detect. If you need to make a new migration, you can run npx prisma migrate --create-only.
To tag a new version, run:
npm version [major | minor | patch]This will:
- Build the app and container (to make sure it's green)
- Change the version in
package.jsonandpackage-lock.jsonto the new version - Add and commit any changed files with the commit message
v${VERSION} - Create a tag called
v${VERSION}
It's up to you to push the commit and tags:
git push
git push --tagsOnce you do this, a Github Action will build a production-ready container and upload it to ghcr.io.
The app runs as a container on the server. There's no fancy remote deploy yet, so to update, you'll need to SSH into the server, and run the container restart script.
This should probably be made better at some point, but for now, it works fine.
Polar bear photo by Hans-Jurgen Mager on Unsplash.
Thank you to the Overachievers Discord Chat for alpha-testing this and providing many good suggestions. Thank you to many, many other people for suggesting new features and finding bugs. See ACKNOWLEDGEMENTS.md and CHANGELOG.md for a list!