0.0.34 • Published 1 year ago

coquito-cli v0.0.34

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

Coquito-CLI

Read Documentation for Coquito Framework here

Installing

npm install -g coquito-cli

newbasicproject

Create a new Coquito Project from the base template with the following command.

coquito newbasicproject

you can also specify the folder name like so:

coquito newbasicproject folderName

newbasicproject

Create a new Coquito Project from the Typescript template with the following command.

coquito newtsproject

you can also specify the folder name like so:

coquito newtsproject folderName

scaffold

create an empty directory and create a "scaffold.js" that looks like this:

{
    "graphql": false,
    "rpc": false,
    "routers": [],
    "models" : ["Dog", "Cat"]
    "bodyparsers": false,
    "views": "hamlet",
    "port": 4444,
    "host": "0.0.0.0",
    "static": false,
    "package": {
        "name":"my-app",
        "description": "this is my-app",
        "author": "Alex Merced",
        "email": "alexmerced@alexmerced.dev",
        "repo": "http://github.com/..."
    },
    "db": "sql-sqlite3",
    "auth": "sql",
    "logging": true,
    "methodOverride": true
}

Then run the command

coquito scaffold

You project will be scaffolded in the directory. If the config file is somewhere else or under a different name can specify location like this:

coquito scaffold ./scaffold/config.json

  • Supported View Engines "ejs", "pug", "hbs", "liquid", "nunjucks", "mustache","twig","hamlet"

  • If you don't need a view engine, just assign false or don't include the property

  • values for auth can be "sql" or "mongo", all other values will be ignored an no auth will be added.

  • "methodOverride" property will let you override method on form requests by adding a url query in the formal of ?_method=DELETE in the form action attribute.

  • "logging" will add the morgan logging middleware.

  • "routers" will add just a blank controller for each endpoint, "models" will create a model file, rest routes and a router for each model specified.

  • If you have a static folder and graphql or rpc turned on a "clients.js" will be created that provides some basic frontend GraphQL and SimpleRPC clients to use in your frontend code.

  • You can prepopulate the DATABASE_URL env variable with the dburi property in your scaffold.json

  • the SECRET env variable will be pre-populated with a random UUID, feel to change it if you like.

  • You can prepopulate auth with "auth":"mongo" or "auth":"sql" and if done at time of scaffolding the sessions and cookieParser middeware will be pre-registered. Read the comments in ./auth/functions.js

add-mongo

Scaffold connection file for using mongo

coquito add-mongo

add-mongo-model

Scaffold a mongo model file.

coquito add-mongo-model Dog

add-rest-routes

Add a new controller file with Index, Show, Create, Update and Delete routes scaffolding for easy CRUD route building.

coquito add-rest-routes dog

add-sql

Scaffold a Sequalize connection file for connecting to sql databases. Install sequelize and libraries for specified database.

coquito add-sql sqlite3

database options

["pg", "mysql2", "sqlite3", "mariadb", "oracledb", "MSSQL"]

add-auth

These commands will do the following to speed up implementing auth:

  • Generate a User Model
  • install bcryptjs, express-session and jsonwebtoken
  • create ./auth/functions.js which will have several functions that you can use to compose JWT to session based auth in your Rest/RPC/Graphql APIs

add-auth-mongo

add-auth-sql

0.0.34

1 year ago

0.0.33

1 year ago

0.0.32

1 year ago

0.0.31

1 year ago

0.0.29

1 year ago

0.0.28

1 year ago

0.0.27

1 year ago

0.0.26

1 year ago

0.0.25

1 year ago

0.0.24

1 year ago

0.0.23

1 year ago

0.0.22

1 year ago

0.0.21

1 year ago

0.0.20

1 year ago

0.0.19

1 year ago

0.0.18

1 year ago

0.0.17

1 year ago

0.0.16

1 year ago

0.0.15

1 year ago

0.0.14

1 year ago

0.0.13

1 year ago

0.0.12

1 year ago

0.0.11

1 year ago

0.0.10

1 year ago

0.0.6

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago