How to Make a MERN App in 3 Steps
ReactJS is in ascendancy right now, as Facebook takes ever more of Google’s front end market share. AutoApp is a tool I wrote to help automate building a new MERN app. I’m going to show you how to use AutoApp to generate an app in under 5 minutes.
AutoApp apps have…
You’ll need a couple of assets before we begin. Gather yourself a banner image (banner.png) and a favicon (favicon.ico) and let’s get started.
Step 1. Clone
Clone the repo into your empty project directory. Don’t forget the trailing dot!
$ git clone http://github.com/jasmyn/AutoApp.git .
Step 2. Configure
Edit the config object at the top of aa.js. Set the app name and where the assets are located.
The asset directory defaults to a subdirectory within your project folder called assets/ so you can just put your banner.png and favicon.ico in there and be done with it. If you don’t replace them the placeholder assets will be used.
Step 3. Create
This can take several minutes while it installs the dependencies.
$ node aa
Now just build and start!
$ npm run build
$ npm start
You now have a working MERN app on localhost:9090.
(Step 4.) Cleanup
Now that everything’s working nicely, take a few seconds to clean up a bit.
- Erase aa.js and assets/
- Reinitialize or delete .git/
Features
- Complete MERN setup
- REST API back-end
- Server on :9000
- Client on :3000
- Mongoose
- React Router
- If you get an error about not being able to connect to the database make sure mongod is running.
Jasmyn Weatherhead has made hundreds of apps. If you need help with yours she’d love to hear from you. weatherheadco.de