apico
v2.1.3
Published
> **Apico** is not a framework. It is a tool that help you to speed up the development of > projects build on **Express JS**
Downloads
651
Readme
Apico
Apico is not a framework. It is a tool that help you to speed up the development of projects build on Express JS
Apico 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 Apico. This will create a folder under the frontend/dist/
folder.
Quick start
To start building your project you need first to install Apico by running:
npm install apico
Then you will use CLI provided by Apico to build project and to add applications to your project.
Build a project.
To initiate a project run the following command:
npx lh 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. Apico 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.
Apico 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 lh 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
Commands
npx apico g app <app_name>
This will create an app template for younpx apico g mw <middleware_name>
This will create an middleware template for younpx apico g event <event_name>
This will create an app even for younpx apico g local <local_name>
This will create an app local for you