Skip to main content

Command Palette

Search for a command to run...

Introducing Flashnode: AI-Powered Flashcards for Hashnode Articles

Updated
โ€ข6 min read
Introducing Flashnode: AI-Powered Flashcards for Hashnode Articles
F

Hi there!๐Ÿ‘‹

Iโ€™m Filip, an enthusiastic software development student๐Ÿ‘จโ€๐ŸŽ“

My passion for learning led me to pursue a path in software development. I believe software has the incredible potential to revolutionize the learning experience, making it more accessible, engaging, and rewarding. With the rapid advancements in AI and other technologies, I'm excited about the potential to make a positive impact in education, and Iโ€™m eager to be a part of this transformation.

Why did I start this blog? Mainly for two reasons. First, it keeps me motivated. As an aspiring software developer, I encounter ๐Ÿž every day and sometimes feel like giving up. Writing about my side projects and what Iโ€™m learning keeps me going๐Ÿ’ช Second, writing helps me organize my thoughts and grasp complex topics more thoroughly. If my posts help someone else too, thatโ€™s a huge win!

Introduction ๐Ÿ‘‹

Do you ever come across blog posts that teach you something new but struggle to remember the key points? Whether you're a developer looking for new ideas or a student like me relying on Hashnode as a learning resource, it can be challenging to retain all that valuable information.

Flashnode is here to help! This new Chrome extension uses ChatGPT to generate custom flashcards based on any Hashnode article. With Flashnode, you can test your understanding and retain information more effectively.

Background ๐Ÿ’ก

Like many others, Iโ€™m always excited to learn new things from blogs written by experienced and passionate developers. Unfortunately, I often struggle to remember key concepts. This inspired me to develop a tool that could help readers like myself retain more information from Hashnode articles.

Initially, I created Quiznode, a Chrome extension that generates multiple-choice quizzes using ChatGPT. While it was a great learning experience, it wasn't quite a finished product. The biggest issue was that the multiple-choice options were sometimes ambiguous and misleading. With limited free time, I shelved Quiznode, thinking I might revisit it someday...

Then, I saw the 'AI for Tomorrow Hackathon' banner on Hashnode and clicked 'Participate.' This motivated me to try again. Although I created Quiznode before the hackathon, I decided to start fresh while keeping the main idea. The key change? Switching from multiple-choice quizzes to flashcards, making it easier for ChatGPT to generate accurate content.

Development ๐Ÿ› ๏ธ

Planning

I started by brainstorming feature ideas:

  • Blurring the blog page (to prevent "cheating"๐Ÿค“)

  • Generating questions using ChatGPT

  • Displaying questions as flashcards

  • Allowing users to store the flashcards

Next, I considered how users could review saved flashcards. I wanted to keep the extension simple, focusing on flashcards for the current article. So, I decided to create an accompanying web app where users can view all saved flashcards grouped by article.

With these ideas in mind, I opened up Obsidian and used the Excalidraw plugin to draw sketches of the extension and web app.

Then, I moved to Figma to create simple UI designs.

With a clear vision, I used the Kanban plugin in Obsidian to outline the tasks ahead.

Finally, I opened up VSCode and started coding๐Ÿ’ป.

Building the Extension

The flashcards generating process can be summarized as follows:

  1. Get the host and slug from the article's URL.

  2. Use this information to fetch the markdown of the article using Hashnode API.

  3. Use the markdown with a prompt to get questions and answers (which are then displayed as 'flashcards') from ChatGPT via the OpenAI API.

For storage, I used chrome.storage, which is preferred for Chrome extensions. Also, an extension I found super useful is Storage Area Explorer. This extension provides GUI for chrome.storage in devtools.

Building the Web App

Although it might have been overkill, I used NextJS for the web app. This allowed me to create an API route to handle OpenAI requests (without an additional Express app) and try out Shadcn UI (which is easy to set up with NextJS). Because I had used Tailwind before, I was able to quickly build the web UI.

To transfer flashcards from chrome.storage to the web app, I set the "externally_connectable" manifest property to include my web app's URL. This allowed communication between the web app and the extension. The web app sends a message to the extension, which retrieves the flashcards from chrome.storage and sends them back.

How To Use Flashnode โšก

Using Flashnode is simple. Just read a Hashnode article, open the extension, and let it generate flashcards for you.

You can also open the extension using a keyboard shortcut Ctrl + Shift + F.

To review flashcards from previous articles, visit the Flashnode web app, where all your flashcards are clearly arranged by article. Need to re-read the article? No problem, each flashcard set includes a link to the corresponding article.

User Interface ๐ŸŽจ

Flashnode extension

I aimed for a simple, user-friendly design with three main states:

๐Ÿ‘‰ Loading

๐Ÿ‘‰ Flashcards

๐Ÿ‘‰ End screen

Users can choose not to save the current flashcards by toggling the switch button in the top right-hand corner.

If users revisit an article with saved flashcards, the extension displays the saved flashcards instead of generating new ones (indicated by the missing 'save' toggle switch).

If the user is not on a page containing a Hashnode article, the extension icon turns grey, and clicking it shows a popup with links to the Flashnode web app and Hashnode.

Flashnode web app

The web app includes a responsive sidebar that displays all article titles, each with a badge indicating the number of flashcards associated with the article.

Next to the title of the current set is a Hashnode logo linking to the article. The 'more' button shows a popover with a 'Delete' button to delete the flashcard set.

I also implemented dark mode using Shadcn UI and next-themes.

Benefits ๐Ÿ’ช

Here are the top three benefits of using Flashnode:

๐Ÿ‘‰ Improved retention

  • By converting article content into flashcards, Flashnode helps users retain information more effectively.

๐Ÿ‘‰ Interactive learning

  • Flashcards provide an interactive way to engage with content, making learning more enjoyable. The process of answering questions keeps you actively involved and reinforces your understanding.

๐Ÿ‘‰ Convenience

  • With Flashnode, there's no need to switch between different apps. Everything you need is right in your browser.

I believe this makes the app beneficial to all types of users - from students like myself to professionals, and really anyone who loves to learn๐Ÿ˜€

Possible Improvements๐Ÿ“ˆ

While I'm pleased with the final result, there are a few improvements I'd like to make in the future:

๐ŸŒ™ Dark mode for the extension

  • Currently, dark mode is only enabled for the web app. I would like to add dark mode to the extension as well and synchronize it with the web app for a consistent user experience.

๐Ÿ“ Rich text

  • Right now, the flashcards display questions and answers as plain text. Adding features like bullet lists and code snippets would definitely enhance the user experience by making the information clearer and more organized.

๐Ÿค– Experiment with different prompts

  • Here is the prompt I am currently using:
`I have a markdown of a technical blog post. Please read the post and generate a set of questions and answers based on the content of the blog post. Try to keep your answer brief but to the point.

Example format:

Q: [Your question here]
A: [Your answer here]

Markdown file content:

# ${title}

${markdown}`
  • While this prompt works sufficiently well, I haven't explored other prompts. In the future, I plan to experiment with different prompts to see if any work better.

โœ๏ธ Allow users to edit the flashcards

  • Another feature I would like to add is the ability for users to edit individual flashcards, allowing for more personalized and accurate study material

Conclusion ๐Ÿ“œ

In this post, I shared my experience building an app for Hashnode's 'AI for Tomorrow Hackathon.' It was a rewarding journey that taught me a lot of new skills and concepts. Although I haven't published my app, you can try it locally by following the instructions in my repository.

Thank you for taking the time to read about Flashnode! Any feedback or questions are welcome๐Ÿ™‚

Comments (10)

Join the discussion
M

This is wonderful. Would love to use this for my bookmarks. How are you thinking of monetizing this? And also the GTM and distribution?

F

Thanks!๐Ÿ˜ƒ Since this was my first hackathon, my primary goal was to complete the project and learn from the experience. Currently, the app is only available for local use, but I would like to publish the extension in the future. So far, I haven't considered monetization and don't have immediate plans to do so.

1
A

this is cool ,you have given a lot of thought about it.

1
F

Thank you! Thatโ€™s really nice and motivating to hear.

9
9th Tech1y ago

One look and you know a lot of time was put into this project, awesome!

1
F

Thanks, I really appreciate it!

10
A
Antoni1y ago

This is great

1
A

Great Idea and great extension! By the way I have one question - how are you managing the cost of Web Hosting and OpenAI's API?

1
F

Hi,

Thanks for your patience (itโ€™s been a busy week ๐Ÿ˜…). I really appreciate your encouraging words and your question!

To answer your question, I havenโ€™t published the app yet; itโ€™s currently only available for local use. Iโ€™m considering Vercel for hosting since itโ€™s the first platform that comes to mind when using NextJS. However, I would like to implement some kind of rate limiting for the OpenAI API, which is something I haven't done before and haven't had the time to explore yet.

If you have any tips or suggestions on where to start with rate limiting or web hosting, Iโ€™d really appreciate it!๐Ÿ˜€

Thanks again!

1
A

Filip Melka Well I don't have any suggestion, but I think OpenAI's APIs are rate limited by default.

All the best.

1
S

Nice work, Filip! Enjoyed it!

1
S

This is an amazing project. Loved the creation from idea to final product.

1
S

Great Project Filip Melka๐Ÿ˜ƒ๐Ÿ™Œ๐Ÿ™Œ

1
V

What a creative project ๐Ÿ‘ well done Filip Melka! I shall test it out!

1
H

This is super cool!

1