How auxomeness/homelane-backend works
Homelane is a standalone Express API for property listings and agent/buyer workspaces. Visitors browse published properties; buyers and staff authenticate to manage conversations, viewing requests, listings, or agent applications. The listing workflow is explicit in the sampled routes and controller: requests are role-gated, validated, handled by services, and persisted through repositories. Workspace and chat internals are represented at their source-directory level because their implementation excerpts were not provided; README-documented capabilities guide those branches.
Main entry points: app.ts Express API · database.ts Database pool · index.ts API routes · listings.admin.routes.ts Listing routes
Components 26
API and access
- Express API
src/app.ts - API routes
src/routes/index.ts - Authentication
src/services/auth.ts - Role checks
src/middleware/requireRole.ts - Auth rate limits
src/middleware/authRateLimit.ts
Listing lifecycle
- Listing routes
src/routes/listings.admin.routes.ts - Listing handlers
src/controllers/listings.controller.ts - Listing validation
src/validators/listings.validator.ts - Listing service
src/services/listings.service.ts - Listing repository
src/modules/listings/listings.repository.ts - Listing contracts
src/types/listings.types.ts
Buyer and agent workspaces
- Buyer workspace
src/controllers/buyerWorkspace.ts - Agent workspace
src/controllers/agentWorkspace.ts - Workspace services
src/services/workspace.ts - Chat events
src/services/chatEvents.ts
Staff and applications
- Dashboards
src/services/agent.dashboard.service.ts - Dashboard repositories
src/modules/dashboard/agent.dashboard.repository.ts - Agent applications
src/controllers/agents.controller.ts - Agent service
src/services/agents.service.ts - Agent repository
src/modules/agents/agents.repository.ts
Persistence and events
- Database pool
src/services/database.ts - PostgreSQL
Other components
- Visitor
- Buyer
- Agent
- Admin
Connections 28
- Visitor → Express API: browses listings
- Buyer → Express API: uses buyer APIs
- Agent → Express API: uses staff APIs
- Admin → Express API: uses admin APIs
- Express API → Auth rate limits: limits auth
src/app.ts - Express API → API routes: mounts routes
src/app.ts - API routes → Listing routes: mounts listing APIs
src/routes/index.ts - API routes → Agent applications: mounts application APIs
src/routes/index.ts - API routes → Buyer workspace: mounts buyer APIs
src/routes/index.ts - API routes → Agent workspace: mounts agent APIs
src/routes/index.ts - Listing routes → Role checks: checks role
src/routes/listings.admin.routes.ts - Listing routes → Listing handlers: dispatches handlers
src/routes/listings.admin.routes.ts - Listing handlers → Listing validation: validates input
src/controllers/listings.controller.ts - Listing handlers → Listing service: calls service
src/controllers/listings.controller.ts - Listing service → Listing repository: queries listings
src/services/listings.service.ts - Listing repository → Database pool: runs queries
src/modules/listings/listings.repository.ts - Database pool → PostgreSQL: reads and writes
- Buyer workspace → Workspace services: uses services
- Agent workspace → Workspace services: uses services
- Buyer workspace → Chat events: supports messaging
- Agent workspace → Chat events: supports messaging
- Workspace services → Database pool: persists workspace
- Dashboards → Dashboard repositories: loads metrics
src/services/agent.dashboard.service.ts - Dashboard repositories → Database pool: runs queries
src/modules/dashboard/agent.dashboard.repository.ts - Agent applications → Agent service: calls service
src/controllers/agents.controller.ts - Agent service → Agent repository: uses repository
src/services/agents.service.ts - Agent repository → Database pool: runs queries
src/modules/agents/agents.repository.ts - Authentication → Database pool: uses password workers