mirror of
https://github.com/rjNemo/MERN_sample_app
synced 2026-06-12 03:26:40 +00:00
sample app ready
This commit is contained in:
parent
00c71eefa6
commit
e85e734979
1 changed files with 35 additions and 8 deletions
43
README.md
43
README.md
|
|
@ -1,37 +1,64 @@
|
||||||
# MERN Stack Demo
|
# MERN Stack Demo
|
||||||
|
|
||||||
|
Skeleton MERN Stack app with Redux and Firebase.
|
||||||
|
|
||||||
## Prequisites
|
## Prequisites
|
||||||
|
|
||||||
- NodeJs
|
- NodeJs
|
||||||
- npm
|
- npm
|
||||||
|
|
||||||
## Installation
|
## Backend configuration
|
||||||
|
|
||||||
```
|
```zsh
|
||||||
npm init -y
|
npm init -y
|
||||||
```
|
```
|
||||||
|
|
||||||
install dependencies
|
install dependencies
|
||||||
|
|
||||||
```
|
```zsh
|
||||||
npm i express mongoose concurrently
|
npm i express mongoose concurrently firebase-admin helmet moment
|
||||||
```
|
```
|
||||||
|
|
||||||
install nodemon for server hot reload and jest for testing
|
install nodemon for server hot reload and jest for testing
|
||||||
|
|
||||||
```
|
```zsh
|
||||||
npm i -D nodemon jest
|
npm i -D nodemon jest
|
||||||
```
|
```
|
||||||
|
|
||||||
## Create npm scripts
|
### Update package.json
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node server.js",
|
"start": "node --experimental-modules --experimental-json-modules server.js",
|
||||||
"server": "nodemon server.js",
|
"server": "nodemon --experimental-json-modules server.js",
|
||||||
|
"client": "npm start --prefix client",
|
||||||
|
"client-install": "npm install --prefix client",
|
||||||
|
"dev": "concurrently \"npm run server\" \"npm run client\"",
|
||||||
|
"heroku-postbuild": "NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client",
|
||||||
"test": "jest",
|
"test": "jest",
|
||||||
"test:watch": "npm run test -- --watch"
|
"test:watch": "npm run test -- --watch"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Frontend configuration
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
npx create-react-app client --template redux
|
||||||
|
```
|
||||||
|
|
||||||
|
Install dependencies
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
npm i axios firebase prop-types react-router-dom
|
||||||
|
```
|
||||||
|
|
||||||
|
### Update package.json
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"proxy": "http://localhost:5000"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue