Giter Site home page Giter Site logo

patrickcmd / django-rest-api-yummy-recipes Goto Github PK

View Code? Open in Web Editor NEW
2.0 4.0 0.0 60 KB

The innovative -----yummy recipes app----- is an application that -----allows users to create, save and share ----- meeting the needs of -----keeping track of awesome food recipes-----.

License: MIT License

Python 100.00%
django django-rest-framework jwt-authentication jwt-token postgresql-database rest-api django-rest-swagger coreapi

django-rest-api-yummy-recipes's Introduction

DJANGO REST API YUMMY RECIPES

CircleCI Coverage Status Maintainability Test Coverage

The innovative -----yummy recipes app----- is an application that -----allows users to create, save and share ----- meeting the needs of -----keeping track of awesome food recipes-----.

TECHNOLOGIES USED

  • Python3.6: Python is a programming language that lets you work quickly and integrate systems more effectively
  • Django 1.11: Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
  • Django REST framework: Django REST framework is a powerful and flexible toolkit for building Web APIs
  • Django REST framework JWT: Django REST framework JWT This package provides JSON Web Token Authentication support for Django REST framework.
  • Django REST Swagger: Django REST Swagger An API documentation generator for Swagger UI and Django REST Framework.
  • Postgresql: PostgreSQL is a powerful, open source object-relational database system.
  • Pipenv: Pipenv is a tool that aims to bring the best of all packaging worlds (bundler, composer, npm, cargo, yarn, etc.) to the Python world.
  • Psycopg2: Psycopg is the most popular PostgreSQL adapter for the Python programming language.

SETTING UP THE PROJECT

Clone the project

$ git clone https://github.com/PatrickCmd/django-rest-api-yummy-recipes.git
$ cd django-rest-api-yummy-recipes

Active the virtual environment

$ pip install pipenv
$ pipenv shell

Install the requirements

$ pipenv install

SETTING UP THE DATABASE

Execute the commands in the terminal/console as stated below

ON WINDOWS

Follow the Link on how to download and install postgres(>=10) on windows platform

Create Database

$ psql -U postgres
$postgres# CREATE DATABASE {dbname};  Where dbname is the database name

Setup Database URL environment variable

$ SET DB=postgres
$ SET DB_NAME={dbname} Where dbname is the database name for the postgres instance
$ SET DB_USER={dbuser} Where dbuser is the database user for the postgres instance

ON MAC/UBUNTU

Install postgres

MAC Users

$ brew install postgres

Follow the link on how to setup brew if not yet installed

Ubuntu users

Follow the Link on how to setup and install postgres(>=10) on Ubuntu-linux platform

Create Database

$ psql -U postgres
$ postgres# CREATE DATABASE {dbname};  Where dbname is the database name

Setup Database URL environment variable

$ export DB=postgres
$ export DB_NAME={dbname} Where dbname is the database name for the postgres instance
$ export DB_USER={dbuser} Where dbuser is the database user for the postgres instance

Run the server

$ python manage.py runserver_plus

Execute the url localhost:8000/api in your browser

Run tests

Execute this command at the terminal

$ python manage.py test

Functionality(endpoints)

Endpoint Functionality Access
POST /auth/users/register Registers a user PUBLIC
POST /auth/users/login Logs a user in PUBLIC
GET /auth/users List registered users PUBLIC
POST /api/categories Creates a new recipe category PRIVATE
GET /api/categories Lists all created recipe categories PRIVATE
GET /api/categories/{id} Gets a single recipe category with the suppled id PRIVATE
PUT /api/categories/{id} Updates recipe category with the suppled id PRIVATE
DELETE /api/categories/{id} Deletes recipe_category with the suppled id PRIVATE
POST /api/recipes Creates a new recipe PRIVATE
GET /api/recipes List all recipes PRIVATE
PUT /api/recipes/{id} Updates a recipe item PRIVATE
DELETE /api/recipes/{id} Deletes arecipe in a recipe category PRIVATE
GET /api/categories/{category_pk}/recipes GET recipes in a category PRIVATE
POST /api/categories/{category_pk}/recipes Create recipes in a category PRIVATE
GET /api/categories/{category_pk}/recipes/{id} GET single recipe in a category PRIVATE
PUT /api/categories/{category_pk}/recipes/{id} Update a recipe in a recipe category PRIVATE
DELETE /api/categories/{category_pk}/recipes/{id} Deletes a recipe in a recipe category PRIVATE
GET /api/public-recipes/ GET public recipes PUBLIC
GET /api/public-recipes/{id} GET a single public recipe PUBLIC
GET /api/public-recipes/{id}/reviews GET posted reviews for a single public recipe PUBLIC
POST /api/public-recipes/{id}/reviews Created a review for a single public recipe PUBLIC
GET /api/public-recipes/{id}/upvotes GET upvotes for a single public recipe PUBLIC
POST /api/public-recipes/{id}/upotes Up-vote for a single public recipe PRIVATE

API Documentation

Visit the links below for the API documentation

CoreApi Documentation

Swagger Documentation Login with username: normaluser password: normaluser1234 for complete swagger-docs

API Schema

Live API

Vist this Link for the live application.

django-rest-api-yummy-recipes's People

Contributors

patrickcmd avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

django-rest-api-yummy-recipes's Issues

settings.py

Not so many people do it but i think you need to decouple your settings config

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.