Nuxt starter PWA integrated with mongoose-auto-api ☕ Automatically create a fully functioning CRUD web app and backend Rest API by simply defining your Mongoose models.
# clone this repository
$ git clone [email protected]:edmundpf/nuxt_mongoose_pwa.git
# install dependencies
$ npm install
# serve with hot reload
$ npm run dev
# build for production and launch server
$ npm run build
$ npm run start
# generate static project
$ npm run generate
For detailed explanation on how things work, check out Nuxt.js docs.
# start setup cli
$ npm run setup
- Add your models by adding your Mongoose models in the /models directory in the root of your project
- The API is designed for use with Strings, Numbers, Arrays, Dates, and Booleans.
- This is intentional for a more relational approach to the database in which models can be joined together using MongoDB's $lookup functionality instead of opting for nested objects within documents. This feature is built in to the API.
- Model Setup - mongoose-auto-api.info
# start rest api
$ npm run api
- Use the Rest API to populate and access your data in any language of choice using web requests OR...
- Use the consumer module for Node.js to easily interface with your data with pre-built methods
- You can test your own custom components alongside the included CRUD app in dev mode
- Serve in production mode when ready
- The Web App/Rest API will be served according to your appConfig.json specifications (which can be edited with the CLI)
- Your secret key must be created first with the CLI or via the API to add a user, this is for security purposes
- Create a user using your secret key
- Click the Data Models option in the menu. Your collections will be automatically populated.
- Click a collection to view/edit your data
- Click the Create button
- Click the pencil icon for the respective item
- Click the eye icon for the respective item
- Click the trash icon for the respective item
- The API and Web app automatically parse comma-separated strings into an array during document creation
- i.e.
apples,pears -> ['apples', 'pears']
- i.e.
- The push option pushes items into the array, regardless of if the item is unique or not
- The unique option pushes only unique items into the array
- The unique option pushes only unique items into the array
- The create, update, and delete dialogs will display error feedback from the database
- Items can be queried with a number of operators
- See the find endpoint in the Rest API documentation for a list of operators
- Click the Filter button to launch the filter dialog
- Click the Add Filter button to add a filter
- Filters can be removed by hitting the X button for the respective filter
- Click apply to apply all of the filters to the data
- Reset filters and get all data by clicking the Reset button
- Auth options can be accessed in the menu
- Please add any issues, feedback, or suggestions to the Issue Tracker
- Submit a pull request to contribute, any contributions are welcome