How darshan98solanki/priti-s-cake works
Project type and purpose
• This is a full-stack, monorepo-style web application called “Priti-s-Cake” with two React UIs (a public storefront “frontend” and an admin portal “admin”), a shared “common” library, and an Express/TypeScript “backend” serving a REST API. Its use case is an online cake gallery/store with admin upload/update capabilities.
File structure
• Top-level folders:
• admin – React + Vite admin portal (login, upload/update cakes)
• frontend – React + Vite public website (gallery, products, about, services)
• backend – Node/Express API with Prisma ORM, JWT auth, Cloudinary image uploads
• common – shared TypeScript code (types, utilities) consumed by both frontends (and potentially backend)
• Configs: Vite, ESLint, tsconfig for each package; vercel.json in admin/backend; netlify.toml in frontend; prisma/schema.prisma in backend/prisma.
README
• Minimal; project name only. All architecture clues come from folder names, package.json dependencies and code.
Main components and their interactions
a. Frontend (Customer UI)
• Hosted on Netlify
• React components/pages → calls REST endpoints on backend (/cakes, /gallery, /products)
b. Admin portal
• Hosted on Vercel
• React components/pages → login/auth via JWT → calls protected backend routes (upload/update cake)
c. Backend API
• Express app (index.ts) with middleware (auth, error handlers)
• Prisma ORM → connects to relational database (Postgres/MySQL)
• Multer-Cloudinary storage for image uploads → Cloudinary external service
• Issues/validates JWTs for admin sessions
d. Database
• Prisma schema defines Cake, User, etc.
• Actual database hosted separately (cloud provider)
e. External services
• Cloudinary for image hosting
• JWT identity provider (self-hosted via backend)
Architectural patterns and design principles
• Monorepo with clear separation of concerns
• Shared code in “common” package (DRY)
• REST API layer in backend (Controller → Service → ORM)
• JWT-based stateless auth
• Client-side routing and state in React UIs
• Infrastructure as code via Vercel/Netlify configs
Detail level
• Every distinct module (common library, middleware layer, Prisma, Multer-Cloudinary)
• Do not over-aggregate: show auth middleware, image upload pipeline, shared types as separate sub-components if space allows
• Be precise about protocols (HTTPS, Webhooks if any) and ports (443)