Git Product home page Git Product logo

habitus-api's Introduction

Habitus API - Healthiest version of you

Habitus Logo

Gamified Tracker and Journal
Emotions, Habits, Thoughts

Heroku
Node TypeScript Docker Jest
Medium Twitter Patreon Buymeacoffee

API for Habitus App [Github - Frontend].

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.

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.

Check the live version at habitus.today.

7. 1. Frontend preview

User page

Check the gallery.

8. Social

Habitus


Crafted with โค๏ธ
by contributors around the ๐ŸŒ World and ๐ŸŒŒ Andromeda.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.