You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This server is a Node.js backend built with Fastify and tRPC, providing a comprehensive API for managing users, companies, debtors, creditors, subscriptions, and task tracking. It uses PostgreSQL for data storage (via Drizzle ORM), Redis for caching and session management, and supports integration with external web services, email notifications, and SMS services.
Architecture
Entry Point:src/index.ts
Frameworks: Fastify, tRPC
Database: PostgreSQL (Drizzle ORM)
Cache/Session: Redis
Queue System: BullMQ for background job processing
API Structure: All endpoints are exposed under /trpc using tRPC routers.
Main Features
1. User Management
CRUD operations for users (create, read, update, delete, batch delete)
Password hashing with bcrypt
Role-based fields (role, email, etc.)
Pagination, sorting, and search for user lists
Redis caching for user lists
2. Company Management
CRUD operations for companies
Select and get selected company (session-based)
Pagination, sorting, and search for company lists
Redis caching for company lists
3. Debtor & Creditor Management
Fetch lists of debtors and creditors for a selected company and period
Integration with external web services (via HTTP POST, session-based authentication)
Error handling for web service responses
4. Subscription Management
CRUD operations for subscriptions (domain, SSL, hosting, mail)
Subscription customer management with contact preferences
Automated expiry notifications via email and SMS
Background job processing for subscription expiry reminders
5. Task Tracking
Customer management for subscription tracking
Subscription expiry monitoring with automated notifications
Email and SMS integration for customer communications
API Endpoints (tRPC Routers)
All endpoints are available under /trpc.
/trpc/user - User management
/trpc/company - Company management
/trpc/debtor - Debtor data (external integration)
/trpc/creditor - Creditor data (external integration)