Skip to content

nayracoop/nayra-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nayra-cli

Command line tool for boilerplating commonly-used code structures.

license GNU General Public License v3.0release version 0.0.0

This project doesn't have any published versions yet

Currently nayra-cli has scripts for creating from scratch a ready-to-use REST API folder structure with admin user, and adding resources to it. You can see the base API code in nayra-cms-api

Installation

Clone repo, run npm install to install dependencies and then npm link to access all nayra-cli scripts globally.

Pre-requirements

To run the API project created with this tool, you must have Node v^8.16.0 and MongoDB v^3.4.20 installed globally on your computer.

Usage

Creating a new API project

⚡To create a new API folder structure inside root directory run nayra-cli init-api and provide information about project to be created.

⚡Inside created directory, create a .env file copying .env-example replacing the information with your environment information and JWT secret key.

⚡ Run npm install and then npm run migrations so a super-admin user is created onto DB with provided username and password.

⚡Then run npm run dev to start the API in dev environment! That's it! You can login with the username and password provided on init.

Creating new resources on the project

⚡To create new resources inside API (with model, endpoints and tests), run nayra-cli add-resource and provide information about new entity's name and model's fields names and types. The new resource's folder gets created in the /api folder, with model, basic controller, endpoints and tests. Also routes are registered in the routes index. You can start creating and managing new resources with your user account logged in right away!

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

[GPL-3.0] GNU General Public License v3.0

Releases

No releases published

Packages

No packages published