Skip to content

Latest commit

 

History

History
93 lines (62 loc) · 2.15 KB

README.md

File metadata and controls

93 lines (62 loc) · 2.15 KB

Mern Starter Project

This should provide you with a working app with auth and theming all set up.

You will want to do a search for mern-starter in the project and replace all occurrences with the appropriate values.

I do not guarantee that this will work without issues though, so make sure to do thorough testing of your own before relying on the auth.

If you do find a problem, please submit an issue.

Stack

in no particular order

  • TypeScript - All client code is written in TypeScript.
  • React - The client code is written in the React.js framework.
  • Node.js - Server side JS engine.
  • MongoDB - For storing data.
  • Mongoose - For interacting with MongoDB.
  • SES (AWS Simple Email Service) - For sending reset password emails.
  • Express - Server.

Check both package.json and client/package.json for a full list of dependencies.

Setup for Development

Install Node and npm

If you are not sure if you have them installed or not, type node -v and npm -v, and it will either say command not found or tell you a version number.

If any of the above are not installed, using homebrew, type brew install node.

Installing node will also install npm.

Clone the repository onto your computer

Clone the repository

git clone <repo url>
cd mern-starter

Install dependencies

To install all dependencies, run:

npm install:all

Add config/secrets.js

// config/secrets.js
module.exports = {
  mongoURI: 'mongodb+srv://mern-starter:<password>@cluster0.ebdpy.mongodb.net/<dbname>?retryWrites=true&w=majority',
  jwtKey: '<secure key>',
};

Add AWS Credentials

for SES

Add credentials file in ~/.aws with these contents:

[default]
aws_access_key_id = <YOUR KEY>
aws_secret_access_key = <YOUR SECRET ACCESS KEY>

You can also start a local mongo database and use that key instead. See installing mongodb.

Start development server

To start the development server, run:

npm run start:dev

Instead of adding a secrets.js file you can export the mongo uri as an environment variable:

export MONGO_URI=<mongodb uri> yarn start:dev