How noahskorner/google-docs-clone works
Project Type and Purpose
• This is a full-stack “Google Docs Clone” web application.
• Frontend: React + TypeScript + TailwindCSS.
• Backend: ExpressJS + Sequelize (Postgres) + Socket.IO.
• Purpose: real-time collaborative document editing with user authentication, sharing, and email verification.
File Structure Overview
a. Top-Level Directories
• client/ → React frontend
• server/ → Express backend
b. Frontend Highlights
• public/ → static HTML, manifest, robots.txt
• src/
• assets/css → Tailwind + custom styles
• components → Atom/Molecule/Organism hierarchy (UI)
• contexts & hooks → global state (auth, document, toast)
• pages → routing (login, register, document editor)
• services → API wrappers (auth, document, user)
c. Backend Highlights
• src/app.ts & src/server.ts → Express app initialization
• src/config → DB, environment, SMTP setup
• src/controllers → HTTP route handlers (auth, document, share, user)
• src/routes → route definitions
• src/middleware → auth guard, error handling
• src/services → business logic (user, document, mail)
• src/db/models → Sequelize models (User, Document, DocumentUser, RefreshToken, Role, etc.)
• Socket.IO integration likely in app.ts or server.ts
• seeders for initial DB data
README Insights
• Technologies: React, TypeScript, Tailwind, Express, Postgres, Socket.IO.
• Features: Auth (register/login/verify), document CRUD, real-time collaboration, toasts.
• API docs link: shows REST endpoints.
• Deployment: client on port 3000, server on 3001.
• Reflection: emphasis on Context API, custom hooks, service refactoring.
a. Main Components
1. Browser / React App
2. API Server (Express + Socket.IO)
3. Database (Postgres via Sequelize)
4. External SMTP Service (email verification)
b. Relationships & Data Flow
• React app → REST API (HTTP) for auth, document CRUD
• React app ↔ WebSocket (Socket.IO) for real-time edits
• API Server → Database (CRUD + join tables for sharing)
• API Server → SMTP service for email sending
c. Architectural Patterns & Principles
• Client-Server separation (SPA + REST + WebSockets)
• MVC-style on backend: controllers → services → models
• Database-backed role/permission system
• React Context + Hooks for state management
• Atomic design for UI components
d. Key Technologies & Frameworks
• Frontend: React, TypeScript, TailwindCSS, Socket.IO-client
• Backend: ExpressJS, Sequelize ORM, Socket.IO, Jest for tests
• Database: Postgres
• CI/Deployment hints: Procfile (Heroku), .env for configs