๐ป Search & Automatic Deploys ๐ป
Posted on Dec 20th, 2021
Todayโs Topics
- Postgres full-text search
- Automatic deploys with Herokuโs GitHub integration
๐ฏ Project due on Wednesday afternoon
๐ If your project meets minimum requirements today, HUZZAH! That is awesome. You should be working on at least one spicy feature.
๐ If your project does not yet meet minimum requirements, you should shoot for meeting them by the end of the day tomorrow.
Note
Depending on how youโve constructed your API, you might have separate endpoints for all of the below, or you might have fewer endpoints (for instance, if you nested answers in the question detail endpoint). What matters is that you have endpoints your front-end team can use to access this data, and they are documented somewhere.
QuestionBox, Back End
- login, logout, and register
- list all questions and answers
- create a question
- create an answer
- mark an answer to own question as โacceptedโ
- list of all questions and all answers for an authenticated user
- star/favorite questions or answers
Social Cards, Back End
- login, logout, and register
- list all cards
- list all cards for a user you follow
- list all cards for an authenticated user
- create a new card
- follow/unfollow another user
- list all users an authenticated user follows
๐ Read | ๐บ Watch | ๐ง Listen
- ๐ Basic and Full-Text Search with Django and Postgres
- ๐ If you want A LOT more detail about full-text search in Postgres and Django, this blog piece has you covered
- ๐ Blog post with more on full-text search
- ๐บ Search from the Ground Up -> DjangoCon 2019 video explaining search in detail
- ๐บ Pretty Printed: How to Perform Full Text Searches in Django with Postgres
๐ Resources
@action
decorator in ViewSets
- DRF Docs: Marking extra actions for routing with the
@action
decorator - DRF Docs: Routing for extra actions
Filtering and search
- DRF - Filtering -> Pretty useful reference. Includes how to filter your output based on GET parameters, which you will want to do for using search terms.
- Django Docs: full-text search & the search lookup
- Django Docs: SearchVector -> Youโll need this if you want to search against more than a single field
๐ฆ Code & Notes
- DRF Library API
- Notes on Django Queries These are the same notes you may have seen at the beginning of the Phase. Iโm including them here for easy reference, as they show examples of queries and filters that might come in handy for search endpoints.