This project is a Forge app that allows users to make flashcards in a flash!
This Forge app consists of Four Modules that were implemented:
-
Content Action Module: When prompted, it opens up a modal that allows users to manually enter in flashcards.
-
Context Menu Module: Allows users to select a bunch of text and then generate flashcards to save it.
-
Content Byline Module: Allows users to use the entire page and generate flashcards (which is saved in a deck).
-
Global Page Module: Allows user to see all the flashcards and decks created (manually or AI-generated) and then also allows users to tag them and study them if desired.
For more information about functionality, jump to this section: Functionality.
├── flashcards
│ ├── frontend
│ │ ├── build
│ │ │ ├── asset-manifest.json
│ │ │ └── index.html
│ │ ├── package-lock.json
│ │ ├── package.json
│ │ ├── public
│ │ │ └── index.html
│ │ └── src
│ │ ├── ContentActionModule.css
│ │ ├── ContentActionModule.js
│ │ ├── ContentBylineModule.css
│ │ ├── ContentBylineModule.js
│ │ ├── ContextMenuModule.css
│ │ ├── ContextMenuModule.js
│ │ ├── DeckDisplayAddFlashcards.css
│ │ ├── DeckDisplayAddFlashcards.js
│ │ ├── GlobalPageDeckCreate.css
│ │ ├── GlobalPageDeckCreate.js
│ │ ├── GlobalPageDeckEdit.js
│ │ ├── GlobalPageFlashcard.css
│ │ ├── GlobalPageFlashcardCreate.js
│ │ ├── GlobalPageFlashcardEdit.js
│ │ ├── GlobalPageModule.css
│ │ ├── GlobalPageModule.js
│ │ ├── GlobalPageTagCreate.css
│ │ ├── GlobalPageTagCreate.js
│ │ ├── GlobalPageTagEdit.js
│ │ ├── components
│ │ │ ├── CardSlider.css
│ │ │ ├── CardSlider.jsx
│ │ │ ├── DeckDisplay.css
│ │ │ ├── DeckDisplay.jsx
│ │ │ ├── DeckSlider.css
│ │ │ ├── DeckSlider.jsx
│ │ │ ├── DragNDrop.css
│ │ │ ├── DragNDrop.jsx
│ │ │ ├── QuizMode.css
│ │ │ ├── QuizMode.jsx
│ │ │ ├── QuizResults.css
│ │ │ ├── QuizResults.jsx
│ │ │ ├── StudyMode.css
│ │ │ └── StudyMode.jsx
│ │ └── index.js
│ ├── manifest.yml
│ ├── package-lock.json
│ ├── package.json
│ ├── src
│ │ ├── tests/
│ │ ├── ai_generation.py
│ │ ├── aiResolvers.ts
│ │ ├── cardResolvers.ts
│ │ ├── deckResolvers.ts
│ │ ├── helpers.ts
│ │ ├── index.ts
│ │ ├── requirements.txt
│ │ ├── sessions.ts
│ │ ├── tagResolvers.ts
│ │ ├── types.ts
│ │ └── userResolvers.ts
│ ├── start_uvicorn_ngrok.sh
│ └── tsconfig.json
└── README.md
Where the folders are as follows:
flashcards
: Root directory of the code which also consists of:tsconfing.json
,start_uvicorn_ngrok.sh
: bash file required to run ngrok for ai generation,manifest.yml
: used to package and deploy the app on the confluence website.
flashcards/frontend
: Consists of:package_lock.json
andpackage.json
to help withnpm run build
(explained later) and,src
which consists of frontend files.
flashcards/src
: Consists of:- backend files that help for card, deck and tag management and,
- A python file
ai_generation.py
which is used for the AI generation of flashcards and, requirements.txt
: To install all dependencies for the ai generation.
flashcards/frontend/src
: Consists of frontend files for the custom ui appflashcards/frontend/src/components
: Consists of slider files, deck display and study mode files for the custom ui app
-
Set up Forge by creating a forge account, setting a sign in token and installing the latest
@forge/cli
. -
Setting up Ngrok using a pre-made account:
-
Download ngrok:
- For Mac-OS users:
brew install ngrok
- For windows users:
choco install ngrok
- For linux users:
curl -sSL https://ngrok-agent.s3.amazonaws.com/ngrok.asc \ | sudo tee /etc/apt/trusted.gpg.d/ngrok.asc >/dev/null \ && echo "deb https://ngrok-agent.s3.amazonaws.com buster main" \ | sudo tee /etc/apt/sources.list.d/ngrok.list \ && sudo apt update \ && sudo apt install ngrok
-
Run this anywhere in the terminal to add the Ngrok auth token (for access to the website):
ngrok config add-authtoken 2nHmclkN2E4BZv3fWudgOG1Wj5K_zxg5Xwc9XCRNmFTtvm5P
-
If this is the first time you are running the code, follow these instructions:
- Install top-level dependencies in
flashcards
directory:
npm install
- Install dependencies inside of the
flashcards/frontend
directory:
npm install
- Create a
.venv
folder/activate it and install python dependencies inside of theflashcards/src
directory:
python -m venv venv
pip install -r requirements.txt
- Build the app inside of the
flashcards/frontend
directory:
npm run build
- Deploy app by running:
forge deploy --environment development
- Install app in a Confluence site by running:
forge install
- Also remember to run the bash file in the
flashcards
directory to make sure the server is running (to test out the AI generation).
./start_uvicorn_ngrok.sh
- Remember to choose
> Confluence
and then enter the base url of the Confluence site in the form ofhttps://[...].atlassian.net
whenforge install
prompts you with questions.- You can install this app on multiple sites.
If there are any changes made, follow these steps:
- First,
npm run build
(in theflashcards/frontend
directory) and thenforge deploy --environment development
(in theflashcards
directory) command when you want to persist code changes. - You will not need to run
forge install
again as once the app is installed on the site you want to use it.
- Flashcards consist of front (question) and back (answer) pairs, with the optional functionality to add a hint or lock the card.
- Decks are groups of flashcards, which consists of a deck title and an optional deck description and also have the option to lock the deck.
- Tags are optional used to groups decks and flashcards if required; it consists of a tag title, options to choose the tag color and also options to lock the tag.
- Each deck consists of:
- Study Mode: Users can study flashcards by flipping through them as many times as they want.
- Quiz Mode: Similar to Study mode, the users can study flashcards but they are prompted to either click
correct
,incorrect
orskipped
based on whether they remember the content of the flashcards or not. - Quiz Results: Once the Quiz modes are done, they can view their individual past results.
- Users can filter content through:
- Tags: Click on individual tags/multiple tags to toggle the decks and cards present within that tag (note with this: ai-generated content are automatically saved under the
auto-generated
tag). - Personal/All toggle:
Personal
displays flashcards and decks of the individual andAll
displays all the flashcards, decks and tags created within the space.
- Tags: Click on individual tags/multiple tags to toggle the decks and cards present within that tag (note with this: ai-generated content are automatically saved under the
- Functionality to change the flashcard/deck/tag: Users can edit or delete them depending upon the permissions set by the user who created them (see notes for more information on locked).
- Quiz and Study mode dynamically updates based on an individual user's scores.
- Locked means that no other user can edit the flashcard/deck/tag of the person that made the flashcard/deck/tag.
Here are some extra resources to help understand this app further:
- Custom-UI kit tools used from Materials UI and Atlastkit.
- Storage: This forge app used key-value pairs in
forge storage
to store our data. - Page information and user information invoked through Confluence Rest API v2.
- Note: these were invoked using requestConfluence and getContext from
@forge/bridge
.
- Note: these were invoked using requestConfluence and getContext from
- NLP Models (for AI generation) are taken from HuggingFace.
- AI generation was done by hosting code in the free tier for ngrok.
- See Get help for how to get help for forge and provide feedback.
- See developer.atlassian.com/platform/forge/ for documentation and tutorials explaining Forge.