Before we dive directly into the code, we will understand how the directories structure of Keystone works.
After starting the application, we will have the following result:
Here's a description of what makes each directory/folder:
Folder Name |
Folder Path |
Description |
Models |
/models/ |
Application database Models. |
Public |
/public/ |
Images, JavaScript, Stylesheet, and fonts. |
Routes |
/routes/
/routes/views
|
View controllers (On Restful API we can use a folder called API). |
Templates |
/templates/
/templates/emails/
/templates/layouts/
/templates/mixins/
/templates/views
|
Application views templates. |
updates |
/updates/ |
Migration scripts and database population. |
Also, we have in the root folder the following files:
.editorconfig: Setting the editor's indentation
.env: Setting Cloudnary Cloud credentials
.gitignore: Ignore files for Git Source Control
gulpfile.js: Application tasks
keystone...