SA: Phase 4 Code Challenge Two Late Show API [COMPULSORY]

๐ŸŒ™ Flask Code Challenge โ€” Late Show API

๐ŸŽฏ Overview

You will build a Flask REST API for a Late Night TV show system from scratch, using:

โœ… MVC architecture
โœ… PostgreSQL (mandatory DB)
โœ… Token-based authentication (JWT)
โœ… Postman for API testing
โœ… Git + GitHub for version control
โœ… Full documentation in README.md


๐Ÿ—‚ Suggested Folder Structure


๐Ÿ’ป GitHub Repository Setup

โœ… Create a new repo:
๐Ÿ‘‰ github.com Links to an external site. โ†’ New repo โ†’ late-show-api-challenge โ†’ No README/.gitignore

โœ… Initialize + push:

โœ… .gitignore example:


๐Ÿ›  Setup

โœ… **Install dependencies:

**

โœ… PostgreSQL DB setup

Create your database in Postgres:

โœ… Set your DATABASE_URI in server/config.py

โœ… Run DB setup


๐Ÿงฉ Models

User


Guest


Episode


Appearance


๐Ÿ” Authentication

โœ… Required tech:Flask-JWT-Extended
โœ… Must include:

โœ… Protect:

Clients must send:


๐Ÿ›  Routes

Route Method Auth Required? Description
/register POST โŒ Register a user
/login POST โŒ Log in + return JWT
/episodes GET โŒ List episodes
/episodes/<int:id> GET โŒ Get episode + appearances
/episodes/<int:id> DELETE โœ… Delete episode + appearances
/guests GET โŒ List guests
/appearances POST โœ… Create appearance

๐Ÿงช Testing

โœ… Import challenge-4-lateshow.postman_collection.json into Postman
โœ… Include:


Your README.md must contain:


โœ… Submission Checklist

Powered by Forestry.md