An open API service indexing awesome lists of open source software.

https://github.com/izzypt/got_api

Building a mini app with basic CRUD.
https://github.com/izzypt/got_api

Last synced: 4 months ago
JSON representation

Building a mini app with basic CRUD.

Awesome Lists containing this project

README

          

# GoT_API

### Description

As we are fans of Game of Thrones, we would like to have an application that can
show the great houses of the Seven Kingdoms with a few members.
The application will have two distinct entities: houses and members. Each house
represents a family: Stark, Lannister, Baratheon, etc) and members must belong to a house -
Ned Stark belongs to House Stark.

### Functionality:

The API must include CRUD (Create Remove Update Delete) operations for both entities
with validation - you can’t leave members without a house!
When fetching a house, the API should also be able to return all its members and when
fetching a member the API should return the data of the house (s)he belongs to.

## FrontEnd Result





## Backend GraphQL API





## Starting backend
1 - Create virtual environment to keep our dependeciens isolated and avoid packages conflicts

python3 -m venv venv

2 - activate virtual env

ubuntu/Mac -> "source venv/bin/activate"
Win -> ".\venv\Scripts\activate"

3 - Install DJango

$ python -m pip install Django

4 - Install Graphene

$ pip install graphene-django

5 - Install corsheaders to request from different domain than the one that served the web page

pip install django-cors-headers

5 - Output a file to save/track our current packages

$ pip freeze > requirements.txt
Later we can install the same packages from it using : pip install -r requirements.txt