Momentum logo
Team 8 Classroom

🐍 🦊 Phase 3 Collaborative Project 🦊 🐍

Posted on Jul 19th, 2021

🎯 Collaborative Project: QuestionBox

This week you will begin work on a project with both front- and back-end teammates. This project is due at the end of the Phase.

The front-end will build a React application that will make requests to the back-end application built with Django and Django REST Framework. There are no strict rules about who works on front end or back end, so your team can decide how best to use your resources.

The backend will create its own repo and the front end will create its own repo, so for the same project you will have _two separate repos. One person from each sub-team should accept the assignment, name the group with your Team Name, and then the other person can accept the assignment and choose the team that they belong to.

When you start work in this repo, you should delete the README at the root. You can save it somewhere else – it’s just a Markdown file. Then when you start your Django or React app, you should install your app at the root of the repo directory, not in a subdirectory (you do this by specifying the current directory with a . instead of a project name). This will make deploying easier.

Teams

Team Kraken = [Emily, Dee, Roan, Shaune]
Team Sasquatch = [Wendy, Quentin, Sara, Greg]
Team Mothman = [Wendy, Quentin, Logan, Brian]

One suggestion to consider: choose a team lead to act as a guide for your group. This person shouldn’t be “in charge,” but can serve as the decision-maker or tie-breaker if you’re torn between different approaches to a problem. This can help speed you up.

We’ll talk about the projects in class today. Remember to read the README very carefully. Your goal tonight should be to plan out this project with your teammates. Make sure everyone, front end and back end, is on the same page with the project requirements. Begin to outline what you’ll need to do and what you’ll need to know in order to do this project. You should write down the plans.

We haven’t yet covered everything you’ll need, so that will be our ongoing task this week and next!

Tags: phase-3 team fe be

🐝 Permissions and Serializers in DRF 🐝

Posted on Jul 19th, 2021

🗓️ Today’s Topics

  • models with relationships in your API
  • nested serializers
  • permissions

🎯 Project: QuestionBox

For this week and next, you will be building an application in collaboration with a front-end team. Team assignments TBD.

Your project will be due at the end of the Phase, one week from this Thursday.

🔖 Resources

🦉 Code

🐝 Django REST Framework 🐝

Posted on Jul 15th, 2021

Today’s Topics

Today we are going to dive into the Django REST Framework.

🎯 Project

🎯 Option 1: Add an API to Habit Tracker

Add a new app to your existing Habit Tracker project and call it api. Your app should provide CRUD endpoints that return JSON responses.

By Friday afternoon, you should be able to list, create, update, and delete habits via the API.

By Monday, you should be able to complete all CRUD tasks through the API:

  • list habits
  • create a new habit
  • view a habit
  • update a habit
  • delete a habit
  • list records for a habit (this should be on the habit detail API endpoint)
  • create a record for a habit
  • update a record for a habit
  • delete a record from a habit

Write up a list of endpoints you think you will need before you start doing this!

You should develop and test your endpoints using Insomnia. (You can also use the browsable API that DRF gives you in the browser, but you should be comfortable using Insomnia.)

🎯 Option 2: Django Library API

Link to assignment invitation. Note, this is an empty repo, so you won’t have to delete a README to start.

Create a new API-only application that lets users keep track of their books, including important information like title, author, publication date, a field that marks it as “featured”, and maybe other fields like “genre” if you want. Books should be unique by title and author (that is, you can’t have two books with the same title and author; two books with the same title is fine as long as the authors are different).

Anyone can add a new book as long as the same book is not already in the library. Only admin users can update book details and delete books.

You’ll also need a book tracking model so that users can mark a book as “want to read”, “reading”, or “read/done”. Users can also write reviews on books, which should be viewable to all users. Optionally users can take private notes on books.

You should not make forms or templates for this app, just models, urls, views, and serializers. Your views should return JSON responses.

Your app should allow users to:

  • list all books
  • list all featured books
  • create a book
  • retrieve details about a book
  • mark a book as want to read, reading, or read
  • retrieve all reviews for a book
  • post a review for a book
  • edit their own review (not delete it)

Admin users can:

  • update a book
  • mark a book as featured
  • delete a book
  • delete reviews

🚀 Whichever option you choose, the application should be deployed to Heroku.

📖 Read | 📺 Watch | 🎧 Listen

🔖 Resources

Blog articles that go with Lacey Williams Henschel’s talk

🦉 Code

⚛ Multiple components + conditional rendering ⚛

Posted on Jul 13th, 2021

Today is focused on using multiple components and conditional rendering to create multiple views of your application.

🎯 Project

Continue React Trivia. For Thursday, make your trivia categories selectable. When selected, you should show at least 10 questions for that category. If you can, go ahead and show answers and perhaps even make them selectable.

🔖 Resources