Code By Heart is a full-stack flashcard app that lets users create and save decks of flashcards, then review them at optimally spaced intervals using the SM-2 spaced repetition algorithm (learn more). Flashcards can be either plain text or runnable code snippets, supporting 15+ programming languages, including Python, JavaScript, Go, C++, C, C#, Objective C, Ruby, Java, Scala, Swift, Rust, Kotlin, and Elixir.
github-demo-2022.mp4
- Create a Firebase project for Code By Heart.
- Enable Google Sign-In and add your local host as an authorized domain.
- Update src/firebase/firebase.utils.js with your Firebase API key after cloning the backend repo. Note: Firebase API keys are safe to expose publicly (reference).
- Clone this backend repo.
- Create and activate a virtual environment (
python3 -m venv venvandsource venv/bin/activate), and install dependencies. - Get a free JDoodle API key (jdoodle.com) and create a .env file with:
JDOODLE_CLIENT_ID=your_client_id
JDOODLE_CLIENT_SECRET=your_client_secret
- Create a local PostgreSQL database named code_by_heart and add the connection string to .env:
SQLALCHEMY_DATABASE_URI=postgresql+psycopg2://<user>:<password>@localhost:5432/code_by_heart - Initialize and migrate the database.
- Run the backend:
flask run.
- Clone this frontend repo.
- Install dependencies.
- Create a .env file with your backend URL.
- Start up the frontend:
yarn start.