| CPSC 343 | Database Theory and Practice | Fall 2026 |
A significant component of this course is a project in which you will design and implement a database-driven application, bringing together concepts and material from many parts of the course. You will be responsible for designing and implementing both the database and the application.
The project is divided into five milestones, each covering a distinct part of the overall design and implementation process. Milestones which have been assigned are listed below; see the schedule page for tentative due dates for upcoming milestones.
| date | due |
|---|---|
| Fri 9/18 | milestone 1: topic and requirements |
| Fri 10/9 | milestone 2: modeling and design |
| Wed 11/4 | milestone 3: implementation |
| Fri 12/4 | milestone 4: data integrity and security |
| milestone 5: performance audit and final handin |
This is a significant project, and is important to work on it steadily and not leave it until the last minute. Furthermore, the cumulative nature of the project, with little in the way of extra time between phases of the project, means that a late milestone isn't just a late handin — it's also a late start on everything that follows. This means that late milestones are largely not accepted — budget your time so you can complete each milestone on time, and hand in what you have when a milestone is due even if it isn't complete. A few grace days are available for the occasional "just need a day or two more!" crunch; see the late policy for details.
The domain and functionality of the application is up to you; some ideas are given below but you are welcome to come up with your own. The only two real requirements are that the topic is sufficiently distinct from the examples discussed in class and it is able to support everything the course will ask you to build. The criteria below are a minimum bar, not a full checklist — if you can't say "yes" (even tentatively) to one of them, your topic likely won't be able to encompass everything it will need to. You also don't need every detail worked out now, just a plausible reason your topic could satisfy each criterion. Don't worry if you aren't sure about some of them — the purpose of the check-in meeting for this milestone is to help with exactly that.
At least 5-6 distinct kinds of interconnected "things", such as employees, departments, projects, and dependents for a company (four kinds of things) or books, authors, publishers, library branches, and borrowers for a library (five kinds of things).
Individual attributes, or a small group of attributes, that are naturally repeated or derivable across rows, such as a publisher's address showing up on every book they publish or a book's total number of copies being derivable by counting the number of copies each library branch holds.
Relationships with different cardinalities, such as a dependent being associated with only one employee while an employee can have any number of dependents (one-to-many), or a book having many borrowers over time and a borrower borrowing many books (many-to-many).
At least two kinds of application users with different kinds of access needs, such as a regular employee and an HR adminstrator, or a borrower and a librarian.
User tasks which involve inserting, retrieving, updating, and deleting data in the database, such as registering a new borrower, looking up which books are currently checked out, updating a due date, and removing a borrower's record.
User tasks supported by a variety of query techniques, not just simple lookups. Think about tasks in your domain that would need things like the following:
User tasks which involve touching multiple tables as part of one logical operation, such as checking out a book (which might need to create a new loan record, udpate the book's available-copy count, and record a hold as fulfilled) or hiring a new employee (which might need to create an employee record and assign them to a department's project).
Data integrity rules that the database itself should enforce, such as never letting a loan record reference a book that doesn't exist, not allowing a book to be checked out if no copies are available, or automatically adjusting a book's available-copy count whenever a loan is recorded or returned.
Tables which could plausibly grow to hundreds or thousands of rows — some tables may naturally stay small in a real deployment but others should be able to grow large. For example, a regional library system is not likely to have more than a few dozen branches but a library's book collection and loan history could realistically have thousands of entries.
Room to grow. As new material is covered in the course, applications of those concepts will need to be incorporated into your project. Can you imagine expanding the scope and adding new kinds of interconnected things, such as a library adding book clubs that borrowers can register for or a company tracking its employees' compliance training completions? Is there potential for different "flavors" of things that share some characteristics but also have their own distinct details, such as borrowers being able to check out different kinds of media (books, audiobooks, DVDs, etc.), or a company having both regular employees and contractors? Might new data integrity rules emerge as the domain gets more complex? "Room to grow" is the most important criterion for an appropriate topic, but also the least specific — what matters is that there's real potential for incorporating new elements, not that you can already name what they'll be.
Some possible ideas:
Note that these ideas are given as a starting point — you still need to make sure your topic satisfies the criteria given above (without also being too big).
Your project proposal needs to contain two things:
A brief description of your topic — give a sentence or two big-picture description, similar to what is in the list of possible ideas above.
A list of 10-12 use cases or user tasks which describe the functionality of your application. Label each with the type of user that would perform that task. For example, for the library, several tasks are check out a book [librarian], check a returned book back in [librarian], browse the entire collection [library patron], search books written by a particular author [library patron], and view details about a particular book [library patron]. You don't need an exhaustive list of everything a large application might allow a user to do, but be sure to identify tasks that meet the appropriate topic criteria and try to choose a cohesive set of tasks that would provide a useful, if potentially limited, chunk of functionality.
In addition to the project proposal, briefly outline how your topic meets each of the 10 criteria listed above. You don't need full details or big explanations, just enough to see that your topic is suitable. If you aren't sure how or if your project might meet some of the criteria, come to office hours to discuss it — that's the purpose of the check-in meeting for this milestone.
A 15-minute check-in meeting is required to discuss your project topic and the checklist. Stop by office hours or make an appointment. Check-in meetings must be completed by 9/23 (several days after the milestone is due). Sooner is better so you can move on to milestone 2!
Hand in a hardcopy of your project proposal and the topic checklist.
There is no separate handin meeting for this milestone.
This is where the project really begins, with modeling the data requirements and designing the database itself.
You outlined a set of use cases (user tasks) in your project proposal, now formalize the requirements for your application: create a requirements document with the brief description of the topic and the list of use cases from your project proposal. The rest of the design and implementation of your project will be based on this document.
Create an ER/EER model that captures the data requirements implied by your use cases — what data is needed to support the functionality identified? Use the ER and EER features appropriate for your domain, but also make sure you include the elements listed below. If any of these are not naturally supported by your original set of use cases, add a few new use cases to demonstrate those structures — don't just add things to the ER model that aren't supported by your requirements document. Clearly mark any additions or revisions from what was in your original project proposal.
Your ER diagram must contain:
Using PlantUML (preferred) or another diagramming tool for your ER diagram is recommended so that it is easily editable.
Also create two lists of things present in the data requirements but which are not captured by the ER diagram:
Structural constraints which should be enforced by the database but which aren't expressible in the ER notation (such as that a book's due date must be after the checkout date or that a particular value is required).
Policy constraints which should be enforced by the application (such as that a borrower may not check out more than five books at a time). These aren't the database's responsibility, but it is worth recording them now so you don't lose track of them.
Convert your ER/EER model to a relational schema following the mapping process discussed in class.
For each relation, identify a primary key along with any foreign key(s) and appropriate NOT NULL, UNIQUE, and CHECK constraints. (If a key wasn't already identified in the ER model, derive candidate key(s) from the functional dependencies and choose one as the primary key.) In a separate list, include any structural constraints not represented in the relational schema. (You don't need to repeat the policy constraints — those are still outside the scope of the database itself.)
Identify the functional dependencies that hold in your domain — go back to the entity sets and elements from the ER model to avoid being misled by how a table happens to be organized.
Then go relation by relation: for each relation, identify the functional dependencies that hold for that relation and determine its candidate key(s). (Use this to identify an appropriate primary key for any relation that didn't already have one from the ER model and to verify that the primary key is appropriate otherwise.) Then normalize any relation that isn't already in BCNF, or explain why it isn't possible or desirable to do so. For any relation you do decompose, briefly name the anomaly that the original structure was vulnerable to.
Your schema may not need any further decomposition — in fact, that's likely if you followed good ER design practices in the first place. You do still need to go through the process of identifying the functional dependencies and demonstrating why each schema is in BCNF — there's nothing to fix, but you need to show that instead of simply claiming that everything is fine.
Discuss the choices you made in all three steps above — ER modeling, relational mapping, and normalization — wherever there was a decision to be made. (You do not need to address cases where there was really only one way to go.) In particular, be sure to address:
Places in your ER model where there was a choice about how to represent something and why you made the choice you did.
Challenges with creating the ER model — things in your requirements you couldn't express or couldn't express elegantly in ER notation and how you handled it.
Places in your relational mapping where there was more than one reasonable way to represent an ER construct relationally and why you chose the approach you did.
Your functional dependency and normalization analysis — the dependencies you identified, the normal form each relation satisfies, and either your decomposition (if one was needed) or your reasoning for why none was — along with a check that any decomposition you did perform is lossless-join and dependency-preserving.
This document is the main place where your reasoning is visible and it is an important piece of your handin — a correct-looking schema with a thin or missing design analysis doesn't give much evidence that you understand why it's correct. Focus on places where there was a legitimate choice of alternatives — you don't need to document where there really was only one reasobnable way to go.
Aim for approximately 2-4 pages.
the requirements document — your overview paragraph and use cases from the project proposal, updated to reflect any use cases added or revised
the ER/EER diagram along with the two lists of constraints not represented in the diagram and policy constraints
the relational schema, with primary key, foreign key, NOT NULL, UNIQUE, and CHECK constraints, along with a list of any constraints not captured in the schema
your design analysis and process writeup, covering your ER and ER-to-relational mapping choices and your functional dependency normalization analysis (2-4 pages)
A 15-minute check-in meeting is required to discuss your ER model before you proceed with the ER-to-relational mapping and normalization steps. Sooner is better so that you have time to act on any feedback and still complete the last two steps on time.
Hand in hardcopies of the deliverables listed above.
Handin meetings will be scheduled for Monday 10/12 and Tuesday 10/13. A signup list will be made available a few days in advance.
This is where your design becomes a working system: you will build the database from your milestone 2 schema, load it with enough data to be able to test your application's functionality, and build the back end of your application as a REST API (business logic and data access, no user interface) that supports your use cases. This is the largest milestone of the project and the one where most of the code gets written, so plan your time accordingly — don't leave it until the last week. Authentication and authorization are not part of this milestone; they come next, in milestone 4. For now your endpoints can be open to anyone, though it's worth keeping in mind which ones will eventually need to know who is calling.
Work in layers and get something running end to end early. A good order is: create the database, build one use case's path all the way through (data access, business logic, endpoint, test), and then expand to the rest of your use cases. Getting one complete vertical slice working will give you the framework and proof-of-concept for the rest.
Implement your relational schema in MySQL. Implement the full schema even if you don't implement any use cases that use some of the relations. You can use MySQL Workbench to define the tables or write the CREATE TABLE statements from scratch, but note that you will need to hand in the CREATE TABLE statements. You should:
create the tables in a valid order (and list the CREATE TABLE statements in that order)
use appropriate MySQL data types for every column
declare the primary key, foreign key, NOT NULL, UNIQUE, CHECK, and DEFAULT constraints from your design
choose ON DELETE and ON UPDATE behavior for each foreign key deliberately, based on what should happen in your domain rather than simply accepting the default
If you made changes to your ER diagram after milestone 2 or if implementing the schema reveals problems with your milestone 2 design, make the necessary changes in all places — keep the design documents and the database consistent with each other — and keep a short dated change log listing what you changed, when, and why. Changing your design as you learn more is normal and expected; changes that are visible and explained are good process, while a final schema that doesn't match what you handed in earlier without explanation is not.
Populate your database with sample data using MySQL Workbench's interface to enter rows by hand, by writing INSERT statements, or (recommended) by creating CSV files and importing them using LOAD DATA INFILE. (See homework 10 for examples of CSV files.) You don't need a ton of data, but add enough so that your queries return meaningful, non-trivial results and include some interesting cases (e.g. related rows in several tables, NULLs where they're allowed, and ties or duplicates where they'd occur in real data) so that you can fully check your queries. You only need to populate tables used by endpoints that you are implementing.
Use the username_project database in MySQL, where username is replaced by your username. You will need to connect to MySQL using your account (sent out via email) rather than guest in order to access the database.
Remember that you can run SHOW CREATE TABLE table in a query tab in MySQL Workbench to get the CREATE TABLE statement for an existing table.
Design and implement a REST API that supports the use cases from your requirements document. Follow the REST conventions discussed in class: resources named with nouns, the HTTP method conveying the action, and appropriate status codes. Your API should:
have at least 12 endpoints in total (it is recommended, though not required, that you pick a set of endpoints that support a complete useful subset of your application's functionality)
support full (or nearly full) create, read, update, and delete operations for at least 2–3 of your entities
include at least one endpoint with a path parameter that identifies a specific resource (such as /books/{id})
include at least one endpoint with a query parameter that filters or searches a collection (such as /books?author=Adams)
include at least one nested resource that reflects a relationship in your data (such as /members/{id}/loans for the loans belonging to a particular member)
have at least three endpoints backed by queries that join two or more tables, at least two backed by a subquery, at least two backed by aggregation, at least one that uses a set operation, and at least one that sorts and/or limits its results
include at least one operation that modifies data in multiple tables as part of one logical action (such as checking out a book or placing an order)
A given endpoint can satisfy more than one requirement e.g. one that involves a join and sorts its results counts toward the three join endpoints, the one sorting endpoint, and the 12 total endpoints.
Include a concise API document listing each endpoint: the HTTP method and path, a one-line description, which use case it supports, what it expects in the request (path and query parameters and the JSON body, if any, with field names and types), the JSON structure it returns on success, and the error status codes it can produce. For example:
POST /members/7/loans — check out a book (use case 4)
Request body: { "bookId": 42 }
Success: 201 Created, { "loanId": 118, "bookId": 42, "dueOn": "2026-11-18" }
Errors: 400 missing bookId; 404 no such member or book; 409 book already checked out
Note that authentication and authorization is not part of this milestone! You don't need login or logout endpoints and every route is public.
Build your back end in Java using JDBC to talk to MySQL, Javalin, and the JSON library introduced in class and in the photo album homeworks. You may reuse code from posted class examples (slides or Java files) and from the provided code and your own work on the photo album homeworks, as-is or with modifications. You may not copy or use code, even with modifications, from other sources (including AI and other students) — see the course Academic Integrity and AI policies.
Organize your code into the three layers discussed in class:
Routes parse the request, call the business logic, and produce the response. No SQL belongs here.
Services (business logic) validate input, enforce the policy constraints you identified in milestone 2, and coordinate multi-step operations. No HTTP details and no SQL belong here.
Data access (DAO) classes hold all of your SQL and JDBC code. Use PreparedStatement with parameters for every query — never build SQL by concatenating input — and close your connections, statements, and result sets properly (try-with-resources). Map result rows to Java objects, taking care with NULLs, dates, and decimal values.
Organize your code into packages as in the photo album homework.
Your application should also handle errors deliberately rather than letting things fail on their own. At a minimum, make sure that:
a request for something that doesn't exist returns a 404
invalid or incomplete input (missing required fields, values of the wrong type or out of range, malformed JSON) is caught and returns a 400 with a helpful message
requests that conflict with the data (such as a duplicate value in a UNIQUE column, or a reference to a row that doesn't exist) return an appropriate 4xx code, determined from the database error rather than by guessing from message text
unexpected failures return a 500
all errors use a consistent JSON format and never expose stack traces, SQL, or table names to the client (log those on the server instead)
Use a centralized error handler as discussed in class and implemented in the photo album homework.
Test your API as you build it using curl or, for GET requests, a web browser. Keeping your curl command lines in a text document for easy pasting into the terminal is highly recommended.
Create a Maven project and import the photo album pom.xml and starter code as you did in homework 12 — name your project something other than photoalbum, but otherwise follow the same steps from homework 12's Setup section.
The database URL is jdbc:mysql://bridgeman-vm.hws.edu:3306/username_project, where username is replaced by your MySQL username.
You can create a directory scripts in the top level of your Eclipse project and a file tests within that directory for your curl command lines — cut and paste individual tests to the terminal when you want to run them. It is useful to annotate each with a brief description of what it is testing, as in the homework 12 handout.
the requirements document from milestone 2, updated as needed to reflect any use cases added or revised
the ER/EER diagram along with the two lists of constraints not represented in the diagram and policy constraints, updated as needed if there were changes after milestone 2 and/or during implementation
the relational schema, with primary key, foreign key, NOT NULL, UNIQUE, and CHECK constraints, along with a list of any constraints not captured in the schema, updated as needed if there were changes after milestone 2 and/or during implementation
the change log documenting changes to your requirements document, ER/EER diagram, and/or relational schema
the database definition (CREATE TABLE statements, in a valid order)
the API document listing your endpoints
your code, including your curl command line tests
your implemented and populated database
A 15-minute check-in meeting is required to discuss your API design and progress implementing the first use case and to clear up any sticking points regarding implementation. Bring a draft of your API document listing your endpoints and have your code available (bring a laptop with your code running or have copied your code into a m3-checkin folder in the handin directory before the meeting). Sooner is better for the meeting!
Hand in hardcopies of the deliverable documents — the requirements document, ER/EER diagram, relational schema, change log, database definition, and API document. Hand in your code to the handin folder as described below. The database will be checked in MySQL.
Hand in your code by copying your entire project directory into your handin folder /classes/cs343/handin/username (where username is replaced by your username). Rename the directory project-m3 so it is clear what this handin is for.
Handin meetings will be scheduled for Thursday 11/5 and Friday 11/6. A signup list will be made available a few days in advance.
The handin meeting will discuss your database implementation, your API design, and your code. Make sure that you have handed in all of the deliverables by the due date.
Milestone 3 focused on implementing your API's functionality. That functionality isn't ready for use yet, however — it is open to anyone, assumes that requests arrive one at a time and that nothing ever fails partway through, and may not be fully protected against malicious or invalid input. This milestone addresses those issues. It also considers how the database itself can limit what can be seen and done and how to keep track of who has done what to the data.
If you make changes to your milestone 3 database schema, use cases, and/or API, be sure to update all of the relevant documents and keep a short dated change log listing what you changed, when, and why. Changes to the database schema to add columns or tables related to user authentication and authorization don't need to be reflected in your ER diagram or relational schema, but other changes should.
Your application needs to know who its users are and what each kind of user may do. Every endpoint will be available only to one of three groups of callers: anyone (no login needed), any logged-in user, or only logged-in users with certain roles.
Every user account, including accounts users create for themselves (if any), has at least one associated role that determines what kinds of things the user can do. Your application must have at least two distinct roles and they must differ in what they can do in terms of application functionality, not just whether they can manage user accounts — an admin role limited to user management doesn't count. ("Admin" below refers to whichever role manages user accounts.) Supporting multiple roles per user is optional.
There are two ways parts of your API's functionality might be open to the public, if that makes sense for your application:
unauthenticated access — some endpoints can be used without logging in at all
self-registration — anyone can create an account for themselves with certain role(s), such as a library patron signing up for a borrower account
The same application might support both (such as the library: anyone can browse the catalog, and can sign up for a borrower account in order to check out books), neither (such as an HR system: all access requires an account and accounts are created only by HR administrators), or just one (such as a social media website: you need an account to view and post content but anyone can sign up for one). Decide what makes sense for your application.
Roles available through self-registration (if appropriate for your application) count towards the two distinct user roles; unauthenticated access (which has no role) does not.
Your application must have:
passwords stored using a salted, slow hash — never in plaintext
session-based authentication, with login and logout endpoints and a centralized filter for authentication rather than a check repeated in every route
at least two distinct roles differing in what they can do in terms of application functionality
a create user endpoint allowing the creation of an account with any role, restricted to admins (except for creating accounts with the roles available through self-registration, if appropriate for your application)
a way to create the first admin account: if your application allows self-registration, create an account through self-regisration and then change its role directly in the database; if not, set up a bootstrap admin account as in homework 13
protection for every non-public endpoint in keeping with which user role(s) are allowed to access that functionality, including
appropriate status codes for authentication and authorization failures (see below)
Status codes: 401 (Unauthorized) means "unauthenticated" — a missing, invalid, or expired token. 404 (Not Found) means the row doesn't exist or it exists but the user isn't allowed to see it, whatever operation is being attempted — responding differently in the latter case would reveal to a would-be attacker that the row does in fact exist. Aside from that one exception, 403 (Forbidden) means that a logged-in user doesn't have permission for the action.
Update your requirements document. Add the use cases for authentication and user management (logging in, logging out, and creating accounts). Add/revise labels as needed so that every use case says who may perform it — anyone, any logged-in user, or specific roles (identify the specific roles). If none of your use cases calls for a role-based or a row-level check, add one that does.
Update your API document. Add login, logout, create user, and any other endpoints needed for the new use cases, and for every endpoint, add who may call it (anyone, any logged-in user, or specific roles), the rule for any row-level check (who may see or modify which rows), and the authentication/authorization error codes it can produce.
Implement it. Implement everything listed under "What's Required" above. Add tables and/or columns as needed to support user accounts, roles, and session-based authentication — if your schema already has an entity that represents the people who will log in (such as borrowers or employees), decide whether login information belongs in that table or in a separate one linked to it.
SQL data types: use CHAR(60) for the password hash and CHAR(43) for session tokens. (Use bcrypt for the hash and generate tokens as in the library demo and the photo album homework.)
Enforce row-level checks in the SQL WHERE clause using the current user's id from the session, never an id taken from the request.
For testing, add sample users of each role to your database and additional curl command lines — both for requests that should succeed and also ones that should fail (such as no token, an invalid token, a user of the wrong role, and a user trying to access someone else's rows).
Your writeup should document the following, along with the rationale for any choices you made:
Employ transactions where needed. For every operation in your API that involves more than one SQL statement:
Identify whether a transaction is needed for atomicity (all steps must either succeed or fail together) and/or to handle concurrency (something could go wrong if another request runs at the same time as this operation).
For concurrency issues, determine what could go wrong if another request ran at the same time and prevent it with an appropriate isolation level and/or locking reads (SELECT ... FOR UPDATE) on the rows involved.
Use MySQL's default isolation level (REPEATABLE READ) unless you have a specific reason to use another one. In particular, only use SERIALIZABLE if it is difficult to identify the specific rows to lock.
If your application doesn't have at least one operation where locking reads are used to prevent issues with concurrent requests, add an endpoint (with an associated use case) that does.
Remember that a locking read only protects against other operations that also lock those rows — a plain SELECT isn't blocked by the lock. For locking to be effective, every operation that reads those rows and then acts on what it read must use a locking read. (Operations that only display the data can still use plain reads.)
Any transaction that modifies data can be rolled back because of a deadlock or lock wait timeout. Handle this as in homework 14: retry the transaction a small number of times and return a 503 if it still doesn't succeed.
For each operation in your API that involves more than one SQL statement:
If no transaction is needed, explain why the operation is safe without one.
For concurrency issues, describe what could go wrong if another request ran at the same time and explain why your solution prevents these problems, including your rationale if you used an isolation level other than REPEATABLE READ.
Use views to restrict what can be seen: define a view for each case where some of a table's columns or all but a fixed subset of its rows should be hidden from some users, and use each view in the relevant endpoint(s). If none of your existing endpoints is a natural fit for a view, add a new endpoint (with an associated use case) that is.
Treat views like tables in your code: the DAO queries a view and maps its rows to a domain object matching the view's columns. Add new domain objects as needed — don't just use an existing one with some fields left empty.
Your API currently connects to MySQL with a single account that can do anything to your database. This is convenient, but if that account is compromised (such as through an SQL injection flaw or leaked credentials), it places no limits on what can be done to your data.
For each endpoint, identify the privileges its SQL requires: which tables and views it uses and which of SELECT, INSERT, UPDATE, and/or DELETE it needs on each.
Think about the front ends a full deployment of your API would have — the main user-facing application and at least one other — and which of your endpoints each would use. (Only consider the endpoints you've defined — you don't have to address the full scope of a complete API.) Based on that, recommend a set of database accounts in accordance with the principle of least privilege. List the privileges each account would have and describe, in terms of your application's data, the most significant harm the restrictions prevent and the most damaging thing someone misusing the account could still do (e.g. "could read members' contact information but not change it").
An audit trail provides the information needed to find out what happened and who was responsible when something goes wrong with the data, such as a record being changed or deleted in error or by someone who shouldn't have been able to. An audit trail always records who/when/what/which — who performed the operation, when, what kind of operation it was, and which row was affected. This is what distinguishes an audit trail from mechanisms such as last-modified columns or a history of past values.
Design an audit trail for your application: identify which tables and/or operations are important enough to audit and what in addition to the who/when/what/which should be recorded in each case. Justify your choices in both directions — why you chose what you did and why you left out the rest.
In deciding what to audit, assume your application is deployed and in real use. For what kinds of changes is it important to know who/when/what/which in that environment? Consider which changes would matter most if they were made in error or by someone who shouldn't have made them and which would be hardest to reconstruct afterward. At a minimum, changes to user accounts and roles should be audited in any application, since a user who gains a role they shouldn't have can do anything that role allows. At the same time, auditing isn't free — audit data grows with every change, adds work to every audited operation, results in additional copies of possibly sensitive data, and becomes harder to make use of as its volume grows.
Beyond who/when/what/which, also consider whether to keep the full old and new rows, only values for the columns that changed, or no values at all; whether any sensitive values should be left out of the audit data; and whether reads of some data should be audited as well as changes.
Your writeup should contain the following:
Ensure proper handling of request data:
Identify and fix all SQL injection vulnerabilities in your code. Using PreparedStatement with parameters for every query, as required in milestone 3, takes care of injection concerns with values, but placeholders don't work for non-values such as table or column names or a sort direction. If any parts of your queries other than values come from the request (such as a ?sort= query parameter), validate them against an allow-list of acceptable values.
Review your input validation in the service layer: reject invalid input (missing fields, wrong types, values out of range or too long) with a 400 error before it reaches the database rather than relying on database constraints to catch it.
For any SQL injection vulnerabilities you found, explain what the problem was (include an example of input that would exploit the weakness and what the effect would be) and how your fix addresses it.
If you didn't find any SQL injection problems, identify one place in your code where there would have been a problem had the SQL been built by concatenating input instead of using placeholders and discuss it in the same way.
the requirements document, updated to include the authentication and user management use cases and any other use cases added or revised, with each use case labeled with who may perform it
the ER/EER diagram and relational schema (with their lists of constraints) if there were any changes from milestone 3
the API document, updated to include the new endpoints and, for every endpoint, who may call it, the rule for any row-level check, and the authentication/authorization error codes it can produce
the change log documenting changes to your milestone 3 database schema, use cases, and API
your writeup
your code, including your curl command line tests and the usernames and passwords of your sample users (including any bootstrap admin account)
your implemented and populated database
Hand in hardcopies of the deliverable documents — the requirements document, the ER/EER diagram and relational schema (if changed), the change log, the API document, and the writeup. Hand in your code to the handin folder as described below. The database will be checked in MySQL.
Hand in your code by copying your entire project directory into your handin folder /classes/cs343/handin/username (where username is replaced by your username). Rename the directory project-m4 so it is clear what this handin is for.
Handin meetings will be scheduled for the week of 12/7. A signup list will be made available a few days before.
Make sure that you have handed in all of the deliverables by the due date.