Solvro / backend-topwr-sks

SKS Menu Scraper is a tool designed to automatically fetch and parse information about canteen menus, such as dish names, portion sizes, and prices. The project saves the scraped data into a database and provides a RESTful API for users to access menu items
GNU Affero General Public License v3.0
9 stars 0 forks source link
charts csv food menu pwr sks solvro student students wust

SKS Menu Scrapper

Solvro banner Solvro banner

Description

SKS Menu Scraper is a tool designed to automatically fetch and parse information about canteen menus, such as dish names, portion sizes, and prices. The project saves the scraped data into a database and provides a RESTful API for users to access menu items.

The SKS Menu Scraper also includes a feature that acts as a wrapper for external API to handle and track the number of canteen users - source.

Endpoints

The API is available at sks-api.topwr.solvro.pl. The following endpoints are available at the moment:

Development

  1. Clone the repository:

    git clone https://github.com/Solvro/backend-topwr-sks.git
    cd backend-topwr-sks
  2. Install the required dependencies:

    npm install
  3. Set up the PostgreSQL database:

    • Ensure PostgreSQL is installed and running.
    • Create a new database.
    • Update the .env file with your PostgreSQL credentials and database name.
  4. Set up the environment variables in the .env file using the .env.example template.

  5. Run migrations to create the database schema:

    node ace migration:run
  6. Run scheduler for scrapper:

    node ace scheduler:run
    # or
    node ace scheduler:work

    Alternatively run scraping script once and individually:

    node ace scrape:menu
    node ace scrape:users
  7. Start the development server:

    npm run dev
  8. Access the data using:

    curl -X GET http://localhost:3333/api/v1/meals

Technologies

Database Schema

schema schema2