MERN starter kit
This starter project provides the base elements needed to create an application using the MERN stack:
Test libraries:
Additional integrations are provided:
Bootstrapped with Create React App
Prerequisites
It is necessary to have Node installed as well as a MongoDB instance up and running as a background process.
Project Structure
The project is divided by the /server
directory where you can find everything related to backend development such as exposing or consuming an API, querying a DB, etc.
The /src
directory contains everything related to frontend development.
Finally, the /public
directory contains static resources such as favicon.ico
and the translation files provided inside the locales
directory.
Getting Started
-
Download or clone repository:
git clone --depth=1 https://github.com/tcerdaITBA/MERN-starter-kit.git your-project-name
-
Install dependencies:
npm install
-
Run project in development mode provided with hot reload:
npm run dev
Scripts
The scripts may be shown at any time with the npm run
command. Overview:
-
run dev mode:
npm run dev
Runs the Node server at port 3000 and React App at port 3100 with hot reload as well as lint and test watchers.
-
test:
npm test
Runs the project's lint and tests. Run with npm run test:watch in order to run jest interactive test watcher.
-
lint:
npm run lint
Runs the project's lint. Run
npm run lint:fix
in order to automatically fix errors. -
build:
npm run build
Builds the project creating a build directory.