Figma link (design will be updated for each milestone):
https://www.figma.com/design/2SqR3fiXOo7O1gCOu5KLK7/poker-replay?node-id=0-1&t=ln2VSweIvejDPM7F-1
This document outlines the steps required to create and configure the cs348
database locally. These steps assume that PostgreSQL is installed on your machine.
- PostgreSQL installed on your local machine.
- Should be in the
backend
directory.
Open your terminal and connect to the default PostgreSQL user (typically postgres
). Run the following command:
psql postgres
Run the following command to create the cs348
database:
CREATE DATABASE cs348;
Once the database is created, connect to it using the following command:
\c cs348
Create a new user called admin and set a password. This user will be used to manage the database:
CREATE USER admin WITH PASSWORD 'admin123';
Grant all privileges on the database to the admin user to allow full control over the database:
GRANT ALL PRIVILEGES ON DATABASE cs348 TO admin;
Exit the PostgreSQL command line interface:
\q
You can verify that the database was created successfully by connecting to it using the admin
user:
psql -d cs348 -U admin
Run the following command to load the schema into the database:
psql -d cs348 -U admin -f sql/create_tables.sql
This adds some convenience functions to your shell. If you don't want to use them, you can skip this step.
To run these the cs348 db must be setup.
Edit your shell profile (~/.bashrc for Bash, ~/.zshrc for Zsh):
export POKER_REPLAY_ROOT=$HOME:/path/to/poker-replay
Then add the following to the end of the file:
source $POKER_REPLAY_ROOT/shell_commands.sh
Then source the profile:
source ~/.zshrc
Usage:
- Drop Tables:
drop_tables
- Create Tables:
create_tables
- Load Data:
load_data