📖 Quizory
Quizory is a (WIP) minimalistic history trivia app that generates its content on regular intervals
by consuming OpenAI's GPT-4 models.
I built it because I like history, and wanted to learn in a fun way 🤓
You may try Quizory by visiting the following links:
- https://quizory.vercel.app for the app
- Swagger Docs for the API docs
Disclaimer: While Quizory aims to provide accurate historical information, it is important to
acknowledge that the content generated by LLMs may occasionally include inaccuracies. Please
remember that this project is intended for entertainment purposes only and should not be
considered a definitive source of historical facts.
Local Dev Setup
Dependencies
This project requires the following to be installed in your machine:
- Go v1.23
- Node v20.10 + pnpm
- Docker
- Docker Compose
- Protobuf
Also, make sure you have:
- A Supabase account (free tier) with Google's auth provider enabled.
- An OpenAI account with access to GPT4.
Even though not a hard requirement, having Make
available will allow you to follow the examples
detailed in this doc. You may use Make help
to take a look at the main commands available.
Environment Variables
Make sure you have a .env.quizory
file in your root dir filled as follows:
DB_URL=postgres://postgres:postgres@postgres:5432/postgres?sslmode=disable
LLM_OPENAI_KEY=<your-openai-key>
SERVER_JWT_SECRET=<your-supabase-jwt-secret>
Also, make sure you have a client/.env.local
file filled as follows:
VITE_SUPABASE_URL=<your-supabase-url>
VITE_SUPABASE_KEY=<your-supabase-public-key>
VITE_BASE_API_URL="http://localhost:8080"
Running The App
# Install the Go & JS dependencies
$ make install
# Concurrently turn on:
# 1. A local Postgres database via docker-compose
# 2. The Go backend (port 8080), with live-reload via air
# 3. The React (port 5173), with HMR
# 4. The OTel stack - Grafana (UI via port 3000), Loki, Prometheus & Jaeger
$ make dev
# In a separate shell, you may seed some questions manually to get started:
$ make questionsgen
You should now be able to access http://localhost:5173 and explore the app.
You can also access Grafana via http://localhost:3000, and login with admin/admin credentials.
Configuring
This project relies on viper for configuration management. You may find the configuration file
in config/config.yaml
, and exposed to Go via config/config.go
.
Testing
$ make test
Credits
None of the questions, answers or historical context served by this project have been provided by me.
All has been generated from OpenAI's GPT-4 models. So...
- Yes, thanks OpenAI.
- More importantly, thanks to whoever's data was used to train GPT4.
Furthermore, this project relied heavily on:
- DaisyUI - Licensed under the MIT License
- go-openai - Licensed under the Apache License, Version 2.0
- oapi-codegen - Licensed under the Apache License, Version 2.0
- SQLBoiler - Licensed under the BSD-3-Clause License
License
Copyright (c) 2024, Sebastián Salata Ruiz-Tagle
Quizory is MIT licensed.