How ibalpinar/resumex works
Project type and purpose
• ResumeX is a Node.js-based REST API backend for an open-source resume platform. It exposes versioned endpoints (v1) for user/account management, authentication, resume CRUD, and lookups (countries, languages, skills, etc.). Data is persisted in MongoDB.
File structure
• Top-level: configuration files (config/dev.env), linter/formatter rules, package.json.
• src/index.js: entry-point.
• src/routes/v1: Express routers & JSON schema validators (OpenAPI-style).
• src/decorators: middleware wrappers for authentication & account checks.
• src/handlers: controllers implementing each REST operation.
• src/models: Mongoose schemas/entities.
• src/utils: cross-cutting utilities (errors, constants, password manager, initial data loader, response helpers).
• misc/postman-collection: sample API collection for testing.
a. Client layer
• REST client (frontend app or tool like Postman).
b. API Gateway / HTTP Server
• Express.js instance (index.js)
• Global middleware (logging, JSON parser).
c. Routing Layer
• Versioned routers (common.js, v1/*.js)
• JSON-schema validation per-route.
d. Decorator/Middleware Layer
• AuthenticationDecorator (JWT/session check)
• AccountDecorator (role/permission checks)
e. Controller Layer
• accountController, authenticationController, userController, resumeController, lookupController
f. Service & Utility Layer
• Business logic in controller or delegated to utils (e.g., passwordManager, responseHelpers, insertInitialData).
g. Data Access Layer
• Mongoose models (models/*.js) mapping to MongoDB collections.
h. Database
• MongoDB (hosted locally or cloud)
i. External Services (future/optional)
• Email/SMS provider for password reset, analytics, or storage service for resume assets.
Relationships & data flow
Client → HTTP Server → Router → [Validation] → Decorators → Controller → Data Access → MongoDB
Controller → Utility modules → (optionally) External Services
Architectural patterns & design principles
• Layered (Presentation → Routing → Middleware/Decorators → Controllers → Models)
• Separation of concerns: validation, auth, business logic, data persistence
• Versioning: routes separated by API version.
• OpenAPI-style contract: JSON schemas for request/response.