Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# If you prefer the allow list template instead of the deny list, see community template:
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
#

# Air tmp
tmp/

# Binaries for programs and plugins
*.exe
*.exe~
Expand Down
59 changes: 59 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Marks ![Static Badge](https://img.shields.io/badge/weather-%23b16ded?style=flat&logo=github&logoColor=black&labelColor=0%2C0%2C0&link=https%3A%2F%2Fgithub.com%2FweatherGod3218%2F)

### How Fast can ___YOU___ Eat a garbage plate?!?

A simple timer based system for tracking how fast members of CSH can eat a garbage plate. Ohhh the things we do

_This project uses Golang, [Gin](https://gin-gonic.com/en/), and Vite React._

## Documentation
All API Endpoints have swagger doucmentation, which can be viewed at `/swagger/index.html`

# Local Development
Pre - Requirements:
- Node v20+
- go 1.26+
- air (`go install github.com/air-verse/air@latest`)
- PostgreSQL database
- ___OPTIONAL___: Redis cache

## Docker Compose

Marks uses docker compose for local development. The entire suite can be started by running
```
docker compose up --build
```

Marks utilizes a local proxy for local development. Whenever air is used, it creates a proxy
for the Vite frontend development instead. This route allows all of Vite's features
along with running the application.

## Starting NPM Dev Server
For development, enter `web/` and complete the following:

- install web dependencies
```bash
npm i
```

- run development server
```bash
npm run dev
```

The development server will begin at port 5173. Do not use this port to access the project.

### Starting Backend
In a new terminal, complete the following:

- install dependencies
```bash
go mod download
```

- begin development backend server
```bash
air
```

Shoutout to Tyler Severino for the proxy + air approach for local development.
1 change: 1 addition & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ services:
- csh-marks-network

csh-marks:
build: .
ports:
- "8080:8080"
env_file:
Expand Down
Empty file added docs/DECISIONS.md
Empty file.
40 changes: 40 additions & 0 deletions docs/INFRA.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Database Schema

## Events
- id (UUID) (PRIMARY)
- name (TEXT) (NOT NULL)
- created_at (TIMESTAMP) (NOT NULL)
- created_by (UUID) (NOT NULL)
- status (TEXT) (NOT NULL) (open|archived)

## Timers
- user_uuid (UUID) (NOT NULL) UNIQUE(user_uuid,event_id) # uniquely identifies a user's timer for an event
- event_id (UUID) (NOT NULL) FOREIGN KEY(event_id) REFERENCES events(id) # references to events(id)
- start_time (TIMESTAMP)
- end_time (TIMESTAMP)


## Audit Logs
- id (UUID) (PRIMARY KEY)
- event_id (UUID) (NOT NULL)
- user_uuid (UUID) (NOT NULL)
- action (TEXT) (NOT NULL)
- created_at (TIMESTAMP) (NOT NULL)

# API

## Events
- Create __[Post]__ (Name, Who created for Audit)
- Open __[Post]__ (Id, Who's opening for Audit)
- Archive __[Post]__ (Id, Who's archiving for Audit)
- Get __[Get]__ (All Events, if not eboard or RTP just give open ones)


## Timer
- Start __[Post]__ (UserUUID, EventId)
- End __[Post]__ (UserUUID, EventId)


## Leaderboard.
- Top __[Get]__ (queryParam eventId)
- Group __[Get]__ (queryParam eventId, timerVal (for pagination))
Loading