Microservices Fitness E-commerce & Nutrition Platform
Status: In Progress — backend services partially implemented, fullstack product vision in development
FitSupply Pro is designed as a fullstack platform that combines fitness commerce with practical nutrition and body-composition tools in one product experience. The target product allows customers to browse and buy supplements, gym accessories, and recovery products while also using built-in fitness utilities such as TDEE and macro calculation, body fat estimation, food logging, and personal progress tracking.
The long-term goal is to make FitSupply Pro useful beyond checkout. Instead of acting only as an online store, the product vision is a user-centered health and performance platform where shopping, nutrition planning, and progress monitoring support each other. Customers should be able to discover products, manage orders, understand calorie and macro needs, and track their fitness journey from a single account.
For admins, the target product is intended to support catalog operations and business visibility at the same time. The planned admin experience includes managing products, inventory, orders, and analytics through a structured service-based architecture that can grow over time.
This repository does not implement that full product yet. The current codebase is a backend-only monorepo with several backend services already started, while the frontend and multiple planned product domains are still in progress.
FitSupply Pro currently exists as a TypeScript backend monorepo built around a microservices-style architecture. The repository includes an API Gateway, an authentication service, a catalog service, a partially implemented inventory service, and a very early order service.
What exists today is mainly backend infrastructure and core commerce-oriented APIs:
api-gatewayis implemented and routes requests to backend services.auth-serviceis implemented for registration, login, token refresh, logout, JWKS, and authenticated user lookup.catalog-serviceis implemented with CRUD APIs for categories, brands, and products.inventory-serviceis partially implemented with inventory creation, lookup, update, and stock adjustment flows.order-serviceis still at an early setup stage and currently exposes only a health endpoint.
The following are not implemented yet in this repository: frontend application, cart, checkout, full order workflow, fitness service, nutrition service, notifications, analytics, automated tests, CI/CD, Swagger/OpenAPI, and production deployment.
- Browse supplements, accessories, and recovery products
- Search, filter, and sort product listings
- Add products to cart and place orders
- View account profile and order history
- Calculate TDEE and daily macro targets
- Estimate body fat using guided inputs
- Log meals and nutrition intake
- Track body metrics and fitness progress over time
- Manage categories, brands, and products
- Manage inventory and stock movements
- Manage customer orders and fulfillment status
- Review sales and operational analytics
- Monitor platform activity across services
- Proxy routing to backend services
- JWT access token verification
- Rate limiting for auth, catalog, inventory, and order routes
Helmetfor basic HTTP hardeningMorganrequest logging- Shared error handling
- Internal secret header for service-to-service protection
- Prisma models for
UserandRefreshToken - User registration
- User login
- Authenticated user lookup (
/me) - Refresh token endpoint
- Logout endpoint
- JWKS endpoint for public key distribution
- Password hashing
- JWT-based authentication
- Refresh token rotation and revocation
- Zod request validation
- Prisma models for
Category,Brand, andProduct - CRUD APIs for categories
- CRUD APIs for brands
- CRUD APIs for products
- Product filtering, pagination, and sorting
- Product publish and unpublish actions
- Prisma migrations
- Prisma seed data
- Prisma model for
Inventory - Create inventory records
- Get inventory by
productId - Update inventory by
productId - Batch inventory lookup
- Stock adjustment endpoint
availableStockresponse logic- Stock consistency checks
- Health endpoint only
Planned
┌──────────────────┐
│ React Frontend │
│ Store + Admin │
└────────┬─────────┘
│
▼
┌──────────────────┐
│ API Gateway │
│ Implemented │
└───────┬──────────┘
│
┌──────────────────────┼──────────────────────────┬─────────────────────┐
│ │ │ │
▼ ▼ ▼ ▼
┌───────────────┐ ┌───────────────┐ ┌───────────────┐ ┌───────────────┐
│ Auth Service │ │ Catalog │ │ Inventory │ │ Order Service │
│ Implemented │ │ Service │ │ Service │ │ Early │
│ │ │ Implemented │ │ Partial │ │ Health only │
└───────────────┘ └───────────────┘ └───────────────┘ └───────────────┘
│ │ │ │
└──────────────┬─────┴───────────────┬─────────┴─────────────────────┘
│ │
▼ ▼
┌──────────────────────────────────┐
│ PostgreSQL + Prisma │
│ auth_db / catalog_db / │
│ inventory_db / order_db │
└──────────────────────────────────┘
Planned Future Services
┌───────────────────────────────────────────────────────────────┐
│ Cart / Checkout / Fitness / Nutrition / Notifications / │
│ Analytics / Reporting │
└───────────────────────────────────────────────────────────────┘
| Service | Responsibility | Status |
|---|---|---|
api-gateway |
Entry point, proxy routing, auth verification, rate limiting, request protection | Implemented |
auth-service |
Authentication, JWT issuing/verification support, refresh token lifecycle, user session endpoints | Implemented |
catalog-service |
Categories, brands, products, product querying, publish state | Implemented |
inventory-service |
Inventory records, stock lookup, stock adjustment, stock rules | Partially implemented |
order-service |
Order domain | Very early, health endpoint only |
packages/shared |
Shared auth, middleware, validation, and error utilities | Implemented |
Only technologies that exist in the repository today:
- TypeScript
- Node.js
- Express 5
- npm workspaces
- PostgreSQL
- Prisma
- Zod
- Docker
- Docker Compose
jose/ JWThelmetmorganhttp-proxy-middleware
Target stack for the completed product vision:
- React
- Tailwind CSS
- TanStack Query
- Recharts
- Swagger / OpenAPI
- Automated tests
- GitHub Actions
- AWS
These technologies are planned and are not implemented in the current repository unless also listed in the current stack section above.
Current repository structure:
FitSupplyPro/
├─ apps/
│ ├─ api-gateway/
│ ├─ auth-service/
│ ├─ catalog-service/
│ ├─ inventory-service/
│ └─ order-service/
├─ docker/
│ └─ postgres/
├─ packages/
│ └─ shared/
├─ REST/
│ ├─ auth-service.http
│ ├─ catalog-service.http
│ └─ inventory-service.http
├─ docker-compose.yml
├─ package.json
└─ package-lock.json
- Node.js
- npm
- Docker
- Docker Compose
npm installThis is the most accurate way to run the current repository because the services are already wired through docker-compose.yml.
docker compose up --buildThis starts:
api-gatewayon port3000auth-servicecatalog-serviceinventory-serviceorder-servicepostgresshared-watcher
The repository uses npm workspaces, and each service exposes a dev script.
npm --prefix apps/api-gateway run dev
npm --prefix apps/auth-service run dev
npm --prefix apps/catalog-service run dev
npm --prefix apps/inventory-service run dev
npm --prefix apps/order-service run devShared package watcher:
npm --prefix packages/shared run watchnpm --prefix packages/shared run build
npm --prefix apps/auth-service run build
npm --prefix apps/catalog-service run build
npm --prefix apps/inventory-service run build
npm --prefix apps/order-service run build
npm --prefix apps/api-gateway run buildThe repository currently uses per-service .env files plus a Postgres env file under docker/postgres/.
PORTAUTH_SERVICE_URLCATALOG_SERVICE_URLINVENTORY_SERVICE_URLORDER_SERVICE_URLGATEWAY_SECRET
PORTDATABASE_URLNODE_ENVJWT_PRIVATE_KEY_BASE64JWT_PUBLIC_KEY_BASE64GATEWAY_SECRET
PORTDATABASE_URLGATEWAY_SECRET
PORTDATABASE_URLGATEWAY_SECRET
PORTDATABASE_URLGATEWAY_SECRET
POSTGRES_DBPOSTGRES_USERPOSTGRES_PASSWORD
Do not publish real secrets or reusable credentials in a public repository. For a portfolio-safe setup, prefer committed .env.example files and keep actual secrets local.
Only endpoints that are present in the current route files are listed below.
GET /healthPOST /auth/registerPOST /auth/loginGET /auth/mePOST /auth/refresh-tokenPOST /auth/logoutGET /auth/jwksGET /catalog/healthPOST /catalog/categoriesGET /catalog/categoriesGET /catalog/categories/:idPUT /catalog/categories/:idDELETE /catalog/categories/:idPOST /catalog/brandsGET /catalog/brandsGET /catalog/brands/:idPATCH /catalog/brands/:idDELETE /catalog/brands/:idPOST /catalog/productsGET /catalog/productsGET /catalog/products/:idPUT /catalog/products/:idDELETE /catalog/products/:idPATCH /catalog/products/:id/publishPATCH /catalog/products/:id/unpublishPOST /inventoryPOST /inventory/products/batchGET /inventory/products/:productIdPATCH /inventory/products/:productIdPOST /inventory/products/:productId/adjustGET /order/health
GET /healthGET /jwksGET /mePOST /registerPOST /loginPOST /refresh-tokenPOST /logout
GET /healthPOST /categoriesGET /categoriesGET /categories/:idPUT /categories/:idDELETE /categories/:idPOST /brandsGET /brandsGET /brands/:idPATCH /brands/:idDELETE /brands/:idPOST /productsGET /productsGET /products/:idPUT /products/:idDELETE /products/:idPATCH /products/:id/publishPATCH /products/:id/unpublish
GET /healthPOST /POST /products/batchGET /products/:productIdPATCH /products/:productIdPOST /products/:productId/adjust
GET /health
- Backend services are protected with an internal secret header check (
GATEWAY_SECRET) to reduce direct service access outside the gateway. - The gateway verifies JWT access tokens before forwarding protected requests.
- Refresh token lifecycle logic includes hashing, rotation, revocation, and cleanup behavior in the auth service.
- Rate limiting is enabled at the gateway level for auth and service routes.
Helmetis enabled in the gateway for basic HTTP hardening.
This is still a development-stage codebase, so security hardening should be considered in progress rather than complete.
- Backend-only repository at the moment
- No frontend application yet
- No cart or checkout flow yet
- No full order workflow yet
order-serviceis still at a very early stageinventory-serviceis only partially implemented- No dedicated fitness service yet
- No dedicated nutrition service yet
- No notifications or analytics services yet
- No automated test suite yet
- No CI/CD pipeline yet
- No Swagger / OpenAPI documentation yet
- No production deployment setup documented
- Expand
order-servicebeyond health checks into real order domain APIs - Continue inventory workflows and service integration
- Add clearer environment setup and
.env.examplefiles - Improve API documentation for local development
- Add automated tests for existing backend services
- Build the React frontend for customer and admin experiences
- Add cart, checkout, and complete order lifecycle features
- Introduce fitness calculators and macro planning workflows
- Add nutrition logging and progress tracking features
- Add notifications and analytics capabilities
- Add OpenAPI documentation, CI/CD, and production-ready infrastructure over time