Enterprise-Ready AI MVP Upgrade + Admin Analytics Dashboard (AI + RAG + Voice)

Заказчик: AI | Опубликовано: 19.11.2025

Enterprise-Level Code Hardening Fix small bugs Any typos, wrong return objects, unused variables Model ID corrections (e.g., Anthropic model naming) Cleanup error messages Enforce safe configuration No default secrets in production App must fail fast if JWT, Mongo URI, API keys are missing Validate .env properly Security Enhancements Add helmet Add strict CORS rules Add rate limiting on: Login Chat/LLM requests File uploads Validate file upload size and MIME type Error & Logging Improvements Replace console.log with Pino or Winston logging Add unique requestId for tracking Add standardized error format Add a /health endpoint Testing Foundation + CI/CD Backend Tests (Jest + Supertest) At least 3–5 tests: Login Create Study Session Chat endpoint Quiz generator endpoint ✔️ Frontend Tests (optional but prefered) Zustand store test (loadUser) Basic rendering CI/CD (GitHub Actions) Install Lint Run tests Build backend + frontend CI must fail if tests fail. Admin Analytics Dashboard (Internal Only) Create a new admin page: /admin/dashboard (admin role only) Dashboard shows: A. API Usage & Daily Cost Tracking Track usage of: Claude (chat) OpenAI Embeddings Deepgram (STT) Lemonfox / TTS For each provider: | Date | Requests | Tokens/Minutes | Estimated Cost | Developer must: Add tracking hooks in backend wherever API calls happen Store metrics daily in MongoDB Display on dashboard as: Table view (daily cost) Line chart (cost over time) B. User Signups (Daily) Track: | Date | New Free Users | Show a simple line chart + daily table. C. Paid Subscribers (Daily + Total) Show: Daily: | Date | New Paid Users | Total Paid Active | Monthly (MRR): | Plan | Active Users | Monthly Revenue | If payments use Stripe (or similar), read from DB. Charts + summary cards: Total paid subscribers Total revenue this month (MRR) Daily new paid users D. Business KPIs Section Show as tiles: Total Users Total Paid Users Monthly Recurring Revenue (MRR) API Cost Yesterday Profit Yesterday (Revenue – API Cost) Documentation & Cleanup Provide: ARCHITECTURE.md (Auth → Upload → Chunk → Embeddings → Retrieval → Chat → Quiz flow) DEPLOYMENT.md (Required env vars, build commands, recommended production settings) Notes on security improvements you made. Tech Stack (already built) Backend Node.js (Express) MongoDB/Mongoose JWT + Google OAuth Anthropic Claude OpenAI embeddings Deepgram STT Lemonfox TTS RAG pipeline Frontend React + TypeScript Vite Tailwind + Radix UI Zustand Axios API layer Who I’m Looking For Strong Node.js + express experience Very comfortable with security practices Knows testing + CI Can understand existing RAG architecture Clean code & documentation style