How abhinab-choudhury/shortwave works
Project type and purpose
• This is a full-stack URL-shortening and analytics dashboard called ShortWave.
• Frontend: React (Vite) SPA providing a dashboard (links, click stats, QR codes, settings, auth) using Tailwind + shadcn UI.
• Backend: Node.js/TypeScript Express app exposing REST endpoints (shorten, redirect, analytics, user management) with layered controllers→services→models, OAuth (Passport.js), rate limiting, error handling.
• Data stores: MongoDB (Prisma or Mongoose schemas in apps/server/src/database/models) and Redis (for caching, JWT blacklisting or rate-limiting).
• External integrations: OAuth providers (Google, GitHub, Facebook), Firebase Messaging, Stripe payments, e-mail service.
File structure
• Top-level “apps”:
• apps/client → React SPA with src/pages, src/components (layout & UI libs), src/hooks & providers for theme, auth, sidebar.
• apps/server → Express API:
– routes → user, auth, url, campaign, redirect, etc.
– controllers → one per domain, thin layer for request/response.
– services → business logic, called by controllers.
– database → db-connect, Prisma/Mongoose models, redis-connect.
– middlewares → auth checks, rate-limiter, error handler.
– strategies → Passport OAuth strategies.
– utils → error/response helpers, email, UA parsing, secrets.
– views → ejs templates (for server-side render if any).
• docker-compose.yml brings up client, server, MongoDB, Redis; each app has Dockerfile & .env.example.
README for additional insights
• Confirms stack details (React, Prisma/MongoDB, Passport OAuth, Tailwind, shadcn UI, Firebase Messaging, Stripe).
• Outlines feature ideas: custom link pages, QR code generation, detailed analytics (CTR, device breakdown, geo, engagement).
• Emphasizes SaaS-style dashboard, light/dark theme, cookie banner, AI features.
Detail without overthinking
• Decompose the backend into internal layers (controllers vs. services vs. models) only if the audience needs that depth. Otherwise group them into one “Backend API Service” node.
• Every piece that’s critical to your use cases: short-URL generation, QR code, auth flow, analytics tracking, notification dispatch.