Skip to content

README.md โ€‹

From Week 4 in-class: REST layers ยท original: si-679-f-26-week-04-nyt-jessicadonoho/README.md ยท all files in this project

md
# Week 4 starter โ€” REST layers

Everything is installed; nothing is written yet. To get going:

```bash
npm install
```

`sampleData/` holds the two JSON files the lecture imports into MongoDB with
Compass: `products.json` and `customers-with-ids.json`.

You will build these folders under `src/` as the lecture goes, from the
database upwards:

```
src/
โ”œโ”€โ”€ db/            manage access to the database
โ”œโ”€โ”€ models/        data structures that represent resources
โ”œโ”€โ”€ services/      application logic
โ”œโ”€โ”€ controllers/   handle requests and responses
โ”œโ”€โ”€ routes/        map endpoints to controllers
โ”œโ”€โ”€ middleware/    general processing for routes
โ”œโ”€โ”€ app.ts         builds the app and exports it
โ””โ”€โ”€ index.ts       connects to the database, then opens the port
```

The scripts are the same as week 3: `npm run dev`, `npm test`,
`npm run typecheck`, `npm run build` then `npm start`. How the project was
put together is in week 3's `SETUP.md`.