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.
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
}
]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"
},
]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.
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.shto create user and database.
- Run postgres:
postgres -D /usr/local/var/postgres &- Install python version specified on
runtime.txtand run:
virtualenv -p `which python3.6` ../env- Get into the environment:
source ../env/bin/activateand 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 testsOnce we have made the first time setup, we can start everything up running:
source abidria/setup/startup.sh