Skip to content

Minimalistic history trivia app generating content on regular intervals by consuming OpenAI's GPT-4 models.

License

Notifications You must be signed in to change notification settings

sasalatart/quizory

Repository files navigation

📖 Quizory

m

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:

  1. https://quizory.vercel.app for the app
  2. 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:

  1. Go v1.23
  2. Node v20.10 + pnpm
  3. Docker
  4. Docker Compose
  5. Protobuf

Also, make sure you have:

  1. A Supabase account (free tier) with Google's auth provider enabled.
  2. 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...

  1. Yes, thanks OpenAI.
  2. More importantly, thanks to whoever's data was used to train GPT4.

Furthermore, this project relied heavily on:

  1. DaisyUI - Licensed under the MIT License
  2. go-openai - Licensed under the Apache License, Version 2.0
  3. oapi-codegen - Licensed under the Apache License, Version 2.0
  4. SQLBoiler - Licensed under the BSD-3-Clause License

License

Copyright (c) 2024, Sebastián Salata Ruiz-Tagle

Quizory is MIT licensed.

About

Minimalistic history trivia app generating content on regular intervals by consuming OpenAI's GPT-4 models.

Topics

Resources

License

Stars

Watchers

Forks