Gamified Tracker and Journal
Emotions, Habits, Thoughts
API for Habitus App [Github - Frontend].
Habitus App is Unobtrusive and Easy to use Habit tracker.
Anonymous and Open-Source.
- TypeScript
- Koa.js
- Database: MongoDB: Mongoose
- Config: Dotenv, Joi
- Testing: Jest: SuperTest, MongoDBMemoryServer
- Docker: MongoDB
- π₯° Emotion CRUD
- πͺ Habit CRUD
- π π· Tag CRUD
- π JWT auth for Admin actions
Docker
Runs MongoDB
container.
cd docker
cp .env.example .env
docker-compose up -d
Application
# Return to root
cd ..
cp .env.example .env
npm i
npm run dev
Using Jest
Testing Framework.
Jest uses SuperTest
and MongoDBMemoryServer
.
npm run test
Check out Postman Documentation.
Pre-set environment variables:
host
admin_password
Dynamic environment variables, automatically set in tests:
access_token
habit_id
Few routes are protected with jwtCheck
middleware.
Requests going to these routes require Authorization: Bearer {token}
header.
Protected Routes
- [Emotion,Habit][create,update,delete]
Getting access token
Endpoint: POST /auth/token
.
Body: { password: ADMIN_PASSWORD }
.
Admin password
ADMIN_PASSWORD
is defined in .env
file.
It defaults to secret
.
Written in TypeScript
,
using Vue.js
and Vuetify
.
Join the open-source development - Github - Habitus App - Frontend.
Check the live version at habitus.today.
Habitus