AutoApp is a MERN app scaffolding generator.
It makes new MERN apps.
Right? Just feed it some assets and watch it go...
Clone the repo into your empty project directory. Don't forget the trailing dot!
$ git clone http://github.com/jasmyn/AutoApp.git .
Edit the config object at the top of aa.js.
config key | description |
---|---|
name | The site/app name. |
yarn | True installs dependencies with yarn. False uses npm. |
dbNounSingular | The thing you're using the db to store. |
dbNounPlural | The plural of the thing you're using the db to store. |
dbSchema | The db field names, types and if they're required. |
title | Set this to the schema field you wish to use as the title |
Then replace the contents of assets/
with your
favicon.ico
logo192.png
logo512.png
The config.title field will be used as the records' title, meaning it will appear in the GET performed at noun/
and in the Create and Delete select boxes. This is only used for the front-end and doesn't affect the API.
$ npm install
or $ yarn install
The next step can take several minutes as AutoApp installs both client and server dependencies. It's noticably faster with yarn. If using yarn, set config.yarn to true to prevent lock file conflicts.
$ node aa
Make sure Mongo is running locally, then...
$ npm run dev
(development)
$ npm run debug
(debug)
$ npm start
(production)
Your app is live on localhost:3000
The app is backed by a REST API, served by default at localhost:9000.
GET /noun
gets all db recordsGET /noun/id
gets details of db record with that idPOST /noun
creates a new recordPUT /noun/id
updates the record with that idDELETE /noun/id
deletes that record
(noun is config.dbNounSingular)
Have fun!