Simple webshop to further increase my experience with the MERN stack.
In development, react-scripts
is used to serve the client(Port = 3000) and the server uses a Node Express API server(Port = 3001).
React
React router v4
Express
MongoDB
Semantic UI
Install and run MongoDB locally.
To get the website to show some dummy content you can load the /db/init.mongo.js
script in the Mongo Shell.
Now, setup the server and client:
git clone https://github.com/kristofferek/storeact.git
cd storeact
npm i
cd client
npm i
cd ..
npm start
Running npm run build
creates the static bundle which we can then use any HTTP server to serve:
cd client/
npm run build
Setting NODE_ENV to production and running npm run server
will make Node/Express serve the client/build
directory as a static asset.
cd ..
npm run server