Skip to content
/ LoFlo Public

LoFlo, a simple flashcard app. Create, study, and reinforce your knowledge.

Notifications You must be signed in to change notification settings

AdamUhh/LoFlo

Repository files navigation

Loflo

Welcome to Loflo, a simple flashcard app for effective learning.

Features

  • Create folders, sub-folders, and flashcards.
  • Search, bookmark, and filter flashcards.
  • Dedicated practice mode.
  • Text-to-Speech.

The App

Practice mode

Editing, filtering, and sub-folders

Development

Install

pnpm i

Run development

pnpm dev

NextAuth

  • For github credentials, remember that it should be an OAuth App, not the Github App

Turso DB

My steps to install Turso CLI on Windows

  • Download WSL
  • Download Homebrew (if not installed)
    • Follow cli steps to ensure it's added to your PATH
    • Run sudo apt-get update
    • Ensure Build tools are installed: sudo apt-get install build-essential procps curl file git
    • Ensure gcc is installed brew install gcc
  • Install Turso CLI using the following command (at the time of writing this): brew install tursodatabase/tap/turso
  • Go to the Releases Page and copy the link to the latest linux file, example:sqld-x86_64-unknown-linux-gnu.tar.xz
  • Open WSL terminal (not cmd, has to be WSL), type cd to go to root, and run wget LATEST_LINK__HERE, ex: wget https://github.com/libsql/sqld/releases/download/v0.21.9/sqld-x86_64-unknown-linux-gnu.tar.xz
  • Unzip the tar file using tar -xf FILE_NAME, ex: tar -xf sqld-x86_64-unknown-linux-gnu.tar.xz
  • Type ls to view the name of the extracted folder
  • cd into the folder, ex: sqld-x86_64-unknown-linux-gnu/
  • Move sqld into a system-wide directory using sudo mv sqld /usr/local/bin/
  • Open ~/.bashrc using vim ~/.bashrc or an editor of your choice (eg: nano)
    • Use your arrow key to go all the way down to a new line, press the Insert key on your keyboard, and paste export PATH="/usr/local/bin/sqld:$PATH"
    • Then, press Escape on your keyboard, type :w and press ENTER
    • Then type :x, and press ENTER
    • Type source ~/.bashrc in the terminal (to refresh paths)
  • Verify sqld works by typing sqld --version
  • Then run locally, using the Turso command below

Also, if you accidentally typed exit on the WSL terminal, and it lost color, packages, and functionality, type source ~/.bashrc

Run db locally

turso dev --db-file dev.db

Push db

pnpm db:push

Drizzle Studio

pnpm studio

Production

  • First, login - you may need to add --headless at the end
  • if you do need --headless, just sign in and paste the secret export to your cli
turso auth login
  • Then, create your database name
turso db create DBNAME
  • Then, show your newly create db's info
  • It will show a URL, put that in your .env.local as your DATABASE_URL
turso db show DBNAME
  • Then, create a secret token for your db
  • Use that as your DATABASE_AUTH_TOKEN
  • -e none is to not expire
turso db tokens create DBNAME -e none
  • Upload app to vercel with these environment variables, and you're done :P
vercel --prod

IMPORTANT

  • Make sure that you push your schema to the product turso db
  • In other words, run pnpm db:push in your CLI with your turso env instead of dev env

Known Issues

  • Count for nested subfolders and flashcards are not accurate.

About

LoFlo, a simple flashcard app. Create, study, and reinforce your knowledge.

Topics

Resources

Stars

Watchers

Forks

Languages