CS257 Software Design Wednesday, 16 April 2025 + Demo: a tiny books web application & API + Web application structure - Back end / server side - HTTP-based API implemented in Flask - Database managed by PostgreSQL - Web server for web pages using Flask and Jinja2 templates - Front end / client side - HTML for content and structure - CSS for style - Javascript for interactivity + Our approach - Bottom-up - Back end first - Why? - best way to help you learn one new technique at a time - sometimes it's a good plan anyway - can support separate teams working in parallel - downside: takes our focus off the user's needs for a while + Plan for the next 2.5 weeks: back end development - Pick a question you want to ask of your data - Build a command-line interface in python to answer that question - Design the CLI - Design a function to do the computation - Implement the function - Implement the CLI by taking advantage of the function - Design a database to hold your data - Design the tables - Populate the tables - Reimplement your function from the CLI above to access the database rather than the original data file - Create an HTTP-based API endpoint for your question - Design the endpoint - Implement the endpoint in Flask - Repeat all these steps as needed + Command-line interface (CLI) design & implementation - What design principles have you seen in Unix commands? - Quick look at built-in python CLI tools + Lab: implementing CLI in python