This repository contains the NuxtJS frontend and Nitro backend for fetching, updating, and displaying lunch menus from various restaurant APIs on the Oulu University campus. The menus are stored in a MongoDB database and can be accessed via an API endpoint.
- Fetches lunch menus from multiple restaurant APIs.
- Periodically updates the menus in the MongoDB database.
- Provides an API endpoint to retrieve the compiled list of menus.
- Displays the lunch menus on a NuxtJS frontend.
| Variable | Description | Default |
|---|---|---|
| NUXT_DB_URL | MongoDB connection URL | mongodb://127.0.0.1:27017 |
| NUXT_DB_NAME | MongoDB database name | ou-lunch |
| NUXT_HERO_CORE_URL | Url to a hero cloud instance | 127.0.0.1:1818 |
| OPENAI_API_KEY | OpenAI API key |
Retrieves a list of restaurants with their menus for today and future dates. view in browser
| Parameter | Type | Required | Description |
|---|---|---|---|
| city | string | No | Filter restaurants by city. If provided, campus must also be provided. |
| campus | string | No | Filter restaurants by campus. If provided, city must also be provided. |
Returns a JSON array of restaurant objects. For the detailed type definition, see types.ts.
- 404 Not Found: No restaurants found with the given parameters.
- 500 Internal Server Error: Failed to get menus.
The frontend for this project is built with NuxtJS and is hosted at ouf.fi.
Parts marked with * are only needed if developing the non-normal opening hours feature.
- Run
npm installin the root directory to install the dependencies. - *Run
npm run start:cloudto start the Ulixee Cloud instance. - Run
npm run start:dbto start the MongoDB database on Docker. You must have Docker installed. - Run
npm run devto start the NuxtJS frontend in development mode. - *To update the opening hours, visit
localhost:3000/_nitro/tasks/updateHoursin your browser.
Contributions are welcome! Please fork the repository and submit a pull request.
This project is licensed under the MIT Licence. See the LICENCE file for details.
