The COIL Database is a full-stack web application which provides a user-friendly way to access and modify information required by the UNC Global Affairs staff to maintain the COIL program.
The COIL (Collaborative Online International Learning) Database is a web application designed by The Global Education Team to enhance how the UNC Global Affairs staff manages information related to COIL courses. The Global Education Team is the team of UNC Global Affairs staff members that manage the COIL Database. Currently, staff rely on Excel spreadsheets, which are prone to human errors and inconsistencies, especially due to user-created formulas. This new web based database will serve as an upgrade, offering a more structured and efficient way to input and manage course data. It will also introduce quality-of-life features, such as diagnostic tools and graphs to further streamline the management process.
The software is primarily for the UNC Global Education Team, who are divided into admins and team members. Admins will have the ability to add and update course information using intuitive forms, ensuring data accuracy. Meanwhile, team members will have access to view the data and generate reports either directly on the website or by exporting the data as CSV files. By distinguishing roles at login, the system ensures a seamless and secure experience, allowing admins to manage data effectively while users can view it without accidentally altering the database, making the process both efficient and error-free.
cd backend
python -m venv venv
oc login --web
Usage:
- Run
make installto install dependencies for both backend and frontend. - Run
make test_backendto run integration tests on the Python backend. - Run
make backendto start the Python backend. - Run
make frontendto start the React frontend. - Run
maketo start both the backend and frontend concurrently in separate terminals if you're using a multiprocess terminal setup.
This document outlines the steps to connect to a PostgreSQL database running on OpenShift, create a test table, and verify its functionality.
- Access to OpenShift CLI (
oc) > useoc login - Permissions to interact with the OpenShift project
- PostgreSQL instance running in your OpenShift project
-
Find the Pod Name: Run the following command to list the pods and find the PostgreSQL pod name:
oc get pods
-
Access the Pod: Use the
oc rshcommand to connect to the PostgreSQL pod:oc rsh <your-postgresql-pod-name>
-
Connect to PostgreSQL Using
psql: Inside the pod, connect to the PostgreSQL database with the following command:psql -U <POSTGRES_USER> -d <POSTGRES_DB>
Replace
<POSTGRES_USER>and<POSTGRES_DB>with the appropriate values (e.g.,dev_useranddev_db).
-
Exit
psql: Type the following command to leave thepsqlprompt:\q
-
Exit the Pod Shell: Type
exitto leave the pod shell.
To run SQL files in order to populate or alter the databases used the following piped command:
cat <path to sql file> | oc rsh <psql pod> psql -d <db_name>
The <db_name> will be prod_db for the production database pod and dev_db for the development database pod.
You have now successfully connected to the PostgreSQL database, created a test table, and inserted data.