How devanshkat/purrlicious-boba works
Project type and purpose
• This is a full-stack, monorepo web application built with Next.js (frontend) and a small Node.js service (backend).
• The user-facing side (“purrlicious-boba”) is a marketing/site hub for a boba business with pages (About, Boba menu, Contact, Newsletter signup, Unsubscribe).
• It supports in-browser navigation/rendering via React/Next.js App Router and exposes serverless API routes for calendar lookups, contact form submissions, newsletter signups, and unsubscribes.
• A standalone Node.js “backend” (server.js + UserEmails.js) is responsible for persisting or dispatching emails (e.g. send welcome newsletters, handle unsubscribes).
File-structure analysis
– Top-level:
• backend/ — a Node.js service (server.js, UserEmails.js, npm manifest)
• frontend/ — a Next.js 13 “app” directory, React components, CSS, public assets, Tailwind config, TypeScript models, serverless API routes under app/api
– Patterns: Monorepo; frontend implements server-rendered React plus API routes (App Router conventions); backend is a small Express-style or plain‐HTTP microservice.
– No external database directory—likely file- or in-memory storage in UserEmails.js or integration with an email service provider.
README insights
– Frontend is started via npm run dev in frontend/ and listens on localhost:3000.
– No direct instructions for the backend—presumably it’s launched separately (e.g. node backend/server.js) or via Docker.
Main components
a. User’s Browser (Client)
• React/Next.js SPA pages & client scripts
• CSS/Tailwind, static assets (public/Images)
b. Next.js Frontend Server
• SSR/SSG for pages under app/
• Serverless API Routes (calendar, contact, email, unsubscribe)
c. Node.js Backend Service
• server.js HTTP endpoints
• UserEmails.js module (storage/dispatch logic)
d. External Services (optional)
• SMTP provider or third-party email API (e.g. SendGrid)
• Calendar API (if calendar route proxies to an external calendar service)
Relationships & interactions
1. Browser → Next.js Frontend (HTTP GET/SSR/SSG for pages)
2. Browser → Next.js API Routes (HTTP POST/GET for contact, newsletter, unsubscribe, calendar)
3. Next.js API handler → Node.js Backend (HTTP calls, e.g. POST /send-email)
4. Node.js Backend → External Email Service (SMTP/API)
5. If calendar route uses third-party, Next.js API → External Calendar API
Architectural patterns & design principles
• Separation of concerns:
• UI & navigation (React)
• Backend logic & persistence (Node.js service)
• Serverless functions for thin API layer (Next.js App Router)
• Monorepo for shared code (e.g. models in frontend/models)
• Component-based UI (React/TSX)
• Tailwind CSS for styling
Technologies & frameworks
• Frontend: Next.js 13 App Router, React, TypeScript, Tailwind CSS, PostCSS
• Backend: Node.js (server.js), possibly Express or native HTTP, nodemailer or similar
• Build & config: npm, package.json, tsconfig.json, next.config.mjs