{"id":22782430,"url":"https://github.com/kdhttps/mean-star","last_synced_at":"2026-04-12T00:02:28.477Z","repository":{"id":38593452,"uuid":"246347269","full_name":"kdhttps/mean-star","owner":"kdhttps","description":"MEAN Stack application :fire: - Boilerplate :rocket: :dart: Docker :sunglasses: :fire:","archived":false,"fork":false,"pushed_at":"2023-01-24T03:16:30.000Z","size":2538,"stargazers_count":1,"open_issues_count":45,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-05T16:24:41.963Z","etag":null,"topics":["angular","appauth","auth2","boilerplate","docker","docker-angular","docker-nodejs","expressjs","mean-stack","meanstack-framework","mongodb","mongoos","nodejs","nodejs-api","nodejs-mongodb-express"],"latest_commit_sha":null,"homepage":"https://mean-star.herokuapp.com","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/kdhttps.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":"SECURITY.md","support":null}},"created_at":"2020-03-10T16:07:11.000Z","updated_at":"2020-12-16T14:16:03.000Z","dependencies_parsed_at":"2023-02-13T14:30:54.769Z","dependency_job_id":null,"html_url":"https://github.com/kdhttps/mean-star","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdhttps%2Fmean-star","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdhttps%2Fmean-star/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdhttps%2Fmean-star/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdhttps%2Fmean-star/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kdhttps","download_url":"https://codeload.github.com/kdhttps/mean-star/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246333931,"owners_count":20760638,"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":["angular","appauth","auth2","boilerplate","docker","docker-angular","docker-nodejs","expressjs","mean-stack","meanstack-framework","mongodb","mongoos","nodejs","nodejs-api","nodejs-mongodb-express"],"created_at":"2024-12-11T21:11:52.160Z","updated_at":"2026-04-12T00:02:28.380Z","avatar_url":"https://github.com/kdhttps.png","language":"TypeScript","readme":"# MEAN-STAR\n\n![template](https://user-images.githubusercontent.com/39133739/82898842-90f32580-9f77-11ea-92f1-67aa09cfcdb4.png)\n\n**MEAN STAR** is a starter application that helps you to easily start your project development with MEAN Stack technology. This project is mainly focused on the Security, integrated [OpenID Connect OAuth 2.0](https://www.oauth.com/oauth2-servers/openid-connect/) [Authorization Code PKCE Flow](https://developers.onelogin.com/openid-connect/guides/auth-flow-pkce) and [jwks jwt verification](https://auth0.com/docs/tokens/concepts/jwks). It uses the [AppAuth-JS](https://github.com/openid/AppAuth-JS) which provides the very generic facility to integrate [Authorization Code PKCE Flow](https://developers.onelogin.com/openid-connect/guides/auth-flow-pkce) with any Single-page Application(**SPA**) technology and with Any OpenID Connect Provider. \n\nThere are so many OpenID Connect Provider. For Example: auth0, okta, keyclock, google, onelogin, gluu, etc...\n\nCurrently I am using [**auth0.com**](https://auth0.com). It is a good OpenID Connect provider. You can create free developer accound and test.\n\n# Live\n\n[https://mean-star.herokuapp.com](https://mean-star.herokuapp.com).\n\n\n# Features\n1. Integrated [AppAuth-JS](https://github.com/openid/AppAuth-JS) at front-end Application.\n1. [OpenID Connect OAuth 2.0](https://www.oauth.com/oauth2-servers/openid-connect/) [Authorization Code PKCE Flow](https://developers.onelogin.com/openid-connect/guides/auth-flow-pkce) for Client Front-end Application.\n1. Protected API using [jwks jwt verification](https://auth0.com/docs/tokens/concepts/jwks)\n1. OpenID Connect OAuth 2.0 integration with any OP Providers.\n1. User and token mapping and managing user sessions using [lru-cache](https://www.npmjs.com/package/lru-cache).\n1. Production and development logger, helps to debug problems in production.\n1. Dockerfile and docker-compose for easy development and deployment.\n1. Covered Code Coverage\n\n# Versions\n\n1. [M] Mongo DB \u003e= 4.x\n1. [E] Expressjs \u003e= 4.x\n1. [A] Angular \u003e= 8.x.x\n1. [N] Nodejs \u003e= 10.x.x\n\n# Prerequisite\n\n1. Node JS \u003e= 10.x.x\n2. Mongo DB \u003e= 4.x\n3. Angular CLI \u003e= 8.3.x, Install it using  `npm install -g @angular/cli@8.3.20`\n4. OpenID Connect Provider and Client ID, Use your OpenID Provider to create new client.\n\n# Install Packages\n\n## Client\n\n```sh\ncd client\nnpm i\n```\n\n## Server\n\n```sh\ncd server\nnpm i\n```\n\nInstall `npm i -g nodemon` for developement.\n\n# Configurations\n\n## Client\n\nSet your OP(OpenID Connect Provider) Client configuration the [environments.ts](./client/src/environments.ts).\n\n```\nexport const environment = {\n  production: false,\n  apiURL: 'http://localhost:3000',\n  // OP Server configuration\n  clientId: '\u003cyour_client_id\u003e',\n  opServer: '\u003cyour_op_server_url\u003e',\n  opServerUserInfoEndpoint: '/userinfo',\n  opServerExtraParamsInAuthRequest: {\n    audience: '\u003cyour_op_server_url\u003e/api/v2/'\n  },\n  redirectURI: 'http://localhost:4200/callback',\n  logoutRedirectURI: 'http://localhost:4200',\n  scope: 'openid email profile',\n};\n```\n\nFor auth0.com, you need to set extra params to get Access Token in JWT form. Please [check here](https://github.com/kdhttps/auth0-angular-node) for solution. Every OpenID Connect provider has it's own configurations style so you may need to find out for JWT Access Token.\n\nWe need JWT Access Token so that we can use the **JWKS Public key** verification as Node JS Server side.\n\nUse [environments.prod.ts](./client/src/environments.ts) for production environment setup.\n\n## Server\n\nRename the from [.env.sample](./server/.env.sample) to **.env**. \n\n```\nPORT=3000\nDB_URL=mongodb://localhost:27017/mean\nOP_SERVER_URL=\u003cyour_op_server_url\u003e\nUSERINFO_ENDPOINT=\u003cyour_op_server_user_endpoint_path\u003e\nCORS_ORIGIN=http://localhost:4200\n```\n\nSet `PRODUCTION=true` for production.\n\n# Start Applications\n\n## Client\n\n```sh\nnpm start\n```\n\n## Server\n\n```sh\nnpm start\n```\n\nFor development,\n\n```sh\nnpm run dev\n```\n\n## Docker\n\nFor development\n\n```sh\ndocker-compose build\ndocker-compose up\n```\n\nIf you want to stop docker then press `ctrl + c + c`, `docker-compose down`.\n\n# Deploy\n\nThere are many ways to deploy the application.\n\n## Deploy using **PM2**\n\n[PM2](https://www.npmjs.com/package/pm2) is a production process manager for Node.js applications with a built-in load balancer. It allows you to keep applications alive forever, to reload them without downtime and to facilitate common system admin tasks.\n\nFollow the below steps for production:\n\n1. Clone or move your code to server and install node_modules.\n\n1. Install PM2\n      ```sh\n     npm i -g pm2\n      ```\n\n1. Make an angular production build.\n      ```sh\n      cd client\n      ng build --prod\n      ```\n\n1. Move `client/dist/client` folder to `server/` so that node application serve it.\n      ```sh\n      cp -R client/dist/client server/\n      ```\n1. Start PM2 service. which runs your application in the background.\n      ```sh\n      export PRODUCTION=true # or you can add this in .env\n      pm2 start index.js\n      ```\n\n## Deploy on NGINX\n\nAngular is a front-end client application and deploy the client application on standard HTTP Server has several benefits. Please check here for [more details](https://stackoverflow.com/a/56302977/11286367).\n\nFollow Below steps to deploy on Nginx:\n\n1. Install NGINX Http Server\n1. Clone or move your code on server and install node_modules.\n1. Make an angular production build.\n      ```sh\n      cd client\n      ng build --prod\n      ```\n1. Move `/client/dist/client/*` all files into `/var/www/html`\n1. Start your node app using PM2. No need to set a production flag.\n1. Added a Proxy Pass configuration for Node Application so that your front-end app can call it.\n\n## Deploy using docker\n\nDocker makes our task very easy. You need to install **docker** and **docker compose** on server.\n\nFollow below steps for deploy using docker\n\n1. Install **docker** and **docker compose**.\n1. Configure `.env` and `environment.prod.ts`.\n1. Build the docker image\n      ```sh\n      docker-compose build\n      ``` \n1. Run docker\n      ```sh\n      docker-compose up\n      ```\n\n## Deploy on Heroku\n\nFirst `create a new App` using Heroku dashboard and then follow the below step to build and deploy image on Heroku\n\n```\nheroku container:login\nheroku container:push [image-name] -a [your-app-name]\nheroku container:release [image-name] -a [your-app-name]\n```\n\n# Liecnse\n\n[MIT](https://raw.githubusercontent.com/kdhttps/mean-star/master/LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkdhttps%2Fmean-star","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkdhttps%2Fmean-star","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkdhttps%2Fmean-star/lists"}