The HeLP Network API is a RESTful API for the HeLP Network frontend application. To experience the UI our frontend team built please visit https://mental-health-fe.herokuapp.com/. Otherwise you may hit our endpoints through an http request helper such as Postman.
About The Project • Technologies • Local Setup • Testing • Getting Started • Endpoints • Database Schema • Contributors • Acknowledgements
The HeLP Network is a platform that allows helping and law professionals such as mental health counselors, special education teachers, dieticians, and paralegals to connect and share resources.
- Use an agile process to turn well defined requirements into deployed and production ready software
- Implement professional git workflow using Git Rebase
- Build a RESTful API with a Django/Python
- Collaborate with front-end team in order to complete and deploy features that have been outlined in the MVP
- Develop a basic understanding of Python/Django TDD practices
Development | Testing | Dependencies |
---|---|---|
Python 3.9.7 | unittest | djangorestframework |
Django 3.2.8 | coverage | dotenv |
Circle CI | psycopg2 | |
Git/Github | ||
Heroku |
-
Create and invoke your virtual environment in your local project directory
$python3 -m venv <env> $source <env>/bin/activate
-
Fork and clone this repo into your local project directory
-
Install dependencies
$python3 -m pip install -r requirements.txt
-
Setup the database
$psql $CREATE DATABASE <db_name>;
-
Add PostgreSQL database info to
settings.py
DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': '<db_name>', 'USER': '<username>', 'PASSWORD': '<password>', 'HOST': 'localhost', 'PORT': '', } }
-
Migrate database tables
$python3 manage.py migrate`
-
Run server
$python3 manage.py runserver`
-
To run the test suite:
$python3 manage.py test
-
To assess test coverage:
$coverage run --source='.' manage.py test $coverage report
The base path
of each endpoint is:
https://developer-mental-health-org.herokuapp.com/api/v1
- For
GET
requests, you can simply send the endpoint requests through your internet browser. - For any other requests (i.e.
POST
,PATCH
,DELETE
), you will need to use an API client to provide the request body and access the endpoints.
The following table presents each API endpoint and its documentation.
HTTP Verb | Endpoint | Description | Docs |
---|---|---|---|
GET | /questions | Get all questions | doc |
POST | /questions/ | Ask a new question | doc |
GET | /search/questions | Find questions with keyword or phrase in title | doc |
GET | /filter/questions | Filter questions by tag name | doc |
GET | /questions/:id | Get a single question | doc |
PATCH | /questions/:id/ | Update a question | doc |
DELETE | /questions/:id/ | Delete a question | doc |
POST | /responses/ | Post a response to a question | doc |
PATCH | /responses/:id/ | Update a response | doc |
DELETE | /responses/:id/ | Delete a response | doc |
GET | /tags | Get all tags | doc |
GET | /tags/:id | Get a single tag | doc |
POST | /users/ | Create a new user | doc |
GET | /users/:id | Get a single user | doc |
DELETE | /users/:id/ | Delete a user | doc |
Antonio King | Jason Knoll | Matt Roden | Stephanie Magdic |
GitHub | GitHub | GitHub | GitHub |
- Turing School of Software and Design
- Project created for completion towards Backend Engineering Program