Step 2
Let's explore the code organization of the starter app:
.
├── README.md
├── assets
│ └── style.css
├── data
│ └── db.js
├── index.js
├── model
│ └── User.js
├── package-lock.json
├── package.json
└── views
├── alert.njk
├── base.njk
├── dashboard.njk
├── index.njk
└── register.njk
4 directories, 12 files
This is a NodeJS/Express application which uses Nunjucks as template engine. There are three primary views:
index.njk
dashboard.njk
register.njk
Feel free to explore these in the views
folder.
The application also includes a model
and a data
folder.
- The
model
folder includesUser.js
which exposes amongoose.model
for representing a "user" in our application as well as performing CRUD operations on users. - The
data
folder containsdb.js
which encapsulates the logic to connect to our MongoDB instance.