bootstrap-express-api-app

0.1.2 • Public • Published

Bootstrap Express API App

...quick bootstrapping tool.

Bootstrap Express API App is a CLI tool that understands the need for speed and helps to quickly scaffold node.js/express API application boilerplate.

Installation

You'll need to have Node.js installed on your local development machine.

Using npm (the recommended way):

Local Installation (Recommended)

With a local installation, bootstrap-express-api-app will not be available in your system path. Instead, the local installation can be run by using npx bootstrap-express-api-app.

# initiate setup
npx boostrap-express-api-app

# after setup is complete
cd [app-name]
npm run server

The server will run on port 5000. Go to http://localhost:5000/ to see your app.

Using the Local Installation will ensure that you are using the latest version of the tool.

Global Installation

Run the below in your terminal.

# install globally
npm install -g bootstrap-express-api-app

And Bootstrap Express API App will be installed globally to your system path.

In your terminal still, run the following to kick-start the setup.

# initiate setup
bootstrap-express-api-app

# after setup is complete
cd [app-name]
npm run server

The server will run on port 5000. Go to http://localhost:5000/ to see your app.

Boilerplate Structure

Bootstrap-Express-API-App will create a directory called [app-name] (or whatever you name your app) inside the current folder.
Inside that directory, it will generate the initial project structure and install the transitive dependencies:

[app-name]
├── node_modules
├── package.json
├── .gitignore
├── .env
├── vercel.json
├── info.txt
├── index.js
|
├── config
│   └── keys.js
|
├── controllers
│   ├── authController.js
│   ├── blogController.js
│   └── userController.js
|
├── middleware
│   └── auth.js
|
├── models
│   ├── BlogPost.js
│   └── User.js
|
└── routes
    └── api
	    ├── auth.js
	    ├── blogposts.js
	    └── users.js

No configuration or complicated folder structures, only the files you need to build your API app.
Once the installation is done, you can open your project folder:

cd [app-name]

Inside the newly created project, you can run some built-in commands:

npm start

Runs the app in development mode but without the Nodemon's restart feature.

npm run server

Runs the app in development mode with restart feature.
Open http://localhost:5000 to view it in the browser.

The server will automatically restart if you make changes to the code.
You will see the errors & warnings in the console.

What’s Included?

Your setup project will have almost everything you need to build a clean API application:

  • Vercel config, so you can easily deploy to your API app to Vercel.
  • MVC file structure.
  • MongoDB ORM integration (Mongoose).
  • Authentication setup.
  • A development server that warns about common mistakes (Nodemon).

Contributing

I'd love to have your helping hand on bootstrap-express-api-app! If you happen to find any bug while using this tool or you have a feature request, do well to create an issue.

License

Bootstrap Express App is open source software licensed as MIT.

Author

Gideon Idoko

Package Sidebar

Install

npm i bootstrap-express-api-app

Weekly Downloads

0

Version

0.1.2

License

MIT

Unpacked Size

27.1 kB

Total Files

19

Last publish

Collaborators

  • iamgideonidoko