Design and implementation of an independent Menu service, serving as an online restaurant menu card.
- REST API for menu cards management.
- Create multiple menu cards with unique names.
- Each menu card can contain any number of dishes.
- Dish model: name, description, created_at, updated_at, price, preparation_time, vegan.
- Menu model: name, description, created_at, updated_at.
- API must be secured to prevent unauthorized access
- REST API for viewing non-empty menu cards.
- Ability to sort the list by name and number of dishes, using parameters GET
- Filtering the list by name and period of addition and last update
- Card detail showing all the card information and dishes in the card.
- Sending an email once a day at 10:00 to all application users
- The email contain information about new added and recently modified recipes
- Information is sending only about those recipes that have been modified in previous day.
The first thing to do is to clone the repository:
$ git clone https://github.com/kalickiPawel/eMenu
$ cd eMenu
If you are using virtualenv
, make sure you are running a python3 environment. Installing via pip3
in a v2 environment will not configure the environment to run installed modules from the command line.
To setup virtual environment follow:
python3 -m pip install -U virtualenv
python3 -m virtualenv venv
.venv\Scripts\activate
orsource .venv/bin/activate
$ pip install -r requirements.txt
To prevent the unauthorised access to our resources we need to secure sensitive data. .env file lets you customize your individual working environment variables. Below is the sample .env
file.
My app use environment variables for correct work.
Please change this data before deploy production.
Only for DEBUG
DJANGO_DEBUG=1
APP_SECRET_KEY=foo
DJANGO_ALLOWED_HOSTS=localhost 127.0.0.1 [::1]
APP_DB_ENGINE=django.db.backends.postgresql
POSTGRES_DB=postgress
POSTGRES_USER=postgress
POSTGRES_PASSWORD=postgress
DB_HOST=db
DB_PORT=5432
$ python manage.py migrate
To manage the REST API resources User account is needed.
Users could be created via admin panel but for use this panel
you need SuperUser
permissions. To create SuperUser
in Django
perform:
$ python manage.py createsuperuser --email admin@example.com --username admin
$ python manage.py runserver
Navigate to http://127.0.0.1:8000/ or http://127.0.0.1:8000/swagger/ to view documentation.
Run the docker-compose up command from the top level directory for project. (where the file is located). At first, you need to build docker-compose file next make database migrations.
$ docker-compose -f docker-compose.yml up -d --build
$ docker-compose -f docker-compose.yml exec django python manage.py migrate --noinput
Navigate to http://127.0.0.1:8000/ or http://127.0.0.1:8000/swagger/ to view documentation.
To run the tests, cd
into the directory where manage.py
is:
$ py.test