Unit 3 Overview
In this unit we transition from frontend development to comprehensive backend systems as we introduce database integration, user authentication, and session management into our university information system. You will learn how databases organize information, master essential SQL concepts, and implement CRUD operations for dynamic data interaction.
Additionally, you will build authentication systems with user accounts, protected pages, and session-based features like flash messages for user feedback. By the end of this unit, your static website will become a secure, dynamic, data-driven application with user management and persistent data storage via PostgreSQL.
In this Unit, we'll transition from hardcoded JSON data to a PostgreSQL database. The data structure will evolve throughout, so pay close attention to each assignment's format. The database stores data in snake_case (e.g., first_name), but your models should continue returning data to controllers in camelCase (e.g., firstName). This means you'll need to convert between formats in your model functions. Even if starter code works correctly, it's your responsibility to ensure it returns data in the proper format.
Part 1
Complete the following in the specified order by the due dates listed in Canvas or before the end of the unit if no date is listed:
-
Introduction to Relational Databases
Discover how relational databases organize, store, and manage large amounts of data efficiently, ensuring data integrity and accessibility for modern applications. -
Setup pgAdmin
Configure pgAdmin, a powerful graphical interface for managing PostgreSQL databases, to connect to your database and practice basic database operations. -
SQL Fundamentals
Learn the foundational concepts and syntax of SQL, empowering you to confidently write queries that retrieve, filter, and manipulate data in relational databases. -
SQL Language Categories and CRUD Operations
Explore the essential SQL command categories and master the core operations—Create, Read, Update, and Delete (CRUD)—to effectively manage and maintain your database content. -
Introduction to PostgreSQL
Set up your PostgreSQL database and learn how to connect to it using pgAdmin, enabling you to manage and interact with your data effectively. -
Pass by Value vs. Pass by Reference
Understand the differences between passing data by value and by reference in programming, and how these concepts impact memory management and data manipulation in your applications. -
Housekeeping Refactor
Refactor your Express application to improve organization, performance, and maintainability by consolidating middleware, implementing dynamic asset loading, and reorganizing views. -
Coding Challenge: Emergency Handoff
Finish a coworker's nearly-complete site after a family medical emergency by completing the remaining to-dos and polishing final details for launch.
Part 2
Complete the following in the specified order by the due dates listed in Canvas or before the end of the unit if no date is listed:
-
HTTP Methods
Learn the differences between HTTP methods GET and POST, their roles in web applications, and how to use them in Express. Briefly explore other HTTP methods such as PUT, DELETE, and PATCH, and understand how each enables different types of client-server interactions. -
Sessions and Session Storage
Understand how web application sessions work, the role of session storage in maintaining user state, and how to implement sessions in your Express applications to enhance user experience and security. -
Building Your First Form
Build a functional contact form to experience client and server-side validation, secure data storage in PostgreSQL, and user feedback through in-app message viewing after submission. -
Prepared Queries
Learn about prepared queries in SQL, their benefits for security and performance, and how to implement them in your database interactions to protect against SQL injection attacks. -
Client and Server Data Validation
Learn about validating user input on both the client and server sides to ensure data integrity, enhance security, and improve user experience in web applications. -
Hashing vs. Encryption
Understand the fundamental differences between hashing and encryption, their respective use cases, and how to apply each method appropriately to secure sensitive data in your applications. -
Building a Registration Form
Build a user registration system with password hashing, comprehensive validation, and user management using Express, PostgreSQL, and bcrypt. -
Building a Login Form
Build a secure login page and protected dashboard using Express sessions and PostgreSQL. Implement authentication, session management, and route protection for user accounts.