sasalatart / quizory

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

Home Page:https://quizory.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

📖 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.22
  2. Node v20.10 + pnpm
  3. Docker
  4. Docker Compose

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@localhost:5433/postgres?sslmode=disable
OPENAI_API_KEY=<your-openai-key>
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), WITHOUT live-reload (for now)
#   3. The React (port 5173), with HMR
$ make dev

# Alternatively, if you would like to generate questions to seed your database, you can run the
# following, which adds periodic generation of questions.
# Note that this will consume your OpenAI credits.
$ make dev GENERATE_FLAG=-generate

You should now be able to access http://localhost:5173 and explore the app.

Testing

# Shell 1: Turn on the dev infra (specifically, we need the Postgres database container)
$ make dev

# Shell 2: Run the actual tests
$ 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.

https://quizory.vercel.app

License:Other


Languages

Language:Go 72.7%Language:TypeScript 24.1%Language:Makefile 1.8%Language:JavaScript 0.7%Language:Dockerfile 0.5%Language:HTML 0.2%Language:CSS 0.0%