A web application for displaying stories with synchronized text and audio.
- Run steps 1-3 of
Go
- Install Go (1.21 or later) from golang.org
- Clone this repository:
git clone https://github.com/shininglegend/glossias cd glossias - Install dependencies:
go mod tidy
-
go run main.go
- Ctrl-c
Add stories via the admin interface at /admin.
- Most story text and audio files are by Dr. Jesse Scheumann, all rights reserved, used with permission
- All other story text and audio files were created by Titus Murphy, all rights reserved.
- Code written by Titus unless otherwise noted.
- AI assistance provided by claude.ai, GitHub Copilot, and Ollama using multiple models. Some documentation is in AiUsage.md. Developed with the Zed IDE.
This project is modular and split up into at least two main parts. The frontend is in /frontend/*, and is a react vite SPA. See ./frontend/routes.ts for the available routes. The backend most of the rest of the code, but runs ./main.go to provide the APIs for the frontend.
This uses the supabase APIs.
The application uses a layered architecture for database access:
┌─────────────────────────────────────────────────────────────┐
│ HTTP Handlers │
│ (admin/handler.go, apis/*) │
└─────────────────────┬───────────────────────────────────────┘
│
│ calls functions
▼
┌─────────────────────────────────────────────────────────────┐
│ Models Package │
│ (src/pkg/models/*) │
│ ┌─────────────────┬────────────────────────────────────┐ │
│ │ UpsertUser() │ GetStoryData() │ SaveStory() │ │
│ │ CanUserAccess() │ GetAllStories() │ DeleteStory() │ │
│ │ IsUserAdmin() │ GetLineText() │ EditStory() │ │
│ └─────────────────┴────────────────────────────────────┘ │
└─────────────────────┬───────────────────────────────────────┘
│
│ uses SQLC queries
▼
┌─────────────────────────────────────────────────────────────┐
│ Generated SQLC Queries │
│ (src/pkg/generated/db/*) │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ queries.UpsertUser() │ queries.GetStoryData() │ │
│ │ queries.CanUserAccess() │ queries.GetAllStories() │ │
│ │ queries.IsUserAdmin() │ queries.SaveStory() │ │
│ └─────────────────────────────────────────────────────┘ │
└─────────────────────┬───────────────────────────────────────┘
│
│ uses database connection
▼
┌─────────────────────────────────────────────────────────────┐
│ Database Connection │
│ (pgxpool.Pool) │
└─────────────────────┬───────────────────────────────────────┘
│
│ executes type-safe SQL
▼
┌─────────────────────────────────────────────────────────────┐
│ Supabase │
└─────────────────────────────────────────────────────────────┘
Key Points:
- HTTP handlers call model functions, never database directly
- Models package uses generated SQLC queries for type-safe database operations
- SQLC generates Go code from SQL queries, providing compile-time safety
- Models package adds business logic layer on top of generated queries
- Authentication middleware calls model functions for user operations
This project was developed under the oversight of Dr. Derrick Tate for academic credit at Sattler College.