This project implements a web application skeleton within the JavaScript ecosystem using the Mongo-Express-React-Node stack. The main idea is to set up a rudimentary system that can be "easily" developed further into a real full-stack JavaScript application.
Table of Contents
The "MERN stack" consists of:
- MongoDB as the database
- Express.js to build the backend API
- React to build the web browser UI
- Node.js to run the web server in general
In addition to the above tools, this project also uses
- Material UI React component library to obtain reasonable looking extensible visual components
- JSON Web Tokens for auth session handling
- React-Redux to manage application state
Node.js, Docker and Yarn should be installed.
The service can be locally set up with GNU Make
make install
make up -j2
: Sets up the application athttp:localhost:8000
. Note that we start two processes, one for the server and the client, respectively.make db-reset
: Clean up database. Useful when making changes.make clean
: Clean up development environment
Install client and server JS packages (separately in the respective
node_modules
folders) by running yarn install
in server/
and client/
,
respectively.
Install and run MongoDB in a Docker container:
docker run -d --name mongodb -p 27017:27017 mongo
Data will be stored in the container. MongoDB image will be downloaded, and the
service will be running at http://localhost:27107
. Start both servers with
cd server && yarn server
cd client && yarn start
Afterwards, the application should be accessible at http://localhost:8000
. When
development is finished, you can remove the MongoDB docker.
Start a nix-shell
in the project root directory. The shell definition will
be based on default.nix
. Otherwise proceed as above.