Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

jiakai-17/CVWO-Assignment-2024

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

86 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CS Gossip

A simple web forum.

Developed by Li Jiakai.

Quick Start

  1. Ensure docker and docker compose are installed.
    1. Refer to the Docker Docs on guides to install Docker and Docker Compose for your system.
  2. Clone the repository.
    1. git clone https://github.com/jiakai-17/CVWO-Assignment-2024
    2. cd CVWO-Assignment-2024
  3. Edit the environment variables in the docker-compose.yml configuration file.
    1. POSTGRES_PASSWORD: YOUR_PASSWORD: Edit YOUR_PASSWORD to your desired password to access the database.
    2. POSTGRES_DB: YOUR_DB: Edit YOUR_DB to your desired database name.
    3. DATABASE_URL: "YOUR_CONNECTION_STRING": Edit YOUR_CONNECTION_STRING to your desired connection string. The connection string should be in the format "host=db user=postgres dbname=YOUR_DB password=YOUR_PASSWORD port=5432".
    4. JWT_SECRETSTRING: "YOUR_JWT_SECRET_STRING": Edit YOUR_JWT_SECRET_STRING to your desired secret string used to sign JWT tokens.
  4. Build and start the application
    1. docker-compose up -d --build
  5. Access the application at http://localhost:3000.
  6. Access the database management interface (adminer) at http://localhost:8080.
  7. To stop the application, run docker-compose down.

Environment variables

Backend

Name Description Default value Required Example
DATABASE_URL The connection string used to connect to the database. None Yes "host=db user=postgres dbname=YOUR_DB password=YOUR_PASSWORD port=5432"
JWT_SECRETSTRING The secret used to sign JWT tokens. secretstring No "YOUR_JWT_SECRET_STRING"
BASE_PATH The base path of the API. /api/v1 No "/api/v1"

Database

Name Description Default value Required Example
POSTGRES_PASSWORD The password used to access the database. None Yes "YOUR_PASSWORD"
POSTGRES_USER The username used to access the database. postgres No "YOUR_USERNAME"
POSTGRES_DB The name of the database to be created and used for the application. Same as POSTGRES_USER No "YOUR_DB"

Development

Refer to the respective README files in the frontend and backend directories for development instructions.

Acknowledgements

This project was developed as part of the CVWO Winter Assignment 2024

The frontend uses React, Material UI, Tailwind CSS and Vite.

The backend is written in Go, with gorilla/mux for routing and sqlc for database access.

The database is PostgreSQL.

The application is containerized using Docker.