- Clone respository
git clone https://github.com/wmati/software-engineer-api-assignment
- Create Python virtual environment at downloaded location. Note: At this point you should be in the same directory as manage.py
python -m venv env
- Activate virtual environment
env\scripts\activate
- Install Django and Django REST Framework (DRF) with Pip
pip install django
pip install djangorestframework
- Create SQL Lite Database
python manage.py migrate
- Run Server
python manage.py runserver
- The command line will indicate the port the app is launched.
Starting development server at https://127.0.0.1:8000/
- To run unit test:
python manage.py test
- Address case sensitivity in URL
- Filter by skateboard type, spec, brand
- Improved JSON formatting
As a skateboard owner I want to be able to add my individual board to a skateboard sharing marketplace.
- Go to 127.0.0.1:8000
- Insert your data in JSON fromat, or paste provided data (below) and press POST
{
"available" : 1,
"owner": "John",
"brand": "Element",
"weight": 5,
"length": 30,
"type": "skateboard",
"city": "Buffalo",
"state": "NY"
}
- Refresh page, and a GET request will automatically be submitted. The new posting should be visible.
As a skateboard owner I want to be able to modify the details for the board that I share.
- Go to 127.0.0.1:8000/user/your name/posting ID (for example if your posting name is John and you already have a posting with ID=1, go to 127.0.0.1:8000/user/John/1)
- Re-enter data to be updated in JSON format. Note, not all fields need to be entered. For example, input of the following will be sufficient:
{
"available" : 1,
"brand": "West 49",
}
- Refresh page, or go to homepage to see listing
As a skateboard owner I want to be able to indicate that my board is available or unavailable for sharing
This story is satisfied by the available parameter in the object, which is specified by a boolean. 1 represents AVAILABLE and 0 represents UNAVAILABLE.
Changing the status is submitted by a PUT request as explained in the previous story.
As a skateboard borrower, I want to see a list of available boards
Go to 127.0.0.1:8000/available/boolean
-AVAILABLE BOARDS: 127.0.0.1:8000/available/1
-UNAVAILABLE BOARDS: 127.0.0.1:8000/available/0
Skateboards by User
- Go to 127.0.0.1:8000/user/your name (ex 127.0.0.1:8000/users/John)
Delete Board
- Go to 127.0.0.1:8000/user/your name/posting ID
- Press DELETE or submit a delete request
Endpoint | HTTP Verbs | Screenshot |
---|---|---|
127.0.0.1:8000 | GET, POST | |
127.0.0.1:8000/available/boolean/ | GET | |
127.0.0.1:8000/user/username/posting id/ | GET, PUT, DELETE | |
127.0.0.1:8000/user/username/ | GET | ![]() |