2026 · Engineer + Owner
Portfolio, botlar va bir nechta frontend loyihalarga xizmat qiluvchi multi-tenant REST API. Prisma + PostgreSQL asosida, BullMQ bilan background workerlar, fail2ban + rate-limit bilan himoyalangan.
- Rol
- Engineer + Owner
- Yil
- 2026
- Stack
- TypeScript
- Node.js
- Express 5
- Prisma
- PostgreSQL
- BullMQ
- Redis
- Docker
- Havolalar
Qisqacha
Muammo
Har bir kichik loyiha uchun alohida backend qurish — xarajat va texnik qarz. Bir nechta mahsulot bir xil foydalanuvchi ma'lumotlari (Telegram auth, passport, manzil) bilan ishlaydi, lekin ularning har biri o'z API, o'z DB, o'z deploy pipeline'iga ega edi.
Yondashuv
Multi-tenant API — bitta Prisma schema, bitta deploy, bitta auth qatlami. Har loyiha uchun site_id scope orqali ma'lumotlar izolatsiya qilinadi.
Texnik prinsiplar:
- Xato turlari —
constants/errors.tsda markazlashtirilgan{ type, status, message }konstantalari. Har endpoint bir xil envelope qaytaradi. - Authentication — JWT access + refresh (ikki alohida secret), RBAC (rollar + permissionlar), audit log.
- Rate limit — Redis asosida,
GET/POST/DELETEuchun alohida limitlar. - Background workers — BullMQ bilan: currency fetch, notifikatsiya, cleanup, backup. Crash bo'lsa ham reque.
- Security —
helmet, CORS whitelist, fail2ban integration,BOT_SERVICE_TOKENorqali service-to-service auth.
Natija
- 15 ta folder / 120+ endpoint Postman collection
- 90% request 200/201 real yuklanishda
- 1.3s avg LCP dashboard frontend'da (ISR + stale-while-revalidate)
- 0 ta stack trace production log'larda (global error handler)
- CI pipeline — lint → typecheck → test (60 ta test yashil) → build → docker → deploy