Overview:
This boilerplate repo is designed for creating new MERN stack apps. It is aimed at Full Stack MERN developers, particularly beginners. The repo provides basic configurations such as a sample CRUD API, create-react-app boilerplate, npm scripts for MERN stack, and a sample mongoose connection for connecting the API with MongoDB database. It also includes Heroku deployment configurations.
Features:
- Sample CRUD API: Includes a sample CRUD API that can be used as a starting point for building APIs.
- Create-react-app boilerplate: Provides a boilerplate code for creating a new React app using create-react-app.
- NPM Scripts: Offers various NPM scripts that are commonly used in MERN stack development.
- Sample mongoose connection: Includes a sample mongoose connection for connecting the API with a MongoDB database.
- Heroku Deployment Configurations: Provides configurations and scripts for deploying the app on Heroku.
Installation:
- Add a
.envfile in the root directory of your project and add your MongoDB URI in that file. - Run
yarn startto start the server in production mode. Openhttp://localhost:5000/api/v1/getto view the sample CRUD API output in the browser. - Run
yarn run devto start the server in development mode. Openhttp://localhost:5000/api/v1/getto view the sample CRUD API output in the browser. The server will automatically restart if you make any changes. - Run
yarn run clientto start the app in development mode. Openhttp://localhost:3000to view it in the browser. The page will reload if you make any edits. Any lint errors will be displayed in the console. - Run
yarn run mernto start both the server and the client at the same time, making MERN stack development easier. Openhttp://localhost:5000/api/v1/getto view the sample CRUD API output from the server in the browser. Openhttp://localhost:3000to view the React app in the browser.
Summary:
This boilerplate repo provides a minimalistic setup for creating new MERN stack apps. It includes essential configurations such as a sample CRUD API, create-react-app boilerplate, NPM scripts, and a sample mongoose connection. The repo also includes Heroku deployment configurations, making it easier to deploy the app on Heroku. It is recommended for beginners in Full Stack MERN development.