How viniciussantos45/tik-tech works
Project type and purpose
• Tik Tech is a full-stack, Docker-containerized video-generation platform.
• It exposes a React/Vite/Tailwind-based frontend, an Express.js API/backend, and two specialized microservices (“image-generator” and “carbonara”) to generate video covers and code‐snippet visuals.
• It orchestrates calls to external services—OpenAI API (for content and narration prompts), AWS Polly (for text-to-speech), and FFmpeg (for final video assembly)—to produce tutorial videos.
File structure
• Top-level:
• Dockerfile + docker-compose.yml → multi-container orchestration: api, image-generator, carbonara.
• client/front-end → Vite + React + Shadcn/Tailwind UI + IndexedDB + Socket.io.
• src/ → Express.js server entrypoint (server.ts), socket integration (socket.ts), and a services folder (BuildVideo, GenerateAudio, GenerateCarbonCode, etc.).
• modules/image-generator-html → separate Node service using Puppeteer to snapshot HTML and CSS into images for video covers.
• Config & environment files (.env, .env.example) specify API keys, AWS Region, and results path.
• No traditional database—uses local file-system “results” folder and browser IndexedDB for caching.
Extracted architecture from README
• Services:
• POST /api/generate → triggers the full pipeline.
• GET /api/download/:id → fetches the final MP4 file.
• GET / → serves the frontend.
• Docker Compose brings up three containers, wiring ports and inter-container networking.
• Socket.io provides real-time status updates to the client during video generation.
Components & relationships
a. Main components:
1. Client/Web Browser with React UI
2. API Container (Express.js + Socket.io + service orchestration)
3. Image-Generator Container (Puppeteer HTML → PNG)
4. “Carbonara” Container (renders code snippets as images)
5. External Services:
– OpenAI API
– AWS Polly
– FFmpeg (installed in API container)
6. Storage: Local “results” folder (mounted volume)
b. Interactions & data flows:
– Client submits POST /api/generate → API
– API → (via HTTP/gRPC) → image-generator / carbonara services for visual assets
– API → OpenAI API to generate prompts, narration text, code examples
– API → AWS Polly to convert narration text to audio
– API → FFmpeg to stitch together cover image, code snippet images, narration audio into final MP4
– API writes MP4 to results/ and emits status via Socket.io back to client
– Client polls or listens to Socket.io events; when done, calls GET /api/download/:id
c. Architectural patterns & design principles:
– Microservices for specialized tasks (single-responsibility, container isolation)
– Event-driven status updates (Socket.io)
– External API orchestration (OpenAI, AWS Polly)
– Container orchestration (Docker Compose)
d. Key technologies & frameworks:
– Frontend: Vite, React, Shadcn UI, Tailwind CSS, IndexedDB, Socket.io-client
– Backend: Node.js, Express.js, Socket.io-server, TypeScript
– Microservices: Puppeteer (in image-generator), custom code-rendering (carbonara)
– Third-party: OpenAI API, AWS Polly, FFmpeg
– DevOps: Docker, Docker Compose