designer-api¶
This is the documentation subtree for Someli-ai/designer-api, the Express backend for the internal Designer tool.
Component summary¶
| Component name | designer-api |
| Purpose | HTTP API + background workers for the internal Designer / Content Factory. Powers Someli-Designer (FE) and runs ~57 cron jobs that generate template content per industry. |
| Tech stack | Node.js 20 + Express 4 + MySQL (callback + mysql2/promise + sync-mysql) + Polotno-node + OpenAI + AWS SDK v2 |
| Routes | ~269 endpoints in routes/routes.js (one 13608-line file) |
| Background jobs | ~57 job_*.js files + 2 standalone bots (content_generation_bot.js, post_image_generation1_bot.js) + Slack notifier (teamsnotification.js) + AI bots (FAQsbot, quizbot, quotesbot, trendsbot) |
| Audit version | 0.1 |
| Last verified | 2026-05-17 |
Index¶
Architecture & code organisation¶
- Architecture Overview
- API Inventory
- Jobs Inventory
- Bots Inventory
- Configuration
- Dependencies Inventory
Behaviour & integration¶
- Authentication
- Code Overlap With Siblings
- Integration Inventory
- Notifications (Slack/Teams)
- Content & Template Pipeline
- Media Processing
Cross-cutting concerns¶
Operations¶
Strategy¶
Audit trail¶
At a glance¶
- Big route file:
routes/routes.jsis 13 608 lines — second-biggest in the platform aftersomeli-api's 22 000+ lines - 269 endpoints under one
apiRoutes.init()class method - 57 background workers in the repo root (
job_*.js), each runs anode-cronschedule viasync-mysql - Industry-specific jobs: the bulk of jobs (
job_auto_garge_*,job_disability_insurance,job_It_cyber_security,job_uae_estate, …) each target one industry's content-template generation. Strongly suggests a per-vertical content-factory model. - Two coexisting bot patterns: classic
job_*.jsfiles (cron + sync-mysql) and standalone AI bots (FAQsbot.js,quizbot.js,quotesbot.js,trendsbot.js,content_generation_bot.js,post_image_generation1_bot.js). - Teams/Slack notifier:
teamsnotification.jsuses theslackSDK with a hardcoded bot token to ping a channel when content is missing - DB driver fork drift:
modules/dbDriver/lib/mysql.jsdiffers fromsomeli-api/modules/dbDriver/lib/mysql.js— keep them aligned manually - No
helper.js(unlike sibling backends) — onlyhelper/index.js(88 lines). The helper layer is much thinner. - Has Dockerfile (multi-stage, optimised) + nginx.conf + push.sh (manual SSH deploy script)
- No Jenkinsfile / no GitHub Actions workflow
Newer commits (since 2025-02)¶
86f2438 dockerignore added
72b8f43 Merge branch 'main' …
0ed61e0 add config to live
b3587b8 new docker file has been added
18a83a1 Change media generation endpoint to insert job details into tJobs table
Active but slow-moving: ~5 commits over ~12 months at audit time. Most recent commit: 2026-02-20.