Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/danielivanovz/recipe-server

A NodeJS, Express, and MongoDB REST API to deliver recipes scraped with Recipe Scraper
https://github.com/danielivanovz/recipe-server

mongodb nodejs pino recipe-scraper typescript

Last synced: about 2 months ago
JSON representation

A NodeJS, Express, and MongoDB REST API to deliver recipes scraped with Recipe Scraper

Awesome Lists containing this project

README

        

recipe server

A NodeJS, Express and MongoDB REST API to deliver recipes scraped with Recipe Scraper




## Installation

Run the following script in your terminal, it will create a folder containing the script and install dependencies.

```sh
git clone --depth=50 --branch=main https://github.com/heyiamZer0/recipe-server.git heyiamZer0/recipe-server recipe-server && cd heyiamZer0/recipe-scraper && yarn
```
create your .env file:

```sh
vim .env
```
press `i` to start insert mode and define your enviroment variables:

* URI = `mongodb+srv://databaseMongo:[email protected]/DATABASE?retryWrites=true&w=majority`
* PORT = `<#PORT to run the server at>`
* DB_NAME = `MONGO_DATABASE_NAME`
* DB_COLLECTION = `MONGO_DATABASE_COLLECTION`

to exit and save, hit `esc` and `:wq`

## Start the server

```sh
yarn devTS
```

## Usage

Example for `GET` /id with ID `1234` on the local database using the recipes scraped with [Recipe Scraper][recipe-scraper] will return:

[recipe-scraper]:https://github.com/heyiamZer0/recipe-scraper

```typescript
{
_id: 1234
title: String
image: String
ingredients: [{
ingredient: String
quantity: String
}]
description: [{
step: Number
instructions: String
}]
calories: null || Number
category: String
difficulty: String
time: Number
}
```

## Built With
* [NodeJS][nodejs] - runtime environment
* [Express][express] - framework
* [MongoDB][mongodb] - mongodb native driver
* [TypeScript 4.0][typescript] - codebase
* [Pino][pino] - logging

[nodejs]:https://github.com/nodejs/node
[express]:https://github.com/expressjs/express
[mongodb]:https://github.com/mongodb/node-mongodb-native
[typescript]:https://github.com/microsoft/TypeScript
[pino]:https://github.com/pinojs/pino

## Related projects

- [Recipe Scraper][recipe-scraper]
- [Recipe React App][react-app]

[recipe-scraper]: https://github.com/heyiamZer0/recipe-scraper
[react-app]: https://github.com/heyiamZer0/recipier-react

## License

Distributed under the MIT License. See `LICENSE` for more information.