{"id":19401786,"url":"https://github.com/euclidstellar/euclid-js","last_synced_at":"2025-04-24T07:30:46.808Z","repository":{"id":252555984,"uuid":"840781127","full_name":"EuclidStellar/euclid-js","owner":"EuclidStellar","description":"Simple backend template generator with folder structure and common dependencies for nodeJs ","archived":false,"fork":false,"pushed_at":"2024-08-16T12:55:01.000Z","size":98,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-03T01:05:14.878Z","etag":null,"topics":["backend","hacktoberfest","hacktoberfest-accepted","hacktoberfest2024","hacktoberfest2024-accepted","nodejs","nodejs-modules","package","template"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/euclidstellar","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/EuclidStellar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-10T17:00:33.000Z","updated_at":"2024-10-23T00:13:48.000Z","dependencies_parsed_at":"2024-08-14T00:56:04.165Z","dependency_job_id":null,"html_url":"https://github.com/EuclidStellar/euclid-js","commit_stats":null,"previous_names":["euclidstellar/euclid-js"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EuclidStellar%2Feuclid-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EuclidStellar%2Feuclid-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EuclidStellar%2Feuclid-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EuclidStellar%2Feuclid-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EuclidStellar","download_url":"https://codeload.github.com/EuclidStellar/euclid-js/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250582811,"owners_count":21453917,"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":["backend","hacktoberfest","hacktoberfest-accepted","hacktoberfest2024","hacktoberfest2024-accepted","nodejs","nodejs-modules","package","template"],"created_at":"2024-11-10T11:19:46.170Z","updated_at":"2025-04-24T07:30:46.515Z","avatar_url":"https://github.com/EuclidStellar.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# euclid-js | Node.js Backend Generator\n\nEuclid is a CLI tool designed to streamline the creation of a Node.js backend project. It generates a well-structured project folder with best practices, installs necessary dependencies, and provides template code to help you start quickly.\n\n## Features\n\n- **Generates a Standard Node.js Project Structure**: Quickly set up a consistent project layout.\n- **Installs Common Dependencies**: Automatically installs essential libraries and tools for backend development.\n- **Provides Template Code**: Includes base code for `index.js` and routes to jump-start your application.\n- **CLI Interaction**: Beautiful command-line interface for a smooth user experience.\n- **Optional Authentication Setup**: Choose to include authentication-related files and setup.\n\n## Installation\n\nTo install the Euclid Generator globally, use npm:\n\n```bash\nnpm install -g euclidstellar\n```\n\n## Usage\n\nAfter installing the package globally, you can generate a new project by running the following command:\n\n```bash\neuclid \u003cproject-name\u003e\n```\n\nReplace `\u003cproject-name\u003e` with your desired project name. This command will create a folder with the specified project name and set up the project structure and dependencies.\n\n### CLI Interaction\n\nWhen you run the CLI, you will interact with the following prompts:\n\n1. **Welcome Message**: Displays a welcome message with developer information and project details.\n2. **Project Name Prompt**: Asks for the name of the project.\n3. **Generate Auth Part**: Prompts whether to include authentication-related code.\n   - **Y**: Includes authentication setup and additional files.\n   - **N**: Only generates the basic project structure and core files.\n\n### Example CLI Interaction\n\nHere's an example of how the CLI might look when you run it:\n\n```bash\n$ euclid my-awesome-project\n\n  ==================================================\n  =                                                =\n  =                  EUCLID-JS                     =\n  =           A Project Generator CLI              =\n  =                                                =\n  ==================================================\n\nDeveloped by: Gaurav Singh | @euclidstellar\nGitHub: https://github.com/euclidstellar\nnpmjs:  http://npmjs.com/package/euclidstellar\n\nEnter the project name: my-awesome-project\n\nDo you want to generate the auth part? (y/N): y\n\nProject folder created: /path/to/my-awesome-project\nFolder created: /path/to/my-awesome-project/src\nFolder created: /path/to/my-awesome-project/src/controllers\nFolder created: /path/to/my-awesome-project/src/models\nFolder created: /path/to/my-awesome-project/src/routes\nFolder created: /path/to/my-awesome-project/src/services\nFolder created: /path/to/my-awesome-project/src/utils\nFolder created: /path/to/my-awesome-project/tests\nFile created: /path/to/my-awesome-project/README.md\nFile created: /path/to/my-awesome-project/.env\nFile created: /path/to/my-awesome-project/.env.example\nFile created: /path/to/my-awesome-project/package.json\nFile created: /path/to/my-awesome-project/index.js\nFile created: /path/to/my-awesome-project/src/routes/index.js\nFile created: /path/to/my-awesome-project/src/utils/jwt.js\nFile created: /path/to/my-awesome-project/src/models/model.js\n\nInstalling dependencies...\n+ express@4.17.1\n+ mongoose@5.10.9\n+ dotenv@8.2.0\n+ jsonwebtoken@8.5.1\n+ bcryptjs@2.4.3\n+ cors@2.8.5\n+ body-parser@1.19.0\n+ nodemon@2.0.4\n+ winston@3.3.3\n+ passport@0.4.1\n+ multer@1.4.2\n+ sequelize@6.3.5\n+ helmet@4.1.1\n\nDependencies installed successfully.\n\nYou are the distance between the last metaphor of the verse and the full stop ~ Gaurav\n```\n\n## Project Structure\n\nThe generated project will have the following structure:\n\n```\n\u003cproject-name\u003e/\n├── README.md\n├── package.json\n├── index.js\n├── src\n│   ├── controllers\n│   ├── models\n│   ├── routes\n│   │   └── index.js\n│   ├── utils\n│   │   └── jwt.js\n│   └── services \n└── tests\n```\n\n- `index.js`: Entry point of your application.\n- `src/controllers`: Folder for your controllers.\n- `src/models`: Folder for your models.\n- `src/routes`: Folder for your routes.\n- `src/services`: Folder for your services.\n- `tests`: Folder for your tests.\n- `jwt.js`: Script for handling generation and verification of JSON Web Tokens (included if authentication setup is selected).\n\n## Template Code\n\n### `index.js`\n\nThe `index.js` file is the main entry point of your application and includes basic setup code:\n\n```javascript\nconst express = require('express');\nconst app = express();\nconst port = process.env.PORT || 3000;\n\napp.use(express.json());\napp.use(express.urlencoded({ extended: true }));\n\n// Import routes\nconst routes = require('./src/routes');\n\n// Use routes\napp.use('/api', routes);\n\napp.listen(port, () =\u003e {\n  console.log(`Server is running on port ${port}`);\n});\n```\n\n### `src/routes/index.js`\n\nThe `index.js` file in the routes folder includes a basic route setup:\n\n```javascript\nconst express = require('express');\nconst router = express.Router();\n\n// Define your routes here\nrouter.get('/', (req, res) =\u003e {\n  res.send('Welcome to the API');\n});\n\nmodule.exports = router;\n```\n\n## Dependencies\n\nThe generated project includes the following dependencies:\n\n- `express`: Web framework for Node.js.\n- `mongoose`: MongoDB object modeling tool.\n- `dotenv`: Module to load environment variables from a `.env` file.\n- `jsonwebtoken`: Implementation of JSON Web Tokens.\n- `bcryptjs`: Library to hash passwords.\n- `cors`: Middleware to enable CORS.\n- `body-parser`: Middleware to parse incoming request bodies.\n- `nodemon`: Tool to automatically restart the server on file changes.\n- `winston`: Logger library.\n- `passport`: Authentication middleware.\n- `multer`: Middleware for handling multipart/form-data.\n- `sequelize`: Promise-based Node.js ORM.\n- `helmet`: Middleware to secure Express apps.\n\n## Contributing\n\nContributions are welcome! Please open an issue or submit a pull request if you have any improvements or bug fixes.\n\n## License\n\nThis project is licensed under the MIT License.\n\n---\n\nFeel free to adjust the content or formatting as needed! Let me know if you have any other requests or questions. 😊","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feuclidstellar%2Feuclid-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feuclidstellar%2Feuclid-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feuclidstellar%2Feuclid-js/lists"}