How ajay9177/medium works
Project Type and Purpose
• Full-stack, blog-publishing web application (“Write and Share”)
• Monorepo with three packages:
– frontend: React + Vite SPA deployed on Vercel
– backend: TypeScript Cloudflare Worker (Wrangler) exposing blog/user REST API
– common: shared TypeScript library (data types, helpers)
File Structure
• Top-level directories:
– offline/frontend → UI, routes, components, Tailwind, Vercel config
– offline/backend → API entrypoint, routes, Prisma schema/migrations, wrangler.toml
– offline/common → shared src → dist → published as local npm dependency
• Patterns & tools:
– Monorepo/npm workspaces or local package references
– RESTful routing: /blog, /user
– Serverless deployment: Wrangler/Cloudflare Workers
– ORM: Prisma with migration folders
– Frontend build: Vite, Tailwind CSS
README
• Confirms web-app use-case and audience
Main Components & Their Relationships
a. Client (Browser)
– Loads React SPA (hosted on Vercel)
– Calls backend APIs over HTTPS
b. Frontend (Vercel)
– Serves static assets (index.html, JS bundles)
– Contains UI pages: Signup, Signin, Blogs, Blog, Publish
c. Backend (Cloudflare Worker)
– Exposes REST endpoints via index.ts → routes/{blog,user}.ts
– Uses Prisma client to talk to the database
d. Database
– Managed by Prisma (could be PostgreSQL, SQLite, or Cloudflare D1)
– Schema defined in prisma/schema.prisma; migrations folder tracks versions
e. Common Library
– Provides shared TypeScript types and utilities
– Imported by both frontend and backend
f. External Services
– Vercel (frontend hosting)
– Cloudflare Workers (serverless functions)
– CDN/SSL in front
Architectural Patterns & Design Principles
• Mono-repo with clear package separation (frontend / backend / shared)
• API-first, RESTful routing
• Serverless functions for backend (scale-to-zero, low ops)
• ORM layer (Prisma) enforcing schema & migrations
• Shared common-library for DRY types/logic
Inclusion Checklist
• Annotation of shared “common” module usage
– Captures the monorepo’s three-package structure
– Clearly shows client-to-API-to-DB flow
– Differentiates build-time vs. runtime dependencies
– Highlights cloud hosting platforms and technologies in use
– Is easy for architects and developers alike to understand at a glance