{"id":24874743,"url":"https://github.com/dirheimerb/express-master","last_synced_at":"2025-03-27T02:16:00.006Z","repository":{"id":105233816,"uuid":"494238431","full_name":"dirheimerb/express-master","owner":"dirheimerb","description":null,"archived":false,"fork":false,"pushed_at":"2022-05-20T14:03:57.000Z","size":841,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-01T07:28:59.705Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/dirheimerb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":"ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-19T21:46:20.000Z","updated_at":"2022-05-19T21:46:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"13b94f1b-767c-4e60-bd58-f374c578d6dd","html_url":"https://github.com/dirheimerb/express-master","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":"GeekyAnts/express-typescript","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dirheimerb%2Fexpress-master","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dirheimerb%2Fexpress-master/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dirheimerb%2Fexpress-master/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dirheimerb%2Fexpress-master/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dirheimerb","download_url":"https://codeload.github.com/dirheimerb/express-master/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245767360,"owners_count":20668826,"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":[],"created_at":"2025-02-01T07:28:18.260Z","updated_at":"2025-03-27T02:16:00.000Z","avatar_url":"https://github.com/dirheimerb.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"```\nHey There! 🙌 \n🤾 that ⭐️ button if you like this boilerplate. \n```\n\n\u003cimg alt=\"express-typescript\" src=\"https://geekyants.github.io/express-typescript/public/images/express-typescript.png\" height=\"50%\" width=\"60%\"\u003e\n\nA boilerplate for [Node.js](https://nodejs.org/en) App.\n\n* This boilerplate is built using [Express.js](https://expressjs.com/) web framework, and is using [Typescript Lang](https://www.typescriptlang.org/) for writing the app's logic. \n* It uses Node's [Cluster API](https://nodejs.org/api/cluster.html), this helps us to take advantage of multi-core systems \u0026 to handle the load.\n* For storing custom constant configurations within the `process.env` - [DotEnv](https://github.com/motdotla/dotenv) package is used.\n* For Database - Repo contains the use of [Mongoose](https://mongoosejs.com/) (ie. [MongoDB](https://www.mongodb.com/) object modeling for [Node.js](https://nodejs.org/en/)).\n* For Cache - Repo contains the use of [memory-cache](https://github.com/ptarjan/node-cache#readme) (ie. A simple in-memory cache for node.js).\n* For Routing - Repo contains the use of [express-router](https://expressjs.com/en/guide/routing.html) \u0026 have distributed Routes into two files ie. Web Routes \u0026 API Routes. \n* For Route Auth Middleware - Web routes are configured with [CSRF Token](https://github.com/krakenjs/lusca) while the API routes are configured with [JSON Web Token](https://github.com/auth0/express-jwt).\n* For Strategies Auth - Repo contains the use of the [Passport.js](https://github.com/jaredhanson/passport). Passport.js is compatible with Express.js and is authentication middleware for Node.js.\n* For Logging - Repo uses custom Log class built in middlewares folder, and it creates logs file by date \u0026 removes the log files after 'X' days (You can define that 'X' in the `.env` file).\n* For Handling Exception - Repo contains two classes ie. `Handler` \u0026 `NativeEvent`.\n* To Log - use `Log.info('Your message should go here!')`. Other options for logging are `Log.warn`, `Log.error` \u0026 `Log.custom`.\n* For views - Repo contains the use of [PUG](https://github.com/pugjs/pug) template engine.\n* For background queues - Repo contains the use of [Kue](https://github.com/Automattic/kue). For more details, please review the [Queue](https://github.com/faizahmedfarooqui/nodets/blob/master/src/providers/Queue.ts) class.\n\n# Contents\n\n* [Global Requisites](#global-requisites)\n* [App Structure](#app-structure)\n* [Install, Configure \u0026 Run](#install-configure--run)\n* [List of Routes](#list-of-routes)\n* [Screens](#screens)\n\n# Global Requisites\n\n* node (\u003e= 10.5.0)\n* tsc (\u003e= 3.0.1)\n* typescript (\u003e= 3.0.1)\n* mongoose (\u003e= 3.6.2)\n* redis\n\n# App Structure\n\n\u003e _Note: I am mentioning only files/folders which you need to configure if required_\n\n```bash\n├── dist\n├── public\n├── src\n│   ├── controllers\n│   │   ├── Api\n│   │   │   ├── Auth\n│   │   │   │   ├── Login.ts\n│   │   │   │   ├── RefreshToken.ts\n│   │   │   │   └── Register.ts\n│   │   │   └── Home.ts\n│   │   ├── Auth\n│   │   │   ├── Login.ts\n│   │   │   ├── Logout.ts\n│   │   │   ├── Register.ts\n│   │   │   └── Social.ts\n│   │   ├── Account.ts\n│   │   └── Home.ts\n│   ├── exception\n│   │   ├── Handler.ts\n│   │   └── NativeEvent.ts\n│   ├── interfaces\n│   │   ├── models\n│   │   │   └── user.ts\n│   │   └── vendors\n│   │        ├── index.ts\n│   │        ├── INext.ts\n│   │        ├── IRequest.ts\n│   │        └── IResponse.ts\n│   ├── middlewares\n│   │   ├── CORS.ts\n│   │   ├── CsrfToken.ts\n│   │   ├── Http.ts\n│   │   ├── Kernel.ts\n│   │   ├── Log.ts\n│   │   ├── Statics.ts\n│   │   ├── StatusMonitor.ts\n│   │   └── View.ts\n│   ├── models\n│   │   └── User.ts\n│   ├── providers\n│   │   ├── App.ts\n│   │   ├── Cache.ts\n│   │   ├── Database.ts\n│   │   ├── Express.ts\n│   │   ├── Locals.ts\n│   │   ├── Passport.ts\n│   │   ├── Queue.ts\n│   │   └── Routes.ts\n│   ├── routes\n│   │   ├── Api.ts\n│   │   └── Web.ts\n│   ├── services\n│   │   └── strategies\n│   │        ├── Google.ts\n│   │        ├── Local.ts\n│   │        └── Twitter.ts\n│   └── index.ts\n├── views\n│   ├── includes\n│   ├── modals\n│   ├── pages\n│   ├── partials\n│   ├── static\n│   │   ├── css/*.css\n│   │   └── js/*.js\n│   └── layout.pug\n├── .env\n├── .gitignore\n├── nodemon.json\n├── package.json\n├── README.md\n├── tsconfig.json\n└── tslint.json\n```\n\n# Install, Configure \u0026 Run\n\nBelow mentioned are the steps to install, configure \u0026 run in your platform/distributions.\n\n```bash\n# Clone the repo.\ngit clone https://github.com/GeekyAnts/express-typescript.git;\n\n# Goto the cloned project folder.\ncd nodets;\n```\n\n```bash\n# Without Docker\n\n# Note: It is assumed here that you have MongoDB running in the background and that you have created the database.\n\n# Install NPM dependencies.\n# Note: You can review the list of dependencies from the below link.\n# https://github.com/faizahmedfarooqui/nodets/network/dependencies\nnpm install;\n\n# Edit your DotEnv file using any editor of your choice.\n# Please Note: You should add all the configurations details\n# or else default values will be used!\nvim .env;\n\n# Run the app\nnpm run dev;\n```\n\n```bash\n# With Docker\n\n# Note: It is assumed here that you have Docker running in the background.\n\n# Run the app in docker as a foreground process\ndocker-compose up\n\n# Run the app in docker as a background process\ndocker-compose up -d\n```\n\n\n# List of Routes\n\n```sh\n# Web Routes:\n\n+--------+-------------------------+\n  Method | URI\n+--------+-------------------------+\n  GET    | /\n  GET    | /signup\n  POST   | /signup\n  GET    | /login\n  POST   | /login\n  GET    | /logout\n  GET    | /account\n  GET    | /auth/google\n  GET    | /auth/google/callback\n  GET    | /auth/twitter\n  GET    | /auth/twitter/callback\n  GET    | /status-monitor\n+--------+-------------------------+\n\n# API Routes:\n\n+--------+-------------------------+\n  Method | URI\n+--------+-------------------------+\n  POST   | /api\n  POST   | /api/auth/login\n  POST   | /api/auth/register\n  POST   | /api/auth/refresh-token\n+--------+-------------------------+\n```\n\n# Screens\n\n### Home / Landing Page\n\n![Home / Landing Page](/screens/Home.png)\n\u003e Note: This page has sub-sections, like about-us, contact-us \u0026 portfolio\n\n### LogIn Page\n\n![LogIn Page](/screens/Login.png)\n\u003e Note: LogIn with Providers\n\n### SignUp Page\n\n![SignUp Page](/screens/SignUp.png)\n\u003e Note: SignUp with Providers\n\n### Dashboard Page\n\n![Dashboard Page](/screens/Dashboard.png)\n\n### With Dropdown Menu\n\n![Dashboard Page with Dropdown Menu](/screens/DashboardWithDropdown.png)\n\n### Page Not Found Page\n\n![Page Not Found Page](/screens/PageNotFound.png)\n\u003e Note: In case the requested URI does not exist, app shows this page\n\n### Under Maintenance Page\n\n![Under Maintenance Page](/screens/UnderMaintenance.png)\n\u003e Note: In case an error is generated, so instead of plain errors we can show the under maintenance page.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdirheimerb%2Fexpress-master","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdirheimerb%2Fexpress-master","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdirheimerb%2Fexpress-master/lists"}