How aelassas/movinin works
Project Type & Purpose
• This is a monorepo for a full-stack, cross-platform Rental Property Management Platform (“Movin’ In”).
• It comprises:
• An Admin Web SPA (React/TypeScript + Vite) for agencies and admins to manage properties, customers, bookings, payments.
• A Customer Web SPA (React/TypeScript + Vite) for property search, booking, checkout.
• A Mobile App (React Native/Expo) for customers to search and book on iOS/Android.
• A RESTful Backend API (Node.js/Express + TypeScript) with controllers, models, middlewares, payment integration, i18n, notification system.
• Shared internal packages under /packages (helpers, types, social-login, currency converter).
• CI/CD scripts, Docker configurations and auxiliary services (__services, __scripts).
File Structure Analysis & Architectural Patterns
• Top-level folders:
• /backend – Express API with MVC-style controllers, routes, models, utilities, tests.
• /admin – Admin SPA.
• /frontend – Customer SPA.
• /mobile – React Native mobile client.
• /packages – Reusable libraries (monorepo pattern).
• docker-compose*.yml, Dockerfiles, CI workflows – containerized deployment.
• Patterns & concerns:
• Single backend application serving JSON REST endpoints.
• Three distinct client personas (admin web, customer web, mobile), each with its own build and deployment.
• Shared services/scripts for deployment, health checks, versioning.
• External integrations: Stripe, PayPal, IP info, email (SMTP), push notifications, Sentry.
Key Architectural Components
a. Clients
• Admin Web SPA
• Customer Web SPA
• Mobile App
b. Backend API
• Authentication & Authorization (JWT, social login)
• Controllers & Routes for Agencies, Properties, Bookings, Payments, Notifications, Locations, Users
• Middlewares (CORS, rate-limit, error handling, authJwt)
• Services layer (StripeService, PayPalService, NotificationService, etc.)
• Data Access via ORM/ODM (models under /models)
• Setup & monitoring (Sentry, instrumentation)
c. Data Stores & Cache
• Primary Database (e.g., PostgreSQL, MongoDB – as configured)
• TTL caches or Queues for scheduled notifications
d. External Services
• Stripe API, PayPal API
• Email SMTP service (via mailHelper)
• Geolocation/IP service
• Push Notification providers (FCM/APNs)
• Sentry (error tracking)
e. Infrastructure & Deployment
• Docker containers for each component
• Nginx reverse proxies (per __config/nginx.conf)
• docker-compose for dev/prod
• CI/CD pipelines (GitHub Actions in .github/workflows)
Relationships & Data Flow
1. Clients → Backend API: all client apps consume REST endpoints over HTTPS.
2. Backend API → Database: CRUD operations on Domain Entities (Agency, Property, Booking, User, etc.).
3. Backend API → External Payment Gateways (Stripe, PayPal) for checkout sessions & transactions.
4. Backend API → Email Service for user invites, notifications.
5. Backend API → Push Notification Providers for mobile notifications.
6. Backend API → IP info service for geolocation-based filtering.
7. Nginx acts as an ingress layer: routing to the correct service (admin, frontend, API).
8. CI/CD automates build/test/deploy of containers to target environment.
Architectural Patterns & Principles
• Separation of Concerns: distinct layers for controllers, services, data models.
• Shared code via monorepo packages to avoid duplication.
• API-First design: clients are thin; all business logic resides in backend services.
• Micro-frontend–like pattern: independent deployments of admin SPA, customer SPA, mobile.
• Containerized and infrastructure-as-code via Docker & docker-compose.
• Event-driven scheduling for auto-notifications.