React web app and Express/MongoDB API starter
A starter for creating a React web app with an Express API using a MongoDB database.
Follow the instructions in the links below to install the required dependencies on your local machine:
This starter is meant to be reused for projects utilizing a React web app and an Express API using a MongoDB database.
To quickly duplicate this starter, click on the green Use this template button near the top of the GitHub repo page (or click here).
Once the repo is on your account, you can clone it locally on your machine.
You can then do a search for the following terms and replace them with your desired package name:
web-api-starterWeb API Starter
Do the following in the root directory of the repo:
-
Ensure NVM is installed globally.
We are using NVM (Node Version Manager) to maintain the same Node version that's running on the Linux machines.
To install NVM, follow the steps provided here.
-
Run
nvm installto ensure you're using the correct version of Node -
Run
npm installfor dev dependencies -
Run
npm run bootstrapfor installingwebandapidependencies
Then follow any additional instructions in the web and api READMEs.
-
Run
nvm useto ensure you're using the correct version of Node -
Run
npm startto start up the web and API development serversYou should now be able to visit http://localhost:3000 in your browser for the web app, http://localhost:3001/api/v1 for the API server!
Note: if at any time you would like to cancel the running server instance, press
CTRL + Cin the open terminal window. -
Start coding!
Don't commit messy code!
Here's a list of things already configured to keep you in line:
All of these tools will be run with the pre-commit hook (configured with Husky) to make sure you're not committing inconsistent code. We highly recommend configuring your editor to use these tools so that you can see (and fix) style violations as you write code.