Giter VIP home page Giter VIP logo

api-menu-crous's Introduction

icon API Menu Crous

Github Version Github License Github Last Commit Github Issues

Python Version

Author

This app is used to create an API for many Crous restaurants in Strasbourg.

๐Ÿงพ Table of Contents

  1. ๐Ÿ‹ Docker
  2. ๐Ÿ”ง Normal Setup with Python
  3. ๐Ÿš€ Launch with Python
  4. ๐Ÿ“ How to use it
  5. ๐Ÿž Bugs and TODO

๐Ÿ‹ Docker

A Docker file is provided to make the installation easier. You NEED to create configuration file name .env (you can use the .env.example file as a template) :

# URL of the API
HOST=0.0.0.0

# URL of the ILLKIRCH menu website
ILLKIRCH=

# URL of the CRONENBOURG menu website
CRONENBOURG=

# URL of the PAUL APPELL menu website
PAUL_APPELL=

# URL of the Esplanade menu website
ESPLANADE=

# URL of the Gallia menu website
GALLIA=

To use it, you can build the Docker image an runing it :

docker build -t api-menu-crous .
docker run -p <WANTED_PORT>:5000 --env-file .env -d api-menu-crous

Or you can use the Docker image from the Docker Hub :

docker pull ghcr.io/loskeeper/api-menu-crous-docker:latest
docker run -p <WANTED_PORT>:5000 --env-file .env -d ghcr.io/loskeeper/api-menu-crous-docker:latest

๐Ÿ”ง Normal Setup with Python

Many libraries are needed to make this bot work :

pip install -r requirements.txt
Info

If you have some troubles with the installation of the pycurl library, make sure to have installed the libcurl4-openssl-dev and the libssl-dev packages :

sudo apt install libcurl4-openssl-dev libssl-dev

To configure the api, you need to create configuration file name .env (you can use the .env.example file as a template) :

# URL of the API
HOST=

# URL of the ILLKIRCH menu website
ILLKIRCH=

# URL of the CRONENBOURG menu website
CRONENBOURG=

# URL of the PAUL APPELL menu website
PAUL_APPELL=

# URL of the Esplanade menu website
ESPLANADE=

# URL of the Gallia menu website
GALLIA=

๐Ÿš€ Launch with Python

To launch the bot, you need to run the main.py file :

python3 main.py

๐Ÿ“ How to use it

To use it, you need to connect to the API URL you have configured in the .env file with the port 5000. The accessibles URL are :

  • / : Display the available routes
  • /illkirch : Display the menu of the ILLKIRCH restaurant
  • /cronenbourg : Display the menu of the CRONENBOURG restaurant
  • /paul-appell : Display the menu of the PAUL APPELL restaurant
  • /esplanade : Display the menu of the ESPLANADE restaurant
  • /gallia : Display the menu of the GALLIA restaurant

An example of the output for the /illkirch route can be find in the example.json file.

๐Ÿž Bugs and TODO

  • Add threads to make the answer faster

api-menu-crous's People

Contributors

loskeeper avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.