This is a template project demonstrating how the MERN stack(Mongo, Express, React, Node) can be used, here we have the back end implementation and there is the React implementation as the front end. Here I use the layered architecture, basically it is a REST API to provide the data to the front end. This API is not RESTFul as it does not implement HATEOAS.
Front-End: MERN Stack React
Functionalities • Prerequisites • Running • Technologies • Author
- Database connection.
- Create the database access layer.
- Create the service layer.
- Create the routing layer.
- Create the GET(All and by id), POST, PUT and DELETE methods.
Before you start, you will need to have the following tools installed on your machine: Git, Node.js, MongoDB. In addition it is good to have an editor to work with the code like VSCode.
# Clone this repository
$ gh repo clone DouSam/MERN_STACK
# Go to the project folder in terminal/cmd
# Install the dependencies
$ npm install
# Create the config.env file in the pattern below
HOST=127.0.0.1
PORT=2890
MONGO_URI=mongodb://127.0.0.1:27017/
DB_NAME=DBNAME
# Run the application
$ npm start
# The server will start on the port entered in the config.env file - go to <http://localhost:<PORT>>
The following tools were used in the construction of the project:
- Add HATEOAS.
- Add checks to the routingTrains file to return the correct code.
Made with ❤️ by Douglas Samuel!