diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f3d7174..e003823 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ # Hey! 👋 -You are more than welcome to contribute to this project. +You are more than welcome to contribute to this project. ## Setting up on your machine. @@ -8,11 +8,9 @@ Follow this steps to setup this project on your local dev machine - star and fork this repo - clone this repo on your machine and cd into it -- install all the dependancies with ```npm install``` +- install all the dependancies with `npm install` - now open this project directory in your favrioute code editor - ## Creating a Pull request. Once you commited the code, please open a pull request so that we can test and merge it into the codebase. - diff --git a/README.md b/README.md index cd548bf..eb4d947 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,14 @@ +

node-expressgen. 🚀

-# Node-Expressgen 🚀 +## Boilerplate generator for your Node.js, Express, TypeScript/JavaScript projects! +![npm](https://img.shields.io/npm/dw/node-expressgen) ![npm](https://img.shields.io/npm/v/node-expressgen) ![GitHub package.json version](https://img.shields.io/github/package-json/v/gunvantsr/expressgen) ![GitHub last commit](https://img.shields.io/github/last-commit/gunvantsr/expressgen) ![GitHub contributors](https://img.shields.io/github/contributors/gunvantsr/expressgen) ![GitHub](https://img.shields.io/github/license/gunvantsr/expressgen) + +Hello there! At my job, whenever I was working on node express projects, I used to find myself copy-pasting the same directory and file structures over and over again. So, I created this simple node express boilerplate generator to ease the task. I acknowledge, there are so many better and adavanced tools for this task, but I wanted to build something custom while learning something new :) -PS: This project is still in beta, please feel free to open an issue or pull request for any kind of feature suggestion, feedback, improvement. +PS: Please feel free to open an issue or pull request for any kind of feature suggestion, feedback, improvement. + ## Installation Install node-expressgen with npm globally @@ -11,7 +16,7 @@ Install node-expressgen with npm globally ```bash npm install node-expressgen -g ``` - + ## Usage/Examples Once you installed it globally, just type this command where you want to generate the boilerplate. @@ -20,15 +25,19 @@ Once you installed it globally, just type this command where you want to generat expressgen ``` + It will prompt a question, asking you for project name. ```bash ? Project name: ``` -And boom!! you have your node express boilerplate -## Authors +And boom!! you have your node express boilerplate + +### Demo -- [@gunvantsr](https://www.github.com/gunvantsr) +![Alt Text](https://media.giphy.com/media/HA8Zr99sd8IXHYgGt1/giphy.gif) + +## Authors - +- [Gunvant Sarpate](https://www.twitter.com/gunvantsr) diff --git a/boilerplates/typescript/.eslintrc.json b/boilerplates/typescript/.eslintrc.json index 96b2713..eff7647 100644 --- a/boilerplates/typescript/.eslintrc.json +++ b/boilerplates/typescript/.eslintrc.json @@ -1,9 +1,19 @@ { - "extends": [ - "airbnb/base", - "airbnb/typescript/base" - ], + "env": { + "browser": true, + "es2021": true + }, + "extends": [ + "airbnb-base", + "plugin:import/errors", + "plugin:import/warnings", + "plugin:import/typescript",], + "parser": "@typescript-eslint/parser", "parserOptions": { - "project": "./tsconfig.eslint.json" - } -} \ No newline at end of file + "ecmaVersion": "latest", + "sourceType": "module" + }, + "plugins": ["@typescript-eslint", "prettier"], + "rules": {} + } + \ No newline at end of file diff --git a/boilerplates/typescript/nodemon.json b/boilerplates/typescript/nodemon.json new file mode 100644 index 0000000..304312a --- /dev/null +++ b/boilerplates/typescript/nodemon.json @@ -0,0 +1,8 @@ +{ + "watch": [ + "src" + ], + "ext": ".ts", + "ignore": [], + "exec": "ts-node ./src/index.ts" +} \ No newline at end of file diff --git a/boilerplates/typescript/package.json b/boilerplates/typescript/package.json index 317131b..a0f0c74 100644 --- a/boilerplates/typescript/package.json +++ b/boilerplates/typescript/package.json @@ -1,5 +1,5 @@ { - "name": "hello-world", + "name": "hello-world-app-ts", "version": "1.0.0", "main": "src/index.ts", "license": "MIT", @@ -7,13 +7,15 @@ "@types/cors": "^2.8.12", "@types/express": "^4.17.13", "@types/node": "^18.0.6", - "@typescript-eslint/eslint-plugin": "^5.13.0", - "@typescript-eslint/parser": "^5.0.0", + "@typescript-eslint/eslint-plugin": "^5.30.7", + "@typescript-eslint/parser": "^5.30.7", + "eslint": "^7.32.0 || ^8.2.0", "eslint-config-airbnb-base": "^15.0.0", "eslint-config-airbnb-typescript": "^17.0.0", - "eslint-plugin-import": "^2.26.0", + "eslint-config-prettier": "^8.5.0", + "eslint-plugin-import": "^2.25.2", "eslint-plugin-prettier": "^4.0.0", - "prettier": "^2.6.2", + "prettier": "^2.7.1", "ts-node": "^10.8.1", "typescript": "^4.7.3" }, diff --git a/boilerplates/typescript/src/api/v1/controllers/custom.controller.ts b/boilerplates/typescript/src/api/v1/controllers/custom.controller.ts new file mode 100644 index 0000000..e69de29 diff --git a/boilerplates/typescript/src/api/v1/controllers/index.ts b/boilerplates/typescript/src/api/v1/controllers/index.ts new file mode 100644 index 0000000..5ac7d6a --- /dev/null +++ b/boilerplates/typescript/src/api/v1/controllers/index.ts @@ -0,0 +1 @@ +export * from './custom.controller'; \ No newline at end of file diff --git a/boilerplates/typescript/src/api/v1/controllers/tests/controllers.test.ts b/boilerplates/typescript/src/api/v1/controllers/tests/controllers.test.ts new file mode 100644 index 0000000..e69de29 diff --git a/boilerplates/typescript/src/api/v1/helpers/helpers.ts b/boilerplates/typescript/src/api/v1/helpers/helpers.ts new file mode 100644 index 0000000..e69de29 diff --git a/boilerplates/typescript/src/api/v1/interfaces/custom.interfaces.ts b/boilerplates/typescript/src/api/v1/interfaces/custom.interfaces.ts new file mode 100644 index 0000000..e69de29 diff --git a/boilerplates/typescript/src/api/v1/middlewares/custom.middleware.ts b/boilerplates/typescript/src/api/v1/middlewares/custom.middleware.ts new file mode 100644 index 0000000..e69de29 diff --git a/boilerplates/typescript/src/api/v1/middlewares/tests/Middlewares.test.ts b/boilerplates/typescript/src/api/v1/middlewares/tests/Middlewares.test.ts new file mode 100644 index 0000000..e69de29 diff --git a/boilerplates/typescript/src/api/v1/models/custom.model.ts b/boilerplates/typescript/src/api/v1/models/custom.model.ts new file mode 100644 index 0000000..e69de29 diff --git a/boilerplates/typescript/src/api/v1/models/index.ts b/boilerplates/typescript/src/api/v1/models/index.ts new file mode 100644 index 0000000..2ab7b18 --- /dev/null +++ b/boilerplates/typescript/src/api/v1/models/index.ts @@ -0,0 +1 @@ +export * from './custom.model'; \ No newline at end of file diff --git a/boilerplates/typescript/src/api/v1/routes/app.routes.ts b/boilerplates/typescript/src/api/v1/routes/app.routes.ts new file mode 100644 index 0000000..e69de29 diff --git a/boilerplates/typescript/src/api/v1/services/custom.service.ts b/boilerplates/typescript/src/api/v1/services/custom.service.ts new file mode 100644 index 0000000..f099d33 --- /dev/null +++ b/boilerplates/typescript/src/api/v1/services/custom.service.ts @@ -0,0 +1,7 @@ +export const userService = ()=> { + try { + + } catch (error: any) { + + } +} \ No newline at end of file diff --git a/boilerplates/typescript/src/api/v1/services/index.ts b/boilerplates/typescript/src/api/v1/services/index.ts new file mode 100644 index 0000000..f9c890c --- /dev/null +++ b/boilerplates/typescript/src/api/v1/services/index.ts @@ -0,0 +1 @@ +export * from './custom.service' \ No newline at end of file diff --git a/boilerplates/typescript/src/api/v1/services/tests/services.test.ts b/boilerplates/typescript/src/api/v1/services/tests/services.test.ts new file mode 100644 index 0000000..e69de29 diff --git a/boilerplates/typescript/tests/app.test.ts b/boilerplates/typescript/tests/app.test.ts new file mode 100644 index 0000000..e69de29 diff --git a/boilerplates/typescript/tsconfig.eslint.json b/boilerplates/typescript/tsconfig.eslint.json index 3522a1e..a806179 100644 --- a/boilerplates/typescript/tsconfig.eslint.json +++ b/boilerplates/typescript/tsconfig.eslint.json @@ -1,4 +1,5 @@ { "extends": "./tsconfig.json", "include": ["./**/*.ts", "./**/*.js", "./.*.js"] -} \ No newline at end of file + } + \ No newline at end of file diff --git a/boilerplates/typescript/tsconfig.json b/boilerplates/typescript/tsconfig.json index 41dca97..7225b81 100644 --- a/boilerplates/typescript/tsconfig.json +++ b/boilerplates/typescript/tsconfig.json @@ -14,4 +14,4 @@ }, "include": ["src"], "exclude": ["node_modules", "dist"] -} \ No newline at end of file +} diff --git a/package.json b/package.json index 63578d6..6ef0598 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "node-expressgen", - "version": "1.0.6", + "version": "1.0.7", "main": "index.js", "license": "MIT", "author": "Gunvant Sarpate",