How hammadahmad-codefied/kcwx-backend works
Project type and purpose
• This is a Node.js/Express‐based backend service implementing a RESTful API.
• Its domain is split into six functional areas: CDN management, global geofencing, live user tracking, streaming location updates, user login/authentication, and user profile management.
• There is no frontend in this repository; server.js boots an HTTP server, wiring up route definitions and controllers that implement each business domain.
File structure
• Top-level artifacts:
• server.js – entry point where Express is configured.
• database/connection.js – handles database connectivity.
• Controller/… – each subfolder groups one controller per domain.
• Routes/… – each subfolder defines the Express routes that delegate to the corresponding controller.
• Model/*.js – each file encapsulates data‐access logic for one domain (e.g. UserModel.js).
• Pattern: a classic layered MVC (routes → controllers → models → database).
• No “lib” or “services” folder; business logic lives in the controllers.
README
• It is empty, so all domain knowledge must be inferred from file names and directory names.
• We assume each Model uses a shared database connection (database/connection.js), and Controllers orchestrate request handling, validation, and calls to Models.
Final recommendations
• Use consistent naming that matches the file system for easy cross-reference