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
| Layer | Technology |
|---|---|
| Runtime | Node.js 20+ |
| Language | TypeScript 5.9 |
| Framework | Express 5 |
| Database | PostgreSQL 16 |
| Query builder | Knex.js |
| Auth | JWT + bcrypt |
| Scheduler | node-cron |
Base URL
All API endpoints are relative to your server’s base URL:Need help?
Introduction
Project overview and architecture explanation.
Configuration
Environment variables and database setup.