Skip to main content

Welcome to Ceboelha API

Ceboelha API is a comprehensive REST API designed to help people manage Irritable Bowel Syndrome (IBS) through FODMAP diet tracking, symptom monitoring, and personalized insights.
Ceboelha means “little onion” in Portuguese - a playful reference to onions being a high-FODMAP food that many IBS sufferers need to avoid.

What is Ceboelha?

Ceboelha provides a complete backend solution for IBS management applications, featuring:
  • Food Database - Comprehensive FODMAP information for thousands of foods
  • Symptom Tracking - Detailed logging of IBS symptoms with intensity and patterns
  • Food Diary - Track meals and identify trigger foods
  • Smart Insights - AI-powered pattern recognition and personalized recommendations
  • Achievements System - Gamification to encourage consistent tracking
  • Secure Authentication - JWT-based auth with refresh token rotation

Core Features

Food Database

Search 5000+ foods with FODMAP levels, nutrition info, and serving sizes

Symptom Tracking

Log symptoms with type, intensity, duration, and automatic pattern detection

Smart Insights

Get personalized insights, trigger identification, and weekly summaries

Achievements

Motivate users with unlockable achievements and progress tracking

Tech Stack

Ceboelha is built with modern, high-performance technologies:
  • Runtime - Bun for blazing-fast JavaScript execution
  • Framework - Elysia for type-safe REST APIs
  • Database - MongoDB with Mongoose ODM
  • Authentication - JWT with secure httpOnly cookies
  • Documentation - Swagger/Scalar interactive API docs

Key Capabilities

Authentication & Security

  • JWT access tokens (15min) + refresh tokens (7 days)
  • Automatic token rotation for enhanced security
  • Account lockout after failed login attempts
  • Rate limiting on all endpoints
  • bcrypt password hashing (12 rounds)
See Authentication for details.

FODMAP Food Database

  • 5000+ foods with FODMAP classifications
  • Search by name, category, or FODMAP level
  • Nutrition information (calories, macros, fiber)
  • Multiple serving size options
  • Filterable by source (Monash, FODMAP Friendly, etc.)
See Foods API for details.

Diary & Symptom Tracking

  • Log meals with multiple foods and serving sizes
  • Track symptoms with 5-level intensity scale
  • Automatic correlation between foods and symptoms
  • Daily, weekly, and monthly summaries
  • Export capabilities for healthcare providers
See Diary API for details.

Insights & Analytics

  • Highlights - Daily personalized insights and tips
  • Weekly Summary - Track progress with week-over-week comparisons
  • Discoveries - AI-identified trigger foods and safe foods
  • Patterns - Time-based symptom patterns and food combinations
See Insights API for details.

API Architecture

Ceboelha follows REST best practices:
GET    /api/foods              # List/search foods
GET    /api/foods/:id          # Get specific food

POST   /api/diary/meal         # Log a meal
POST   /api/diary/symptom      # Log a symptom
GET    /api/diary              # List diary entries

GET    /api/insights/highlights        # Get daily insights
GET    /api/insights/weekly-summary    # Get weekly stats
GET    /api/insights/discoveries       # Get identified patterns
All API endpoints are prefixed with /api and most require authentication via Bearer token.

Response Format

All API responses follow a consistent structure:
{
  "success": true,
  "data": {
    // Response data here
  },
  "message": "Optional success message",
  "pagination": {
    // For paginated endpoints
    "total": 100,
    "page": 1,
    "limit": 50,
    "pages": 2
  }
}
Error responses:
{
  "success": false,
  "error": "ValidationError",
  "code": "INVALID_INPUT",
  "message": "Email is required",
  "details": {
    // Additional error context
  }
}

Rate Limits

Rate limits are enforced to prevent abuse and ensure fair usage for all users.
  • General API: 100 requests per minute
  • Authentication: 5 requests per 15 minutes
  • Sensitive operations: 3 requests per 5 minutes
Rate limit headers are included in responses:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1234567890

Interactive Documentation

Ceboelha includes built-in Swagger/Scalar documentation:
http://localhost:3333/docs
The interactive docs allow you to:
  • Explore all endpoints
  • Test API calls directly from the browser
  • View request/response schemas
  • Authenticate and test protected endpoints

Health Check

Monitor API health:
curl http://localhost:3333/health
Response:
{
  "success": true,
  "status": "healthy",
  "timestamp": "2026-03-03T14:30:00.000Z",
  "version": "1.0.0",
  "environment": "production"
}

Next Steps

Quick Start

Get up and running in 5 minutes

Authentication

Learn how to authenticate users

API Reference

Explore all available endpoints

GitHub Repository

View the source code

Need Help?

  • Email: support@ceboelha.app
  • Issues: Report bugs on GitHub
  • Swagger Docs: /docs endpoint for interactive testing
This API was made with love for Julia 💕

Build docs developers (and LLMs) love