Go to file
Urvish Prajapati 464350cce4 feat(catalog): auto-create pending_pricing plans on module sync and enrich public catalog APIs 2026-12-02 14:53:39 +05:30
alembic feat(coupons): add per-user limit and fully redeemed status 2026-12-01 12:36:13 +05:30
app feat(catalog): auto-create pending_pricing plans on module sync and enrich public catalog APIs 2026-12-02 14:53:39 +05:30
docs fix(module-builder): fix pool exhaustion deadlock and allow therapeutic modules 2026-11-23 13:18:02 +05:30
tests feat(catalog): auto-create pending_pricing plans on module sync and enrich public catalog APIs 2026-12-02 14:53:39 +05:30
.dockerignore fix(commerce): standardize module code seeding to lowercase and add super_admin role 2026-09-16 13:13:56 +05:30
.git_api_info build: update lockfile and docker build timeout 2026-10-30 15:27:30 +05:30
.gitignore feat(docker): embed git metadata and add greenlet async dependency 2026-10-09 14:05:58 +05:30
.python-version Init Api 2026-09-05 19:29:21 +05:30
Dockerfile build: update lockfile and docker build timeout 2026-10-30 15:27:30 +05:30
README.md feat(admin): support EUR multi-currency pricing in admin plans 2026-11-23 14:31:03 +05:30
alembic.ini Updated serach fix 2026-09-26 22:13:04 +05:30
pyproject.toml test: add comprehensive pytest suite and auto-updating test badges 2026-10-19 11:46:14 +05:30
uv.lock build: update lockfile and docker build timeout 2026-10-30 15:27:30 +05:30

README.md

Acupedia API - Backend Services

FastAPI Backend Platform for Acupedia Learning Content, Subscriptions, Pricing, and Payments.

Tests Coverage

Metric Status
Test Suite PASSED
Tests Passing 12
Tests Failing 0
Core Coverage 75%
Last Updated 2026-11-23 08:57:00 UTC

Features & Services

  • Authentication & Security: JWT tokens, bcrypt password hashing, password strength validation, OTP flow.
  • Cart & Pricing Engine: Dynamic currency resolution (INR / USD), multi-unit volume discounts, returning user loyalty discounts, coupon redemption rules, and convenience fee calculations.
  • Content & Curriculum: Acupoints, channels, topics, clinical modules with preview capabilities.
  • Checkout & Payments: Razorpay orders, automatic invoice creation, payment status verification.
  • Webhooks: Cryptographically validated Razorpay webhook listener for real-time payment captures and failures.
  • Administrative Portal: Role-Based Access Control (super_admin, admin, finance_admin), refund processing, catalog status toggles.
  • Search System: Faceted multi-scope search with typeahead and category filtering.

Test Suite & Automation

The test suite is powered by pytest with asynchronous testing via httpx.AsyncClient and mocked dependencies for rapid execution (under 4 seconds) without external live service dependencies.

Running Tests

# Run all tests
.venv/bin/pytest

# Run tests with verbose output
.venv/bin/pytest -v

# Run tests with code coverage report
.venv/bin/pytest --cov=app --cov-report=term-missing

Note: Running pytest automatically updates the test status table and badges above in this README.md.


Appendix: Legacy Seed Plans Reference
{
    "version": 1,
    "plans": [
    {
      "code": "POINTS_ACU",
      "name": "Acu Points Module (1 Yr)",
      "plan_type": "one_time",
      "billing_period": "yearly",
      "module_fee": "300.00",
      "currency_code": "INR",
      "country": "India",
      "is_active": true,
      "sort_order": 10,
      "modules": [
        { "module_code": "M0001" }
      ]
    },
    {
      "code": "POINTS_SCALP",
      "name": "Scalp Points Module (1 Yr)",
      "plan_type": "one_time",
      "billing_period": "yearly",
      "module_fee": "100.00",
      "currency_code": "INR",
      "country": "India",
      "is_active": true,
      "sort_order": 20,
      "modules": [
        { "module_code": "M0003" }
      ]
    },
    {
      "code": "POINTS_EAR",
      "name": "Ear Points Module (1 Yr)",
      "plan_type": "one_time",
      "billing_period": "yearly",
      "module_fee": "200.00",
      "currency_code": "INR",
      "country": "India",
      "is_active": true,
      "sort_order": 30,
      "modules": [
        { "module_code": "M0002" }
      ]
    },
    {
      "code": "POINTS_TUNG",
      "name": "Tung Points Module (1 Yr)",
      "plan_type": "one_time",
      "billing_period": "yearly",
      "module_fee": "300.00",
      "currency_code": "INR",
      "country": "India",
      "is_active": false,
      "sort_order": 40,
      "modules": [
        { "module_code": "M0004" }
      ]
    },
    {
      "code": "LIFETIME_ALL_USD",
      "name": "Lifetime All-Access Plan (USD)",
      "plan_type": "bundle",
      "billing_period": "lifetime",
      "module_fee": "350.00",
      "currency_code": "USD",
      "country": "USA",
      "is_active": true,
      "sort_order": 310,
      "modules": [
        { "module_code": "M0001" },
        { "module_code": "M0002" },
        { "module_code": "M0003" }
      ]
    }
  ]
}