Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@thebinaryfelix/create-iron-api

A CLI to generate a base structure for a REST API project.

cli, create-iron-api, generator, api, rest, educational

readme

📦 create-iron-api

A simple base structure for designing a REST API.

This package creates a simple API demo, using as context an API that serves data about galaxies. If you wish to know more about this demo, you can check it out on @thebinaryfelix/galaxies-api-demo.

⚙️ Installation & Usage

$ npm init @thebinaryfelix/iron-api
# or
$ npx @thebinaryfelix/create-iron-api
# or
$ npm install -g @thebinaryfelix/create-iron-api
$ create-iron-api

Quick Start

Create the project with default name iron-api and install dependencies:

$ create-iron-api --yes --install

💡Use a custom folder name and install dependencies manually:

$ create-iron-api project-name
$ cd project-name
$ npm install

🚀 Run the created project

On project-name root folder

$ npm start

Open http://localhost:3000/api-docs to see API documentation.

🔴 Important

For this demo API to work properly, you need MongoDB Community Edition ^4.2 running on your machine.

Command Line Options

This generator can also be configured with the following flags.

-g, --git         initialize Git
-i, --install     install dependencies
-y, --yes         skip prompts

🧩 Project structure

iron-api/
├── api
│   ├── config
│   │   ├── swagger.js
│   ├── controllers
│   │   ├── galaxy.controller.js
│   ├── models
│   │   ├── galaxy.model.js
│   │   ├── response.model.js
│   ├── routes
│   │   ├── galaxy.routes.js
│   │   ├── index.js
│   ├── app.js
├── bin
│   ├── www
├── package.json
├── prettier.config.js
├── .prettierignore
├── .eslintrc.js
├── .eslintignore
├── .gitignore

🏆 References

🚧 Next steps

🧪 Tests

  • Add unitary tests to:
    • src/
      • <input disabled="" type="checkbox"> cli.js
      • <input disabled="" type="checkbox"> main.js
    • template/api
      • <input disabled="" type="checkbox"> controllers/*
      • <input disabled="" type="checkbox"> models/*
      • <input disabled="" type="checkbox"> routes/*
      • <input disabled="" type="checkbox"> app.js

changelog

Changelog

All notable changes to this project will be documented in this file. See standard-version for commit guidelines.

1.0.2 (2019-08-23)

1.0.2-alpha.1 (2019-08-23)

1.0.2-alpha.0 (2019-08-23)