Bangazon is an api for users to buy and sell products
- Clone this repository and change to the directory in the terminal.
- Run
pipenv shell
- Run
pipenv install
- Seed database:
./seed_data.sh
This will migrate and run aseed_db
command. Take look at theseed_data.sh
to see what it runs. Then openbangazon_api/management/commands/seed_db.py
file to see what theseed_db
does
Now that your database is set up all you have to do is run the command:
python manage.py runserver
Here is the ERD for the models in the api: https://drawsql.app/nss-2/diagrams/bangazon/embed
To make it easier for onboarding new developers, there is a documentation site made with Swagger that allows the developer to make requests and view the response
- Run the server
- Go to http://localhost:8000/swagger
- Find and open the register docs and click
Try it out
- Fill out the json and press
Execute
- Copy the token that is returned
- Scroll back to the top of the page
- Click on
Authorize
- In the value input add
Token <the new token>
, then click authorize - Try to get a list of categories in the browser
- If this doesn't work, reach out to your senior
Once you're logged into the swagger docs, try out a few other requests so you can see what each endpoint does. There is information in the docs about what status and data will be returned with each response. If you want to switch users, look in the auth_token
table to grab a different token.
- The front end of the website is deployed here: https://nss-bangazon-dev.herokuapp.com
- It's built to work with your local api, once you have your local server running you can use the dev website to interact with the api
- To login: open the
auth_user
table and copy one of the usernames that you'd like to login as. The password for each user ispassword