Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andromedatechnology/habitus-api
🏄 API for Habitus App - State-of-the-art Tracker for emotions, habits and thoughts. | Gamified. | Anonymous and open source.
https://github.com/andromedatechnology/habitus-api
habit-api habits habitus journal koa koajs nodejs tracker typescript
Last synced: 3 months ago
JSON representation
🏄 API for Habitus App - State-of-the-art Tracker for emotions, habits and thoughts. | Gamified. | Anonymous and open source.
- Host: GitHub
- URL: https://github.com/andromedatechnology/habitus-api
- Owner: AndromedaTechnology
- License: mit
- Created: 2021-06-04T08:46:20.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-07-05T09:01:18.000Z (7 months ago)
- Last Synced: 2024-11-07T09:03:51.668Z (3 months ago)
- Topics: habit-api, habits, habitus, journal, koa, koajs, nodejs, tracker, typescript
- Language: TypeScript
- Homepage: https://habitus.today
- Size: 224 KB
- Stars: 6
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
Habitus API - Healthiest version of you
Gamified Tracker and Journal
Emotions, Habits, Thoughts
API for [**Habitus App**](https://habitus.today) [[Github - Frontend](https://github.com/AndromedaTechnology/habitus)].
```
Habitus App is Unobtrusive and Easy to use Habit tracker.Anonymous and Open-Source.
```# 1. Technology
- TypeScript
- Koa.js
- Database: MongoDB: Mongoose
- Config: Dotenv, Joi
- Testing: Jest: SuperTest, MongoDBMemoryServer
- Docker: MongoDB# 2. Features
- 🥰 Emotion CRUD
- 💪 Habit CRUD
- 🆕 🏷 Tag CRUD
- 🔐 JWT auth for Admin actions# 3. Run
**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
```# 4. Tests
Using `Jest` Testing Framework.
Jest uses `SuperTest` and `MongoDBMemoryServer`.
```
npm run test
```# 5. Postman
Check out [Postman Documentation](https://documenter.getpostman.com/view/97483/TzY4faNK).
Pre-set environment variables:
- `host`
- `admin_password`Dynamic environment variables,
automatically set in tests:- `access_token`
- `habit_id`# 6. Protected Routes [Admin access]
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`.
# 7. Habitus Frontend
Written in `TypeScript`,
using `Vue.js` and `Vuetify`.
**Join the open-source development - [Github - Habitus App - Frontend](https://github.com/AndromedaTechnology/habitus)**.
Check the live version at [habitus.today](https://habitus.today).
## 7. 1. Frontend preview
![User page](https://i.imgur.com/v8HgZjy.png)
[Check the gallery](https://imgur.com/gallery/9X7WC6U).
# 8. Social
Habitus
- [Medium](https://medium.com/@habitus.today)
- [Twitter](https://twitter.com/HabitusToday)
Started in Europe, Croatia 🇭🇷
Crafted with ❤️
by contributors around the 🌍 World and 🌌 Andromeda.