1.1.10 • Published 1 year ago

app-fab v1.1.10

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

app-fab

app-fab is not a framework. It is a tool that help you to speed up the development of projects build on Express JS

app-fab will build for you a project with specific folder structure. Every folder in this project will be used in defferent parts in this project. So, for instance, if you want to add a new route that will run a HTML page you just need to run a CLI provided by app-fab. This will create a folder under the frontend/dist/ folder.

Quick start

To start building your project you need first to install app-fab by running: npm install app-fab

Then you will use CLI provided by app-fab to build project and to add applications to your project.

Build a project.

To initiate a project run the following command: npx af init This will create all default folder for you.

The project structure

frontend/dist/apps/ :

This will have all your frontend app files.
	

You should probably wondered waht is an app. Every route that will actualy render a HTML file is calling app. You don't need to build separate route for separate HTML page. app-fab usese folder structure for rendring HTML/CSS/JS file for you. So, as you noticed, every app will have at least thre files: HTML, CSS and JS.

frontend/shared/:

This folder consists of tow subfolders: layouts and partials. Those folders ar used for keeping your
layouts nad partials that will be used with EJS.

routes/:

Here you can add your routes. You can devid routes in several files or just keep them in one file.
app-fab will include those routes in your project automatically.

middlewares/:

Add middlewares for ExpressJS application.

locals/

Here you can JS files that will export functions/variables to be used in your .ejs files.

Add a new app:

To add a new app run the following command: npx af app <app_name>

This will create a <app_name> folder under frontend/dist/apps folder with all default files.

Run the project

To start the project run: node index