{"id":47005745,"url":"https://github.com/hack4impact-upenn/boilerplate-s2022","last_synced_at":"2026-03-11T20:16:07.654Z","repository":{"id":41829447,"uuid":"449892687","full_name":"hack4impact-upenn/boilerplate-s2022","owner":"hack4impact-upenn","description":"This is a boilerplate designed to serve as robust template for quickly starting development on a Typescript based MERN web application.","archived":false,"fork":false,"pushed_at":"2025-04-03T04:09:52.000Z","size":46648,"stargazers_count":11,"open_issues_count":0,"forks_count":11,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-04-03T05:20:32.097Z","etag":null,"topics":["boilerplate-template","material-ui","mern-stack","passport-js","sendgrid","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hack4impact-upenn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2022-01-19T23:49:13.000Z","updated_at":"2025-04-03T04:09:56.000Z","dependencies_parsed_at":"2024-02-19T17:00:29.065Z","dependency_job_id":"d02353a1-0a5e-46e6-80c2-85515358b71b","html_url":"https://github.com/hack4impact-upenn/boilerplate-s2022","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/hack4impact-upenn/boilerplate-s2022","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hack4impact-upenn%2Fboilerplate-s2022","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hack4impact-upenn%2Fboilerplate-s2022/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hack4impact-upenn%2Fboilerplate-s2022/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hack4impact-upenn%2Fboilerplate-s2022/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hack4impact-upenn","download_url":"https://codeload.github.com/hack4impact-upenn/boilerplate-s2022/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hack4impact-upenn%2Fboilerplate-s2022/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30398676,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-11T18:46:22.935Z","status":"ssl_error","status_checked_at":"2026-03-11T18:46:17.045Z","response_time":84,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["boilerplate-template","material-ui","mern-stack","passport-js","sendgrid","typescript"],"created_at":"2026-03-11T20:16:07.008Z","updated_at":"2026-03-11T20:16:07.649Z","avatar_url":"https://github.com/hack4impact-upenn.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Boilerplate\n\nThis is a simple boilerplate designed to serve as robust template for quickly starting development on a [Typescript](https://www.typescriptlang.org) based [MERN](https://www.mongodb.com/mern-stack) web application.\n\n## Features\n\n- Session based authentication with [Passport](https://www.passportjs.org)\n- Emailing for account verification and resetting password with [SendGrid](https://sendgrid.com)\n- Admin functionality for viewing/deleting/promoting other users\n- Clean authentication pages built with [Material UI](https://mui.com)\n- In memory database testing with [Jest](https://jestjs.io) and [Supertest](https://www.npmjs.com/package/supertest)\n- [AirBnb Typescript styling](https://github.com/airbnb/javascript) with [Prettier](https://prettier.io) and [ESLint](https://eslint.org)\n- [Husky](https://typicode.github.io/husky/#/) and [lint-staged](https://github.com/okonet/lint-staged) for checking linting on commits\n- [GitHub Actions](https://docs.github.com/en/actions) for ensuring linting + tests pass on pushes\n\n## Required tools\n\nThese are necessary to build and run the project at full functionality\n\n- Install [Yarn Package Manager](https://classic.yarnpkg.com/en/docs/install/#mac-stable)\n- Install [NodeJS](https://nodejs.org/en/download/)\n\n## Recommended tools\n\nTo take full advantage of the linting/formatting, we recommend adding the [Prettier](https://prettier.io) and [ESLint](https://eslint.org) VSCode extensions and configuring them as shown [here](https://levelup.gitconnected.com/setting-up-eslint-with-prettier-typescript-and-visual-studio-code-d113bbec9857#:~:text=Install%20the%20following%20Visual%20Studio%20Code%20extensions) for code highlighting and formatting on save. Skip to the section labeled \"Add the following to your VS Code settings.json\". To access your settings.json, follow what is linked [here](https://stackoverflow.com/questions/65908987/how-can-i-open-visual-studio-codes-settings-json-file). See [here](https://blog.logrocket.com/using-prettier-eslint-automate-formatting-fixing-javascript/#differences-between-eslint-prettier) for the differences between the two tools and how they work together.\n\nFinally, we also recommend downloading the [Live Share](https://visualstudio.microsoft.com/services/live-share/) extension by Microsoft for improved Collaboration. This allows for easy peer programming on one shared repository instance.\n\n## Setup\n\n### MongoDB\n\nThe boilerplate uses [MongoDB](https://www.mongodb.com) as the database to store information for authentication. To have this available for use, do the following\n\n- Create a [MongoDB Atlas Account](https://www.mongodb.com/cloud/atlas/register)\n- Create a [database deployment](https://www.mongodb.com/docs/atlas/create-connect-deployments/) (This should be done by your PM/TL)\n- Get the database connection URI (Get from your PM/TL and add to .env)\n\nRecommend downloading [MongoDB Compass](https://www.mongodb.com/docs/compass/current/) for easy viewing and management of data.\n\n### SendGrid\n\nThe boilerplate uses [SendGrid](https://sendgrid.com) to send emails to users in order to verify their account, and also to reset their passwords. To have email functionality available for use, the PM/TL should do the following\n\n- Create a SendGrid Account\n- Register a [Sender Identity](https://docs.sendgrid.com/for-developers/sending-email/sender-identity) (Single Sender recommended for most)\n- Create an [API Key](https://docs.sendgrid.com/ui/account-and-settings/api-keys#creating-an-api-key)\n\n### Mixpanel\n\n[Mixpanel](https://mixpanel.com) is an analytics tool that helps us collect data on how users use our applications.\nTo set up Mixpanel:\n\n- Create a Mixpanel account\n- Create a project (there may be one created by default)\n- Go to Settings (top-right) \u003e Project Settings\n- Look for \"Project Token\"\n\n### Environment Variables\n\nCreate a file named `.env` in the root of the `server` folder and add the following variables with the appropriate values. PM/TLs should provide this to their developers.\n\n```\nATLAS_URI=mongodb-connection-uri-from-above\nCOOKIE_SECRET=any-string\nSENDGRID_API_KEY=sendgrid-api-key-from-above\nSENDGRID_EMAIL_ADDRESS=sendgrid-sender-identity-email-from-above\nMIXPANEL_TOKEN=mixpanel-token-from-above\n```\n\n## Usage\n\nNOTE: Currently, this project is best supported by running CLI commands from a bash/zsh environment. If using Windows, this can be achieved by following what's done [here](https://stackoverflow.com/questions/42606837/how-do-i-use-bash-on-windows-from-the-visual-studio-code-integrated-terminal).\n\n### Installing dependencies\n\nFrom the root folder, run the following to configure the project and its dependencies\n\n```\n$ yarn setup\n```\n\nIf there is any need to reset the dependencies, simply run the following series of commands\n\n```\n$ yarn clean\n$ yarn setup\n```\n\n### Running the project\n\nTo run the project, use the following commands from the root folder\n\n```\n# run both server and client\n$ yarn dev\n# run server only\n$ yarn server\n# run client only\n$ yarn client\n```\n\n### Running tests\n\nTo run all the tests in the project, run the following from the root folder\n\n```\n$ yarn test\n```\n\n### Running linting/formatting\n\nTo check for linting issues from ESLint and fix what's possible, from the root folder run the following\n\n```\n$ yarn lint\n```\n\nTo format the code appropriately with Prettier (don't need this if format on save was setup in VSCode), from the root folder run the following\n\n```\n$ yarn format\n```\n\n## Deployment (WIP)\n\nThe boilerplate is designed to be easily deployed on [AWS ECS](https://aws.amazon.com/ecs/) using [Terraform](https://www.terraform.io).\n\nYou will need to [install Terraform](https://developer.hashicorp.com/terraform/tutorials/aws-get-started/install-cli) first. For Mac users, we recommend following the Homebrew installation.\n\nYou will then need to create a file called `.auto.tfvars`, and you can follow the format as in the `.auto.tfvars.example` file. Variables in here correspond to the same environment variables in the `server` folder, except for `aws_account_id` which is the account ID for your AWS account (can be found by clicking your username in the top-right of the AWS console).\n\nTo deploy, run\n\n```\n./deploy.sh\n```\n\nTo tear down all infrastructure, run\n\n```\nterraform destroy\n```\n\nDue to the new (as of early 2024) nature of this AWS configuration, if you are encountering issues with deploying the project on AWS, then please use the old boilerplate and deploy on Heroku or another cloud platform as we have done in the past.\n\n## Setting Up Datadog\n\nDatadog allows for post-deployment logs and traces. Here is a guide to set it up.\n\n1. Create a Datadog account.\n\n2. Add environment variables to the env file.\n\n```\nDD_AGENT_MAJOR_VERSION=7\nDD_API_KEY=\u003ckey\u003e\nDD_SITE=\"us5.datadoghq.com\"\nDD_ENV=\u003cproject_name\u003e\nDD_LOGS_INJECTION=true\nDD_TRACE_AGENT_URL=http://localhost:4000\n```\n\nIn Datadog Agent, search “API Keys” and generate a New Key. Use the key to paste into \u003ckey\u003e\nName your DD_ENV in \u003cproject_name\u003e. This will be useful when querying logs.\n\n3. If not already installed, install the following dependencies.\n\n```\nnpm install --save dd-trace\nnpm install winston\n```\n\n4. The configDatadog.ts file exports three variables: `logger_info`, `logger_warn `, and `logger_error`. These variables represent different log statuses. Simply add one of these log variables within each function in the format below.\n\n```\nlogger_info.log('Account Verified');\nlogger_warn.warn('Logger Initialized');\nlogger_error.error('Logout');\n```\n\nSome examples are shown in login() and logout() functions in auth.controller.ts.\n\n5. Access \"Logs\" in Datadog Agent and search \"env:\u003cproject_name\u003e\" to find the logs and their timeline.\n\n## Common Problems\n\nFill in with problem scenario + solution as they arise\n\n### Incorrect Node Version\n\nIf you see an error message similar to this one:\n\n```\nThe engine \"node\" is incompatible with this module. Expected version \"\u003e=12.0.0\". Got \"11.15.0\"\n```\n\nThis means you are using the wrong node version. This boilerplate relies on using node version 14.8. If you are using any other version of node, please use `nvm` to set node version to `14.8.3` as referenced [here](https://blog.logrocket.com/how-switch-node-js-versions-nvm/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhack4impact-upenn%2Fboilerplate-s2022","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhack4impact-upenn%2Fboilerplate-s2022","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhack4impact-upenn%2Fboilerplate-s2022/lists"}