Skip to main content

Quickstart

Set up and run the API in under 5 minutes.

Authentication

Learn how JWT-based auth works in this API.

API Reference

Explore all endpoints with request/response details.

Gamification

Understand the points, XP, and streak reward system.

What is Mais Hábito?

Mais Hábito (More Habit) is a single-player backend API that helps users build better daily routines through gamification. Users earn points and maintain streaks by completing tasks and multi-day challenges — turning productivity into a game.

Key features

JWT Authentication

Secure signup and login with bcrypt password hashing and JSON Web Tokens.

Points & XP System

Every completed task awards points. Your score tracks your overall progress.

Streak Tracking

Complete at least one task per day to maintain your streak. An overnight cron job resets streaks for missed days.

Challenge Catalog

Browse and accept multi-day challenge templates. Track progress with personal notes.

Daily Tasks & Routines

Create one-off tasks or recurring daily routines with custom point values.

Controller-Service-Repository

Clean layered architecture separating routing, business logic, and database access.

Tech stack

LayerTechnology
RuntimeNode.js 20+
LanguageTypeScript 5.9
FrameworkExpress 5
DatabasePostgreSQL 16
Query builderKnex.js
AuthJWT + bcrypt
Schedulernode-cron

Base URL

All API endpoints are relative to your server’s base URL:
http://localhost:3000/api

Need help?

Introduction

Project overview and architecture explanation.

Configuration

Environment variables and database setup.

Build docs developers (and LLMs) love