{"id":18952747,"url":"https://github.com/m7moudgadallah/express-skeleton","last_synced_at":"2026-04-12T11:32:27.770Z","repository":{"id":196374565,"uuid":"695975750","full_name":"m7moudGadallah/express-skeleton","owner":"m7moudGadallah","description":"This is a repository that provides a project skeleton for Node.js applications built with the Express.js framework. It includes a predefined set of middleware and error handling configurations, making it easier to start developing your web applications. ","archived":false,"fork":false,"pushed_at":"2023-10-05T23:16:49.000Z","size":404,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-01T02:41:45.239Z","etag":null,"topics":["custom-error-handling","expressjs","jest","nodejs","project-skeleton","unit-testing"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/m7moudGadallah.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-24T19:16:32.000Z","updated_at":"2023-09-25T21:19:30.000Z","dependencies_parsed_at":"2023-09-24T22:17:05.369Z","dependency_job_id":"23ba63ae-2271-442f-979e-d63265ebd3c9","html_url":"https://github.com/m7moudGadallah/express-skeleton","commit_stats":null,"previous_names":["m7moudgadallah/express-skeleton"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m7moudGadallah%2Fexpress-skeleton","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m7moudGadallah%2Fexpress-skeleton/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m7moudGadallah%2Fexpress-skeleton/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m7moudGadallah%2Fexpress-skeleton/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/m7moudGadallah","download_url":"https://codeload.github.com/m7moudGadallah/express-skeleton/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239952598,"owners_count":19723922,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["custom-error-handling","expressjs","jest","nodejs","project-skeleton","unit-testing"],"created_at":"2024-11-08T13:34:30.119Z","updated_at":"2026-03-29T13:30:19.308Z","avatar_url":"https://github.com/m7moudGadallah.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# express-skeleton\n\n## Table of Content\n\n\u003c!-- TOC --\u003e\n\n- [express-skeleton](#express-skeleton)\n  - [Table of Content](#table-of-content)\n  - [Introduction](#introduction)\n  - [Directory Structure](#directory-structure)\n  - [Prerequisites](#prerequisites)\n  - [Getting Started](#getting-started)\n  - [Usage](#usage)\n  - [Contributing](#contributing)\n  - [License](#license)\n  - [Contact](#contact)\n\n\u003c!-- /TOC --\u003e\n\n## Introduction\n\nThis is a project skeleton for building Node.js applications with the Express.js framework. It provides a well-organized structure, predefined middleware, and error handling configurations to jumpstart your web development projects.\n\n## Directory Structure\n\n- `src`: The main source directory containing the core application code.\n\n  - `app.js`: The main application file.\n  - `config`: Configuration files for the application.\n  - `middlewares`: Middleware functions used in the application.\n    - `preMiddlewares.js`: Pre-route middlewares, including sanitizers, loggers, security middlewares, body parsing, etc.\n    - `postMiddlewares.js`: Post-route middlewares, including error handling middlewares.\n    - `customMiddlewares`: Custom middlewares created by developers, such as authorization middlewares.\n  - `public`: Directory for static and media files, like images.\n  - `resources`: Resource-specific directories, each containing:\n    - `resource_name.controller.js`: Controller logic for the resource.\n    - `resource_name.service.js`: Service layer for the resource.\n    - `resource_name.routes.js`: Routes configuration for the resource.\n  - `routes`: Main route files, organizing resources under their respective versions (e.g., `v1`, `v2`, etc.).\n  - `utils`: Utility modules for the application.\n    - `APIFeatures.js`: Module for parsing and transforming query strings, handling filtration, selection, sorting, and pagination.\n    - `AppError.js`: Module for creating custom error classes.\n    - `catchAsync.js`: Utility for handling asynchronous functions.\n    - `JsonResponse.js`: Module for structuring JSON responses consistently.\n\n- `config`: Configuration files.\n\n  - `Database.js`: A class for managing database connections and exposing functions to connect and disconnect using the singleton design pattern.\n  - `index.js`: Reads environment variables from `.env` and instantiates the Database class.\n\n- `.env`: Contains environment variables used by the application.\n\n- `test`: Directory for testing files (not yet implemented in this skeleton).\n\n**[\u0026uarr; Top](#express-skeleton)**\n\n## Prerequisites\n\n- Node.js and npm installed.\n\n**[\u0026uarr; Top](#express-skeleton)**\n\n## Getting Started\n\n1. Clone this repository.\n2. Install dependencies with `npm install`.\n3. Set environment variables in the `.env` file.\n4. Start the server:\n\n   - **Development Mode:** Run `npm run start:dev` to start the server with nodemon for automatic reloading during development.\n   - **Production Mode:** Run `npm run start:prod` to start the server in production mode.\n\n**Testing:**\n\n- Run tests using Jest:\n  - `npm test`: Run tests in the testing environment.\n  - `npm run test:coverage`: Run tests with code coverage report.\n\n**[\u0026uarr; Top](#express-skeleton)**\n\n## Usage\n\n- Define your routes, controllers, and services in the `resources` directory.\n- Customize middleware in the `middlewares/customMiddlewares` directory.\n- Configure database connections in `config/Database.js`.\n- Implement custom error handling in `middlewares/errorHandlers/dberrorcustomizer`.\n\n## Contributing\n\nContributions are welcome!\n\n**Here is a list of contributors:**\n\n- Mahmoud Gadallah ([Github](https://github.com/m7moudGadallah) | [Linkdin](https://www.linkedin.com/in/m7moudgadallah/))\n- Marwan Radwan ([Github](https://github.com/MarwanRadwan7) | [Linkdin](https://www.linkedin.com/in/marwan-radwan))\n- Mohamed AboElnasr ([Github](https://github.com/MohamedAboElnaser) | [Linkdin](https://www.linkedin.com/in/mohamed-aboelnasr-473b9a1b1/))\n\n## License\n\nThis project is licensed under the [LICENSE](LICENSE).\n\n## Contact\n\nFor questions or support, please contact [Mahmoud Gadallah](https://www.linkedin.com/in/m7moudgadallah/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm7moudgadallah%2Fexpress-skeleton","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fm7moudgadallah%2Fexpress-skeleton","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm7moudgadallah%2Fexpress-skeleton/lists"}