Skip to content

caroger/flashcode

Repository files navigation

Contributors Stargazers Issues MIT License


Logo

Your Best LeetCode Buddy

A flash card system with built-in spaced repitation function to help you retain your knowledge from LeetCode practices

Start FlashCoding · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Roadmap
  4. Contributing
  5. License
  6. Contact

About The Project

Product Name Screen Shot

There are many great flashcard and note taking apps available online, however, as a group of upcoming bootcamp graduates, we didn't find one that really suit our needs of preparing for the live coding interview, so we created one for ourselves. We want to create a flashcard system for aspiring software engineers and LeetCoders so amazing that it'll be the only one you ever need -- We think this is it.

Here's why:

  • Your time should be focused more on solving algorithm problems and less on planning which to solve.
  • You shouldn't be juggling multiple websites/apps to take notes and setup review schedules.
  • FlashCode is the one and only reliable source you'll need to track your mastery of the LeetCode problems you've attempted.

Built With

This project is built with:

Getting Started

Head over to the live site and click the Sign In button to log in, register, or test out FlashCode with a demo account.

Create a card

Create a card by simply entering the corresponding LeetCode problem number and give it a rating based on how confident you feel about solving the same problem in a interview setting:

  1. Totally going to ace it
  2. Will be able to solve it with some help
  3. Hard stuck

FlashCode employs thunks for asynchronous CRUD actions to more effectively manage dispatch calls between front and backend.

export const createCard = (card) => (dispatch) =>
  CardAPI.createCard(card)
    .then((card) => dispatch(receiveNewCard(card)))
    .catch((err) => {
      dispatch(receiveCardErrors(err.response.data));
      return Promise.reject(err);
    });

FlashCode retrieves LeetCode problem details by making axios fetch request to LeetCode's public API. It guarentees the ease and the accuracy of card creation with only the problem number from user input.

const axios = require('axios');
let lcdata;
axios.get('https://leetcode.com/api/problems/all/').then((res) => {
  lcdata = res.data;
});

function findProblem(probNum, input = lcdata) {
  problem = input['stat_status_pairs'].filter((pair) => pair.stat.question_id === probNum)[0];
  return problem;
}

Take notes

Flip over the card to write down any notes/tips you'd like to save for when you review the same question in the future.

The card flipping animation is built using CSS variables, positioning, and transform properties.

.card {
  ...
  display: flex;
  justify-content: center;
  position: relative;
  transform: perspective(1000px) rotateY(var(--rotate-y, 0)) translateY(var(--translate-y, 0));
  transform-style: preserve-3d;
  transition: 300ms;
}

Review

Based on your confidence rating and review history, we will prepare a "Daily Deck" for you to review. The goal is to have your "Daily Deck" be empty at the end of the day!

  1. Click on the Daily Deck button on left navbar to review problems due today
  2. Cards that are way over-due will have a red shadow around their borders
  3. Navigate to LeetCode via the URL on the card, finish and submit your solution on LeetCode, and comback to FlashCode to update your rating and notes.

When reviewing cards, users can choose to sort cards by due date, created date, or last updated.

sortCards(cards) {
  const sortedCards = cards;
  switch (this.state.sortBy) {
    case 'dueDate':
      return sortedCards.sort((a, b) => (a.dueDate > b.dueDate ? 1 : -1));
    case 'createdAt':
      return sortedCards.sort((a, b) => (a.createdAt < b.createdAt ? 1 : -1));
    case 'updatedAt':
      return sortedCards.sort((a, b) => (a.updatedAt > b.updatedAt ? 1 : -1));
    default:
      return cards;
  }
}

Your card's due date is determined by previous time intervals and the rating. FlashCode will pull the previous time interval (if it exists) and assign a new due date based on the day you completed the problem and the rating you gave it.

const setDueDate = (interval, updatedAt = new Date()) => {
      return updatedAt.setDate(updatedAt.getDate() + interval);
};

if (card) {
  let today = new Date();
  if (Date.parse(card.dueDate.toDateString()) <= Date.parse(today.toDateString())) {
    if (req.body.rating) {
      card.rating = parseInt(req.body.rating);
      let lastInt = card.interval[card.interval.length - 1];
      switch (card.rating) {
        case 3:
          lastInt = Math.floor(lastInt * 0.4) + 1;
          break;
        case 2:
          lastInt = lastInt;
          break;
        case 1:
          lastInt = lastInt * 2;
          break;
      }
      card.dueDate = setDueDate(lastInt);
      card.interval.push(lastInt);
      ...
    }
    ...
  }
  ...
}
    

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/YourFeature)
  3. Commit your Changes (git commit -m 'Add YourFeature')
  4. Push to the Branch (git push origin feature/YourFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Project Team

Role Contacts
Roger Hu Project Lead Roger HuRoger Hu
Colin Eckert Frondend Lead Colin EckertColin Eckert
Dongsoo Cha Backend Lead Dongsoo ChaRoger Hu
Edwin Zhou Fullstack Engineer Edwin ZhouEdwin Zhou

About

Flash cards with spaced-repetition memory system for LeetCoders!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •