Welcome

Welcome to a brief overview of the CPSC 304 sample project. This guide offers insights into creating your own project from scratch or building upon the provided samples. Through this, you'll gain a deeper understanding of how to construct an application that interfaces with a relational database.

Before we start, let's ensure we're all on the same page with some basic concepts:

There are two main categories of database queries: DDL and DML. DDL, or Data Definition Language, deals with defining and altering the structure of your database tables or the overall schema of your databases. This includes operations like creating, altering, and deleting tables. DML, or Data Manipulation Language, involves manipulating the data within the tables. This encompasses operations such as inserting, deleting, selecting, and updating records.
Just like code, these queries must be executed to take effect.

In our database system, each student has their own personal database space, separate from others. Think of this as your private area within the larger database, where you can create, modify, and delete tables and data without affecting anyone else. When you access the database with your unique username and password, you're directed to your personal database space.
To ensure that you're working with the same set of data throughout your project, you have two options:
  1. Use the same username and password credentials to access the same database space consistently.
  2. Run the same reset SQL script among your group to repeat the (drop-create-insert) process and ensure everyone is working with identical data.

The client-server model describes the interaction between two computer programs in which one program, the client, makes a service request from another program, the server, which fulfills the request. For example, when you search on Google, your browser (the client) requests data from Google's machines (the server).

In the context of software/web applications, we often talk about the frontend and the backend. The frontend is the visual and interactive aspect of an application, like the design and buttons on a website. Meanwhile, the backend, often residing on a server, processes requests, interacts with the database, and applies business logic.

In the client-server communication, the client retrieves data input by a user on the frontend and sends it as part of a request to the backend. The backend processes this request, performing logical operations and potentially manipulating data in the database. The processed data is then sent back to the frontend as a response, where it's rendered using frontend logic and code to be displayed to the user.

For example, consider an online shopping website. When you browse products, view images, and hover over buttons, you are interacting with the frontend, which runs on your device (the client). Once the final place-the-order button has been clicked, your device sends a request to the server. The server, which houses the backend, then checks inventory from their database, processes payment, and updates the database with your order details. Once these operations are completed, the server sends a response back to the client. Your device (the client) then displays this information on the frontend, possibly showing you a thank-you message. In this scenario, the frontend provides the user experience, while the backend ensures the operations are executed correctly, and the client-server model facilitates the communication between your device and the online shopping website's infrastructure.

In network computing, a port is a specific endpoint for sending or receiving data on a computer. Just like an address tells you where someone lives in a city, a port number specifies where to deliver or receive data for a particular service on a computer. For instance, when you visit a website, your computer usually communicates using port numbers 80 (for HTTP) or 443 (for HTTPS).

SSH tunneling, also known as SSH port forwarding, is a method that securely forwards traffic between network ports. When a service on a server isn't directly reachable, setting up an SSH tunnel allows you to create a secure, encrypted connection between a local port and the remote service port. This lets you interact seamlessly with the remote service, as if it were available on a local port of your own machine.

Choice of IDE

We recommend using Visual Studio Code as it makes it easier to develop on the remote undergraduate CS servers. However, it tends to create relic files that can lead to exceeding your account's size quota. Visual Studio Code installs SSH server files on your remote account disk, which may cause the disk to run out of space. If you encounter an error such as not enough space in the command line, you will need to free up disk space following this guide.