How samarth-mahajan/student_housing_project works
Project Type and Purpose
• This is a full-stack, property-listing web application managed as a monorepo (Turborepo).
• Frontend: a React TypeScript SPA that lets students, landlords, and moderators browse, list, chat about, and favorite properties.
• Backend: a Node.js service (Express + MikroORM) exposing REST endpoints for authentication, property CRUD, chat, media uploads, questionnaires, favorites, and insights.
• Shared code: TypeScript models and utilities in a packages/common workspace.
• Tests: Bruno API test scripts and Playwright E2E tests.
• Deployment: Azure VM running Ubuntu + Nginx, MySQL, Azure Blob Storage for media, SSL via Let’s Encrypt.
File-Structure Analysis
• apps/frontend: React app (TSX components under src/components, API client in src/api.ts).
• apps/backend: Node.js service using MikroORM (entities, migrations, seeders under src/db), routers, middlewares, blob-storage integration.
• packages/common: shared TypeScript interfaces and constants.
• bruno: API test definitions and environment configs.
• credentials: VM SSH keys and related files.
• Root config: turbo.json, workspace-level ESLint & TSConfig under packages/eslint-config and packages/typescript-config.
Key README Insights
• Turborepo to share configs & models.
• .env controls ports and blob-storage endpoint.
• Run with npm run dev (both apps) or per workspace.
• CI/CD hints: GitHub Actions docs, but no explicit .github folder shown in file tree (likely exists).
• DB migrations auto-run on startup; Azure VM + Nginx front-end.
Main Components
a. Frontend SPA (React)
b. Backend API Service (Node.js + Express + MikroORM)
c. MySQL Database
d. Azure Blob Storage (media files)
e. Nginx reverse proxy / static asset server
f. Shared code package (for dev context)
g. Testing tools: Bruno (API tests), Playwright (E2E)
h. Developer workstations with Turborepo (local dev)
i. Azure VM infrastructure (OS, SSL certs, VM network)
Relationships & Interactions
• Frontend ↔ Backend: HTTP/HTTPS calls (authenticate, fetch listings, post messages, file uploads).
• Backend ↔ MySQL: ORM queries & migrations.
• Backend ↔ Azure Blob Storage: media upload/download.
• Nginx ↔ Frontend: serves compiled static assets; Nginx ↔ Backend: reverse-proxy API routes to Node.js.
• Developer machine ↔ Turborepo: runs local dev commands; invokes both apps.
• Bruno & Playwright run HTTP tests against Nginx endpoint.
Architectural Patterns & Principles
• Monorepo with workspace isolation (apps vs packages).
• MVC-style division in backend: routers → controllers → entities → DB.
• Shared TypeScript models for type safety across tiers.
• Infrastructure decoupling: Blob storage abstracted in blob-storage.ts.
• Database versioning via MikroORM migrations/seeders.
Technologies & Frameworks
• React, React Router (frontend).
• Node.js, Express, MikroORM, MySQL (backend).
• Turborepo, TypeScript, ESLint, Tailwind CSS (dev infra).
• Azure VM, Nginx, Let’s Encrypt, Azure Blob Storage (deployment).
• Bruno, Playwright (testing).
Final Advice
• Both runtime deployment (production topology) and code organization (monorepo).
• Be detailed: break out subcomponents in backend (Routers, Middlewares, ORM) if needed.