> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/RafaeltiMoreira/mais-habito-api/llms.txt
> Use this file to discover all available pages before exploring further.

# Mais Hábito API

> A gamified habit-tracking backend API that rewards users with points and streaks for completing daily tasks and challenges.

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="/quickstart">
    Set up and run the API in under 5 minutes.
  </Card>

  <Card title="Authentication" icon="lock" href="/authentication">
    Learn how JWT-based auth works in this API.
  </Card>

  <Card title="API Reference" icon="code" href="/api-reference/auth/signup">
    Explore all endpoints with request/response details.
  </Card>

  <Card title="Gamification" icon="trophy" href="/concepts/gamification">
    Understand the points, XP, and streak reward system.
  </Card>
</CardGroup>

## 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

<CardGroup cols={2}>
  <Card title="JWT Authentication" icon="shield-check">
    Secure signup and login with bcrypt password hashing and JSON Web Tokens.
  </Card>

  <Card title="Points & XP System" icon="star">
    Every completed task awards points. Your score tracks your overall progress.
  </Card>

  <Card title="Streak Tracking" icon="fire">
    Complete at least one task per day to maintain your streak. An overnight cron job resets streaks for missed days.
  </Card>

  <Card title="Challenge Catalog" icon="list-check">
    Browse and accept multi-day challenge templates. Track progress with personal notes.
  </Card>

  <Card title="Daily Tasks & Routines" icon="calendar-check">
    Create one-off tasks or recurring daily routines with custom point values.
  </Card>

  <Card title="Controller-Service-Repository" icon="layer-group">
    Clean layered architecture separating routing, business logic, and database access.
  </Card>
</CardGroup>

## 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:

```
http://localhost:3000/api
```

## Need help?

<CardGroup cols={2}>
  <Card title="Introduction" icon="book-open" href="/introduction">
    Project overview and architecture explanation.
  </Card>

  <Card title="Configuration" icon="gear" href="/configuration/environment">
    Environment variables and database setup.
  </Card>
</CardGroup>
