{"id":18247827,"url":"https://github.com/npm-packages-collection/generic-nodejs-express-api","last_synced_at":"2025-09-03T07:41:08.103Z","repository":{"id":252989009,"uuid":"841608625","full_name":"npm-packages-collection/generic-nodejs-express-api","owner":"npm-packages-collection","description":"Boilerplate project that provides a basic setup for building RESTful APIs using Node.js and Express. It includes several utilities and configurations to help you get started quickly. Additionally, this project runs both a frontend and an API server.","archived":false,"fork":false,"pushed_at":"2024-09-29T02:02:22.000Z","size":353,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-24T19:28:39.686Z","etag":null,"topics":["api","boilerplate","express","nodejs","npm","server"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/generic-nodejs-express-api","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc-by-sa-4.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/npm-packages-collection.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","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,"zenodo":null},"funding":{"github":["npm-packages-collection","32teeth"],"buy_me_a_coffee":"32teeth"}},"created_at":"2024-08-12T18:44:33.000Z","updated_at":"2025-01-30T22:56:52.000Z","dependencies_parsed_at":"2024-08-13T21:23:19.997Z","dependency_job_id":"ae4cc193-f2d7-4289-8a2a-5800a7cf93f2","html_url":"https://github.com/npm-packages-collection/generic-nodejs-express-api","commit_stats":null,"previous_names":["32teeth/generic-nodejs-express-api","npm-packages-collection/generic-nodejs-express-api"],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/npm-packages-collection/generic-nodejs-express-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npm-packages-collection%2Fgeneric-nodejs-express-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npm-packages-collection%2Fgeneric-nodejs-express-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npm-packages-collection%2Fgeneric-nodejs-express-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npm-packages-collection%2Fgeneric-nodejs-express-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/npm-packages-collection","download_url":"https://codeload.github.com/npm-packages-collection/generic-nodejs-express-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npm-packages-collection%2Fgeneric-nodejs-express-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273410261,"owners_count":25100450,"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","status":"online","status_checked_at":"2025-09-03T02:00:09.631Z","response_time":76,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["api","boilerplate","express","nodejs","npm","server"],"created_at":"2024-11-05T09:33:53.032Z","updated_at":"2025-09-03T07:41:08.069Z","avatar_url":"https://github.com/npm-packages-collection.png","language":"JavaScript","funding_links":["https://github.com/sponsors/npm-packages-collection","https://github.com/sponsors/32teeth","https://buymeacoffee.com/32teeth"],"categories":[],"sub_categories":[],"readme":"# Generic Node.js Express API\n\nWelcome to the Generic Node.js Express API repository! This repository contains the code and documentation for a generic Express API built using Node.js, as well as a frontend server.\n\n### Quick Start\n\n\u003e [!TIP]\n\u003e Create a project from scratch\n```\nnpx generic-nodejs-express-api my-awesome-api-project\n```\n\n\u003e [!TIP]\n\u003e Add it to an existing project\n```\nnpm i generic-nodejs-express-api\n```\n\n## Table of Contents\n\n- [Introduction](#introduction)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Development](#development)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Introduction\n\nThe Generic Node.js Express API is a template project that provides a basic setup for building RESTful APIs using Node.js and Express. It includes several utilities and configurations to help you get started quickly. Additionally, this project runs both a frontend and an API server. The frontend is accessible at `localhost`, and the API is available at `api.localhost`.\n\n| Front End | API |\n|--|--|\n| ![frontend](https://github.com/user-attachments/assets/f55ce564-22a2-48f3-b44f-ff4aff5b4edf)| ![api](https://github.com/user-attachments/assets/2e96d3ff-8e9d-48b6-be19-4486fd757643)|\n| localhost | api.localhost |\n| [dmeo frontend](https://generic-nodejs-express-api-442d639bd451.herokuapp.com/) | [demo api](https://api.generic-nodejs-express-api-442d639bd451.herokuapp.com) |\n\n## Installation\n\n### NPX\n\u003e RUn it as an NPX\n\n  ```bash\n  npx generic-nodejs-express-api my-awesome-api-project\n  ```\n\nTo set up the Generic Node.js Express API, follow these steps:\n\n1. Clone this repository to your local machine:\n   ```bash\n   git clone git@github.com:npm-packages-collection/generic-nodejs-express-api.git\n   ```\n2. Navigate into the project directory:\n   ```bash\n   cd generic-nodejs-express-api\n   ```\n3. Install the required dependencies:\n   ```bash\n   npm install\n   ```\n4. (Optional) Set up HTTPS certificates:\n   ```bash\n   sudo npm run certs\n   ```\n\n## Usage\n\nTo start the API server, use one of the following commands depending on your environment:\n\n- **Development:**\n  ```bash\n  npm run dev\n  ```\n\n- **Production:**\n  ```bash\n  npm run start\n  ```\n\nYou can also run the server with HTTPS enabled:\n\n- **Development with HTTPS:**\n  ```bash\n  npm run dev:https\n  ```\n\n- **Production with HTTPS:**\n  ```bash\n  npm run prod:https\n  ```\n\n## Development\n\n### Scripts\n\n- **Reset dependencies:**\n  ```bash\n  npm run reset\n  ```\n  This command removes `node_modules` and `package-lock.json` and reinstalls dependencies.\n\n- **Generate certificates:**\n  ```bash\n  sudo npm run certs\n  ```\n  This command will:\n\n  1. Create a certs directory (if it doesn't already exist).\n  2. Generate a self-signed SSL certificate (`selfsigned.crt`) and private key (`selfsigned.key`) in the certs directory for HTTPS development.\n  3. Set appropriate permissions for the generated files.\n  4. Base64-encode the certificate and key and store them as environment variables (`APP_CRT` and `APP_KEY`) in the `.env` file.\n  5. Set the application port (APP_PORT=3000) in the `.env` file.\n  6. Clean up by removing the certs directory after the environment variables have been set.\n\n### Environment Variables\n\nCreate a `.env` file in the root directory and add your environment-specific variables, such as API keys and database URLs.\n\n### Testing\n\nThe project uses Mocha and Chai for testing. To run tests, use:\n\n```bash\nnpm test\n```\n\n## Contributing\n\nContributions are welcome! If you have any ideas, suggestions, or bug reports, please open an issue or submit a pull request. Ensure that you follow the project's contribution guidelines.\n\n## License\n\nThis project is licensed under the ISC License.\n\n\n### Environment Variables\n\nCreate a `.env` file in the root directory and add your environment-specific variables, such as API keys and database URLs.\n\n### Testing\n\nThe project uses Mocha and Chai for testing. To run tests, use:\n\n```bash\nnpm test\n```\n\n## Contributing\n\nContributions are welcome! If you have any ideas, suggestions, or bug reports, please open an issue or submit a pull request. Ensure that you follow the project's contribution guidelines.\n\n## License\n\nThis project is licensed under the ISC License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnpm-packages-collection%2Fgeneric-nodejs-express-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnpm-packages-collection%2Fgeneric-nodejs-express-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnpm-packages-collection%2Fgeneric-nodejs-express-api/lists"}