How saksham-goel1107/dionysus works
Project Type and Purpose
• Dionysus is a full-stack, enterprise-grade SaaS platform for GitHub analytics and team collaboration.
• It uses Next.js 14 (App Router), React (server + client components), a PostgreSQL database via Prisma, tRPC for type-safe RPC, and integrates AI (Google Gemini Pro, Assembly AI), auth (Clerk), payments (Stripe), media storage (Cloudinary), workflow automation (n8n), monitoring (Sentry & Arcjet), and CI/CD (GitHub Actions & Husky).
High-Level File-Structure Analysis
• Top-Level:
• prisma/ — database schema & migrations
• public/ — static assets (licenses, logos, media)
• src/app/ — Next.js App-Router routes, split into (protected) routes, admin, public pages, API under app/api
• src/components/ — shared UI and feature components (Shadcn UI, feedback, logo-generator, etc.)
• src/lib/ — core business logic (AI clients, GitHub loaders, Stripe, Cloudinary, email, rate-limit)
• src/server/ — server-side logic (database connection, tRPC routers)
• src/trpc/ — tRPC client & server glue
• src/hooks/, src/utils/, src/middleware.ts — support layers
• Config & Automation: Dockerfile, .github/workflows, Husky hooks, lint/prettier configs, environment encryption.
Architecture Insights from README
• Presentation Layer: Next.js SSR/SSG + React server/client components + TailwindCSS + shadcn/ui
• API Layer:
• Next.js API routes under src/app/api/ for REST endpoints
• tRPC server under src/trpc/server.ts routed via /api/trpc
• Business Logic: src/lib and src/server/api, implementing AI interaction, GitHub ingestion, billing, meetings, surveys.
• Data Layer: PostgreSQL (Prisma ORM), Redis (for rate-limiting), Cloudinary for media.
• External Services: Clerk (auth), Stripe (payments), Google Gemini & Assembly AI (AI features), n8n (workflow automation), Sentry & Arcjet (monitoring/security).
• Deployment & Infrastructure: Vercel Edge (serverless functions), multi-region DB failover, CDN caching.
a. Main Components (group by layer)
• Presentation Layer (Client browsers, mobile):
• Next.js pages & UI
• React Server Components
• Edge & CDN:
• Vercel Edge Network (caching static assets, SSR)
• Application Layer:
• Next.js serverless functions:
– REST API routes
– tRPC endpoints
• Middleware (rate-limit, logging, authentication guard)
• Business Logic Services:
• AI Service connectors (Gemini Pro, Assembly AI)
• GitHub API integration
• Billing & Payments service (Stripe + webhook handlers)
• Media & CDN (Cloudinary)
• Workflow Automation (n8n integration)
• Data Layer:
• PostgreSQL (Prisma)
• Redis (rate-limiting, session caching)
• External Integrations:
• Clerk (Auth & User Metadata)
• Sentry (Error Tracking)
• Arcjet (Security & Rate-limiting)
• n8n (Newsletter & workflow automation)
• GitHub (repository data)
b. Relationships & Data Flows
• Client → Vercel Edge (static files, SSR) → Next.js serverless →
• tRPC / REST endpoints → Business Logic → DB / Redis
• Business Logic → External AI & services → respond back
• Stripe webhooks → Next.js API → Business Logic → DB
• GitHub webhooks / OAuth flows → API → Business Logic
• n8n (external) ↔ Newsletter endpoints
• Monitoring: all layers send metrics/logs to Sentry & Arcjet
c. Architectural Patterns & Principles
• Layered architecture: presentation, API, business logic, data
• API-first, type-safe contracts (tRPC + TypeScript)
• Serverless microservices (function-per-route)
• Modular feature folders under src/app and src/lib
• Secure by design: middleware guards, rate-limiting, audit logging
d. Key Technologies & Frameworks
• Next.js (App Router), React 18, TailwindCSS, shadcn/ui
• tRPC, Prisma, PostgreSQL, Redis
• Clerk, Stripe, Cloudinary, n8n, Gemini Pro AI, Assembly AI
• Vercel Edge, GitHub Actions, Husky, Sentry, Arcjet
Final Recommendations
• Be exhaustive: capture each domain (chat, billing, meetings, admin, ai-chat, etc.)
• Critical non-functional aspects: rate-limiting, caching, monitoring
• Iterate with the team in a collaborative tool (e.g., the existing Eraser workspace)