Skip to content

nhatthinh/abidria-api

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Abidria API

This repo contains the backend code for Abidria project. This simple app aims to be a reference to discover interesting places and also to record our past experiences, sharing content with other people.

Application domain is composed by scenes, which are defined as something that happened or can be done/seen in a located place. A group of scenes are defined as an experience.

API Endpoints

GET /experiences/

Response:

[
    {
        id: "2",
        title: "Baboon",
        description: "Mystical place...",
        picture: {
            small_url: "https://experiences/8c29.small.jpg",
            medium_url: "https://experiences/8c29.medium.jpg",
            large_url: "https://experiences/8c29.large.jpg"
        }
    },
    {
        id: "3",
        title: "Magic Castle of Lost Swamps",
        description: "Don't even try to go there!",
        picture: null
    }
]

GET /scenes/?experience=<experience_id>

Response:

[
    {
        id: "5",
        title: "Plaça Mundial",
        description: "World wide square!",
        picture: {
            small_url: "https://scenes/37d6.small.jpeg",
            medium_url: "https://scenes/37d6.medium.jpeg",
            large_url: "https://scenes/37d6.large.jpeg"
        },
        latitude: 1.000000,
        longitude: 2.000000,
        experience_id: "5"
    },
    {
        id: "4",
        title: "I've been here",
        description: "",
        picture: null,
        latitude: 0.000000,
        longitude: 1.000000,
        experience_id: "5"
    },
]

Documentation

This project has been developed using Django framework, with Postgres as database and S3 as storage service.

Code structure follows a Clean Architecture approach (explained in detail here), emphasizing on code readability, responsibility decoupling and unit testing.

Setup

Follow these instructions to start working locally on the project:

  • Download code cloning this repo:
git clone https://github.com/jordifierro/abidria-api.git
  • Install postgres and run:
./abidria/setup/postgres.sh

to create user and database.

  • Run postgres:
postgres -D /usr/local/var/postgres &
  • Install python version specified on runtime.txt and run:
virtualenv -p `which python3.6` ../env
  • Get into the environment:
source ../env/bin/activate

and install dependencies:

pip install -r requirements.txt
  • Migrate database:
python manage.py migrate
  • Create django admin super user:
python manage.py createsuperuser
  • Finally, you should be able to run unit and integration tests:
pytest                # python tests
python manage.py test # django tests

Once we have made the first time setup, we can start everything up running:

source abidria/setup/startup.sh

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 97.4%
  • Shell 2.6%