Link Search Menu Expand Document

Final Project

GitHub Classroom assignment

NOTE: This document may evolve overtime, but it will be useful to guide your project ideas and to understand the expectations of the final project.

You will create a Flask web application that uses a MySQL database for persistent information storage. Your application will provide methods of performing CRUD (Create, Read, Update, Delete) operations on data stored in the MySQL database using HTML web pages to view and modify database content.

Your application will also have a test suite complete with:

  • unit tests for:
    • class(es) that model your data and provide important methods
    • class(es) to assist with database operations (CRUD)
    • important suppporting functions
    • you DO NOT need to write tests for:
      • The HTML front end rendering and routing (manual verification is sufficient)
      • Any models that act as Plain Old Data (POD) classes
        • Meaning they contain class fields/attributes relevant for your data, but provide no methods other than properties (get and set operations)

When the testsuite is run, your application will use a “test” version of your database that is preloaded with “sample” data and reset to an known initial state (with sample data) before each set of tests are executed. This ensures that you are aware of the content in the database so that you can effectively evaluate the results of a variety of operations. Note that testing should not be run against the “production” version of your database used when normally running the application. As you can imagine, introducing “fake” data where “real” data resides can have a wide array of negative outcomes, so we will keep the data for these usecases completely separate.

You must also include a README.md that describes your application, how to use it, and complete API usage. I have updated the GitHub flask todo application with an example of API usage in README.md.

Lastly, you will write a reflection (at least 500 words) on the project including:

  • specific details about your contribution to the project
  • software design challenges and decisions
  • what you have learned from the project

Detailed Requirements

  • Your database must have at least 3 tables that are linked via foreign keys
    • The database design will reflect 3rd Normal Form rules (1NF-3NF inclusively)
  • You must provide a flask command to initialize your application’s database
  • You must use the provided database fixture to initialize a testing database
  • You must create a class to encapsulate access to your database
  • Your application must demonstrate appropriate object oriented design concepts and feature a clear separation between routing web requests and data operations
  • The user interface of your HTML pages must be well organized and functional
    • You are NOT being evaluated on fancy HTML/Javascript/CSS styles or effects.
  • Your application MUST use the appropriate HTTP Request Methods (GET, POST, PUT, DELETE).
  • You must write test cases using pytest
  • The code for your classes and functions must be documented using Python DocStrings in either Google or reST, but do not mix the formats
  • The HTML web pages must allow presention and modification of information from your database (CRUD)
  • Your code must be in a GitHub repository under the class organization

Extra Credit Opportunity

For EXTRA CREDIT a web-based API capable of responding to requests with content in the JSON format can be implemented (but must include tests).

To potentially receive the full extra credit you must have:

  • The web API support accessing and modifying the data in your database (CRUD)
  • Data sent to the web API must be JSON data, Query Strings, or encoded URLs
  • Data received from the web API must be in the JSON format
  • Create a spec endpoint to show the API documentation in SwaggerUI (use Flask Swagger)
  • Tests for all web API routes using pytest

Development Tips

Here are a few tips to help you deal with managing this project in a group.

Dealing with Dependencies

Work will need to be divided up among your team members. Some components will ultimately depend on others but that should not stop you from starting work on those components. For example, while HTML templates will ultimately need to use data from Flask code, you can still write HTML files that are filled in with fake placeholder data at first and then add the Jinja templating later when the Flask code is ready to use it. If you open up the HTML file on your computer it will open in your browser, so you focus on the layout or necessary HTML controls before it uses live data. Similarly, Flask code will ultimately need to use the database class, but you can still start working on the Flask code by returning artifical data until the database code is written.

Coordination and Communication

Make sure that communication with your team members is open and frequent so everyone knows what is currently being worked on to avoid redundant efforts. Additionally, if two team members decide to work within the same file simultaneously, when you attempted to commit the work using Git you may introduce a merge conflict. While this cannot always be prevented, and we will address how to resolve these, it can help to make sure you are exercising good project organization and split your code into unique files containing highly related content when appropriate.

Leverage your knowledge of project planning

We have spent time in class learning the process of software development and how to manage a project, LEVERAGE THIS SKILL.

  • Create user stories, assign priorities, and estimated difficulty
  • Plan out week long iterations
  • Schedule and attend meetings with your team members to discuss progress, difficulties, and revise your plans
  • Ensure that everyone know what it means for work to be finished (Defintion of Done)
  • Use GitHub and its issue system (we will look at this in class) to keep track of:
    • all the work to be done (product backlog)
    • who is actively working on which user story
    • what work is planned for a given week

Grading: 150 points

  • 30pts - Database consisting of at least three tables linked via foreign keys (Normalized to 3NF)
  • 30pts - HTML view supports CRUD operations
  • 20pts - Pytest cases are present for database/models/business logic
  • 10pts - Classes and functions use Google or reST style DocStrings
  • 10pts - Project organization has appropriate use of classes
  • 10pts - Project organization demonstrates a separation of concerns
    • Code for routing, businees logic, and database operations are separated (decoupled)
  • 10pts - README.md detailing:
    • How to run the application
    • How to use the front end HTML interface
  • 30pts - Quality of individually written (at least 500 words) reflection submitted to GitHub

Up to 5% Extra Credit on the Final Project (not to exceed 100%)

  • API supports CRUD operations
  • Pytest cases are present for ALL API routes
  • YOU DO NOT NEED TO WRITE API DOCUMENTATION IN THE README.md
  • SwaggerUI spec