This project provides public and private APIs for recipes, ingredients and tags endpoints. Client can perform CRUD operations on resource based on authentication and authorization
API URL:
base: http://127.0.0.1:8000/
endpoints:
admin/
api/user/ create/ [name='create']
api/user/ token/ [name='token']
api/user/ me/ [name='me']
api/recipe/
Install following application as per your operating system
-
Make the directory and move to created directory:
mkdir recipe_project
cd recipe_project -
Clone the repository
git clone [email protected]:riddam/recipe-app-api.git
- Change to the directory where docker files are present. Build the dockerfile and run docker container
docker build -t recipe-image .
or build docker compose file:
docker-compose build
- Run the application using following command:
docker-compose up
-
Create the virtual environment
virtualenv -p python3 venvorpipenv --three
and activate it:source venv/bin/activateorpipenv shell -
Install project requirement using following command:
pip install -r /requirements.txt -
Update database URI and credentials in app/app/settings.py file as per your db configuration
-
Enter following command in command prompt(or terminal) where manage.py is located
python manage.py migrate
Run the unit test and coding convention check using following command
docker-compose run --rm app sh -c "python manage.py test && flake8"
Run following command in command prompt(or terminal) where manage.py is located
python manage.py test && flake8
-
Run the application using following command for docker:
docker-compose upOtherwise run the application using below command:
python manage.py runserver -
Open web browser and type server URL with target endpoint
Example: create a new user
http://127.0.0.1:8000/api/user/create/
Retrieve token using
http://127.0.0.1:8000/api/user/token/
Distributed under the MIT License. See LICENSE for more information.