App to manage parking spots and make reservations
-
Clone the repository:
git clone git@github.com:gdalmau/parking_manager.git
-
Create a virtual environment with Python 3.X (in the example Python 3.7):
sudo apt install virtualenvwrapper
mkvirtualenv parking-manager -p /usr/bin/python3.7
pip3 install .
From the root of manage.py.
cd parking_manager
- Create the database
python manage.py migrate
- Load the data
python manage.py loaddata parking_app/fixtures/*.json
Run the server with:
python manage.py runserver
docker-compose up
The request body has the following content:
{
"name": "Customer name",
"phone": "123456789"
}
Returns HTTP status 201 with the information of the customer created and the ID:
{
"id": 1,
"name": "Customer name",
"phone": "123456789",
"created_at": "2019-01-01T10:00:00.000000Z"
}
Returns HTTP status 201 with all the customers information
Returns HTTP status 201 with the information of the reservation created:
{
"id": 2,
"start_datetime": "2019-12-31T10:00:00Z",
"end_datetime": "2019-12-31T12:00:00Z",
"created_at": "2019-01-01T10:00:00.000000Z",
"customer": 1,
"spot": 2
}
Returns HTTP status 201 with all the reservations information
- Create tests for the API and integrate with a CI tool like https://travis-ci.org/
- Integrate with Docker
- Create a simple frontend where the users can:
- Register and login
- Check the availability times of the parking
- Make their own reservations