{"id":22107499,"url":"https://github.com/nextyfine-dev/initial-nodejs-server-setup","last_synced_at":"2025-03-24T03:22:21.545Z","repository":{"id":192760419,"uuid":"657020958","full_name":"nextyfine-dev/Initial-NodeJs-Server-Setup","owner":"nextyfine-dev","description":"This GitHub repository provides an initial setup for a Node.js server. It serves as a foundation for building web applications and APIs using Node.js, Express, and TypeScript. The setup includes essential libraries and configurations for handling HTTP requests, logging, error handling, and more.","archived":false,"fork":false,"pushed_at":"2023-09-05T07:39:26.000Z","size":78,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-29T09:37:02.919Z","etag":null,"topics":["api","initial-setup","nodejs","nodejs-express","nodejs-mysql","nodejs-server","sequelize","server"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/nextyfine-dev.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-06-22T06:31:15.000Z","updated_at":"2024-06-15T09:52:02.000Z","dependencies_parsed_at":"2024-01-28T16:00:59.855Z","dependency_job_id":null,"html_url":"https://github.com/nextyfine-dev/Initial-NodeJs-Server-Setup","commit_stats":null,"previous_names":["nextyfine-dev/initial-nodejs-server-setup"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextyfine-dev%2FInitial-NodeJs-Server-Setup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextyfine-dev%2FInitial-NodeJs-Server-Setup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextyfine-dev%2FInitial-NodeJs-Server-Setup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextyfine-dev%2FInitial-NodeJs-Server-Setup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nextyfine-dev","download_url":"https://codeload.github.com/nextyfine-dev/Initial-NodeJs-Server-Setup/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245201238,"owners_count":20576783,"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":["api","initial-setup","nodejs","nodejs-express","nodejs-mysql","nodejs-server","sequelize","server"],"created_at":"2024-12-01T08:17:51.354Z","updated_at":"2025-03-24T03:22:21.533Z","avatar_url":"https://github.com/nextyfine-dev.png","language":"TypeScript","readme":"# Initial Node.js Server Setup\n\n![Node.js](https://img.shields.io/badge/Node.js-%3E%3D%2016-brightgreen)\n\nThis repository provides a robust foundation for quickly setting up a Node.js server, ideal for developing web applications and APIs. It includes essential configurations, middleware, and error handling to streamline your project's development.\n\n## Features\n\n- **Express Framework**: Built on the Express framework, known for its speed and simplicity in creating web applications and APIs.\n- **Middleware Stack**: Includes essential middleware components like CORS, Helmet, Morgan, and Compression, enhancing security, logging, and performance.\n- **Error Handling**: Implements an error controller for consistent and user-friendly error responses.\n- **TypeScript Support**: Developed in TypeScript, enabling static type checking and code maintainability.\n- **Development Environment**: Equipped with Nodemon and TypeScript compiler for automatic restarts and real-time TypeScript transpilation during development.\n- **Socket.io Support**: Integrates Socket.io for real-time communication, enabling interactive features.\n- **Functional Programming**: Embraces functional programming principles for clean and maintainable code.\n- **MySQL Database**: Connect to MySQL databases using Sequelize ORM for efficient data management.\n\n## Getting Started\n\nFollow these steps to start using the Node.js server setup:\n\n### 1. Clone the Repository\n\nClone this repository to your local machine:\n\n```bash\ngit clone https://github.com/your-username/initial-nodejs-server-setup.git\n```\n\n### 2. Install Dependencies\n\nNavigate to the project directory and install dependencies using either npm or yarn:\n\n```bash\n# Using npm\nnpm install\n\n# Using yarn\nyarn install\n```\n\nCertainly, I've added a new step to the README to run the build before starting the server for the first time:\n\n### 3. Run the Build\n\nBefore launching the server for the first time, you need to build the project. This step compiles TypeScript code into JavaScript, preparing it for execution.\n\n```bash\nyarn run build\n```\n\nAfter building the project, proceed with starting the server:\n\n### 4. Start the Server\n\nLaunch the server in development mode:\n\n```bash\nyarn run dev\n```\n\nThe server will automatically restart when code changes are detected, making development smooth and efficient. Access the server at `http://localhost:3030`.\n\n## TypeScript Folder Structure\n\nThe project adheres to a well-organized TypeScript folder structure for better code management:\n\n- **config**: Contains configurations, environment variables, and database setup.\n- **controllers**: Includes the error controller.\n- **logs**: Houses the logger configuration.\n- **middlewares**: Holds custom middleware functions.\n- **model**: Defines data models.\n- **routes**: Manages route definitions.\n- **services**: Houses server-related services.\n- **test**: Reserved for testing scripts.\n- **types**: Contains custom type definitions.\n- **utils**: Includes utility functions.\n- **app.ts**: Entry point for the application.\n- **server.ts**: Defines the server setup.\n- **ws.ts**: Manages WebSocket configuration.\n\n---\n\nBy utilizing this initial server setup, you can accelerate your Node.js development, saving time and effort in setting up the fundamental structure and configurations. Begin building Node.js applications and APIs confidently, knowing that you have a solid foundation to build upon. Happy coding!\n\n## Contributing\n\nContributions are welcome! If you have improvements, bug fixes, or new features to contribute, please submit a pull request. Ensure that your code adheres to the established coding style and undergoes thorough testing.\n\n## License\n\nThis project is licensed under the [MIT License](https://github.com/nextyfine-dev/Initial-NodeJs-Server-Setup/blob/master/LICENSE), granting you the freedom to use and modify the code to suit your requirements.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnextyfine-dev%2Finitial-nodejs-server-setup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnextyfine-dev%2Finitial-nodejs-server-setup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnextyfine-dev%2Finitial-nodejs-server-setup/lists"}