Skip to content

About

Node.js + Express Backend for UltimateHealth – Secure REST APIs for multilingual health articles, podcasts, user reviews, moderation, JWT auth, and admin analytics. Built with MongoDB + Swagger documentation.

Topics

Resources

Code of conduct

Contributing

Stars

3 stars

Watchers

1 watching

Forks

Latest commit

 

History

702 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UltimateHealth Backend

Node.js Express.js MongoDB Redis Apache Kafka Docker Swagger


Live Web Demo Android App API Docs

🧾 License 🌟 Stars 🍴 Forks 🐛 Issues
License Stars Forks Issues
🔄 Open PRs ✅ Closed PRs ⏱️ Last Commit
Open PRs Closed PRs Last Commit

📌 Article & Podcast Optimization (Completed & Deployed)

  • ✅ Compound Indexing: Added MongoDB compound indexes across Articles and Glossary models for fast feed pagination and tag filtering.
  • ✅ Full-Text Search (FTS): Built-in weighted text search indexes (title, summary, description, content).
  • ✅ Stateless Glossary Autodetect: High-speed, sliding-window medical terminology extraction for article preview pages.
  • ✅ Sub-Millisecond Auth: Upgraded token service to RS256 Asymmetric JWT + Redis JTI tracking & User Token Versioning.

🚀 Overview

The core backend engine powering UltimateHealth — a community-driven open-source health platform.

Provides secure, high-throughput REST & WebSocket APIs for:

  • Multilingual health articles, podcasts & series playlists
  • Medical terminology autodetect & glossary search
  • Collaborative content review & admin moderation workflows
  • High-performance RS256 JWT auth with Redis session revocation
  • Asynchronous Kafka event queues for notifications & analytics
  • Gemini AI medical assistant chat integration

🔗 Submodule Repositories


✨ Key Features

  • Multilingual Articles & Podcasts: CRUD with translation links (translationOf), audio tagging, and playlist curation.
  • Enterprise Security: RS256 Asymmetric JWT signing, Redis sub-millisecond JTI blacklisting, User Token Versioning, and RBAC.
  • Asynchronous Event Queues: Dual-broker Apache Kafka cluster with 12 partitions per topic for non-blocking emails and analytics.
  • Glossary Autodetect: Stateless HTML plain-text extraction and medical phrase matching.
  • Content Moderation & Strikes: Admin review pipeline for podcast and article approval.
  • Interactive Swagger Docs: Deployed live at https://ultimatehealth.blog/api/docs.

🔐 Authentication & Roles

  • Users: Instant self-registration with automatic verification (isVerified: true) and refresh token attachment. Users receive access and refresh tokens directly upon registration without needing a second email verification step, enabling immediate access to browse, publish health articles, listen to podcasts, interact with the community, or register as health professionals.
  • Admins & Moderators: Cannot self-register. Admin accounts are explicitly created by a Super Admin or UltimateHealth Admin. To activate their account (isVerified: true), newly created admins must review and digitally sign the agreement from the website (/admin-agreement). Password recovery is managed via a secure multi-step verification token flow.

🛠️ Tech Stack

  • Runtime: Node.js 22
  • Framework: Express.js
  • Database: MongoDB 6.0 + Mongoose
  • Cache & Auth Memory: Redis 7 (ioredis)
  • Event Streaming: Apache Kafka (Dual-broker)
  • Security: RS256 RSA Key Pair + RBAC
  • Gateway & Proxy: Nginx (SSL/TLS, HTTP/2, Socket.IO WebSockets)
  • Storage: PocketBase + AWS S3 / Vultr Object Storage
  • Containerization: Docker & Docker Compose
  • Docs: Swagger (OpenAPI 3)

🚀 Quick Start (Local Development)

  1. Clone the repository

    git clone https://github.com/SB2318/ultimatehealth-backend.git
    cd ultimatehealth-backend
  2. Install dependencies

    npm install
  3. Generate RS256 Key Pair (Optional for local RSA signing)

    mkdir -p keys
    openssl genrsa -out keys/private.pem 2048
    openssl rsa -in keys/private.pem -outform PEM -pubout -out keys/public.pem
  4. Environment Setup Copy .env_sample to .env and fill in your values:

    cp .env_sample .env
  5. Start Stack via Docker Compose

    docker compose up -d --build

    Or run Node API locally:

    npm start

📁 Project Structure

ultimatehealth-backend/
├── config/            # Database, Redis & environment validation
├── controllers/       # Business logic (articles, podcasts, users, admin)
├── middleware/        # RS256 Auth, RBAC, rate limiting, error handling
├── models/            # Mongoose schemas (Articles, Podcast, Glossary, Users)
├── routes/            # API endpoints & OpenAPI specs
├── services/          # Token service, security, Kafka producers/consumers
├── utils/             # Circuit breaker, pocketbase utils, glossary detector
├── keys/              # RS256 RSA Private & Public Keys (Git ignored)
├── docker-compose.yml # Container orchestration (API, Mongo, Redis, Kafka, PocketBase)
├── Dockerfile         # Production Node.js container
├── index.js           # Express app entry point
└── README.md

🤝 How to Contribute

We welcome contributions! This backend is open for students, developers, and open-source enthusiasts.

Getting Started

  • Read our CONTRIBUTING.md for detailed guidelines.
  • Look for issues labeled with good-first-issue — perfect for beginners.

Thank you for contributing to our repository

We appreciate your help in making UltimateHealth even better.😃


Susmita Bhattacharya

HRUSHIKESH SHINDE

Srijan Jaiswal

Aditya Chaube

Vedant Idlgave

Nipun Kumar Reddy

Anshul Jain

Akshata Srivastava

All Contributors

About

Node.js + Express Backend for UltimateHealth – Secure REST APIs for multilingual health articles, podcasts, user reviews, moderation, JWT auth, and admin analytics. Built with MongoDB + Swagger documentation.

Topics

Resources

Code of conduct

Contributing

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages