A TypeScript backend platform for loyalty operations, gift cards, coupons, and invoicing-related workflows.
This service provides:
- private and public HTTP endpoints via the internal routing framework,
- MongoDB-based data access through a centralized driver layer,
- scheduled jobs for birthday-based coupon distribution,
- email delivery with HTML/PDF templates for loyalty and gift-card communications.
- Node.js + TypeScript
- MongoDB
- HyperExpress
- Fastest Validator
- Nodemailer
- html-pdf-node
handlers/: route handlers (public and private)middlewares/: request validation and pre-handler checksdrivers/: MongoDB connection and domain logicutils/: reusable helpers, validators, templates, and mail utilitiescron/: scheduled background jobsserver/: server bootstrap and route generation artifacts
- Node.js 18+
- MongoDB instance
- Environment file at
./.env
- Install dependencies:
npm install
- Configure environment variables in
.env. - Start the application using your preferred TypeScript runtime (for example):
npx ts-node-dev app.ts
At startup, the application:
- loads environment variables,
- connects to MongoDB and exposes drivers in
globalThis.metadriver, - initializes server routes,
- starts cron jobs,
- writes generated routes to
server/routes.json, - listens on
PORT(default:5000).
This repository uses professional English terminology for:
- user-facing validation messages,
- comments and logs,
- local variable names and internal symbols.
Backward compatibility aliases are preserved where legacy field names may still exist in stored data.
- Do not modify internal framework files under
_framework/unless framework-level changes are explicitly required.