Kerrigan

Postgres DB

GPL-3.0 License

Stars
0

Kerrigan - PostgreSQL Integration

Table of Contents

Overview

This project integrates the Kerrigan PostgreSQL database with the Duke_rs server, now re-implemented in Rust. The project aims to set up user and task management with a Postgres database, managing migrations, and deploying to a DigitalOcean droplet.

Deployment Status

Roadmap

Registration Process

  • Step 1: User enters email address and clicks "Register"
  • Step 2: Check for duplicate email
  • Step 3: If email is not duplicate, create a new user
  • Step 4: Send confirmation email with a link
  • Step 5: User clicks the confirmation link and is registered

Milestones

  • Create User Table in Postgres
  • Create Task Table in Postgres
  • Implement User Registration Endpoint
  • Implement Task Creation Endpoint
  • Add Unit, Integration, and E2E testing

Migrations

  • Migration Tool: diesel with Rust
Samples
@ = %40
[email protected] = name%40gmail.com

export [email protected]
export PG_PASSWORD=password
export PG_HOST=ip_address
export PG_PORT=port
export PG_DATABASE=db_name

export DATABASE_URL=postgres://$PG_USER:$PG_PASSWORD@$PG_HOST:$PG_PORT/$PG_DATABASE
diesel migration run

Containerization & Deployment

  • Docker Container Name: kerrigan
  • Container Name: kerrigan
  • Hosting: DigitalOcean Droplet

Project Setup

1) Create GitHub Repository

  • Initialize a new repository on GitHub for the project.

2) Create DigitalOcean Droplet

  • Set up a new droplet on DigitalOcean and configure it to run the Rust application and Postgres database.

3) Store SSH Keys

  • Store SSH keys on both the DigitalOcean Droplet and GitHub repository secrets for secure communication.

4) Initialize Rust Project

  • Install Rust and Cargo on your development machine:
    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    
  • Create a new Rust project:
    cargo new kerrigan_rs
    cd kerrigan_rs