A React + Redux application for creating study topics, quizzes, and interactive flip cards. Perfect for studying and memorization.
- 📚 Topics: Organize quizzes by subject or category
- 📝 Quizzes: Create quizzes with multiple flashcards
- 🎴 Flashcards: Interactive cards with front (question) and back (answer)
- 🔄 Card Flipping: Click cards to flip between question and answer
- 🧭 Navigation: Easy routing between topics, quizzes, and cards
- Node.js (v14 or higher)
- npm or yarn
- Clone the repository:
git clone https://github.com/Ollieadams23/quiz-flashcards-react.git
cd quiz-flashcards-react- Install dependencies:
npm install- Start the development server:
npm start- Open http://localhost:3000 in your browser
- Navigate to
/topics/new - Enter a topic name
- Choose an icon
- Click "Add Topic"
- Navigate to
/quizzes/new - Enter a quiz name
- Select a topic from the dropdown
- Click "Add a Card" to add flashcards
- Fill in the front (question) and back (answer) for each card
- Click "Remove" to delete unwanted cards
- Submit the form
- Go to
/topicsor/quizzesto see your content - Click on a quiz to view its cards
- Click any card to flip between question and answer
Runs the app in development mode at http://localhost:3000
Launches the test runner in interactive watch mode
Builds the app for production to the build folder
- React - UI library
- Redux Toolkit - State management
- React Router - Client-side routing
- uuid - Unique ID generation
src/
├── app/
│ ├── App.js # Main app component
│ ├── AppLayout.js # Layout wrapper with navigation
│ ├── routes.js # Route path constants
│ └── store.js # Redux store configuration
├── components/
│ ├── NewQuizForm.js # Quiz creation form
│ └── NewTopicForm.js # Topic creation form
├── features/
│ ├── cards/
│ │ ├── Card.js # Individual card component
│ │ └── cardsSlice.js # Cards Redux slice
│ ├── quizzes/
│ │ ├── Quiz.js # Single quiz view
│ │ ├── Quizzes.js # All quizzes list
│ │ └── quizzesSlice.js # Quizzes Redux slice
│ └── topics/
│ ├── Topic.js # Single topic view
│ ├── Topics.js # All topics list
│ └── topicSlice.js # Topics Redux slice
└── data/
└── icons.js # Available topic icons
The application uses a normalized state structure with three slices:
{
topics: {
'topic-id': {
id: 'topic-id',
name: 'Topic Name',
icon: 'icon-url',
quizIds: ['quiz-id-1', 'quiz-id-2']
}
}
}{
quizzes: {
'quiz-id': {
id: 'quiz-id',
name: 'Quiz Name',
topicId: 'topic-id',
cardIds: ['card-id-1', 'card-id-2']
}
}
}{
cards: {
'card-id': {
id: 'card-id',
front: 'Question',
back: 'Answer'
}
}
}Normalized State: All entities are stored as objects keyed by ID for O(1) lookup performance.
Relationships:
- Topics contain
quizIds[]referencing their quizzes - Quizzes contain
topicId(parent) andcardIds[](children) - Cards are independent entities referenced by quizzes
ID Generation: UUIDs are generated using uuid library to ensure uniqueness across all entities.
| Path | Component | Description |
|---|---|---|
/ |
Topics | Home page showing all topics |
/topics |
Topics | All topics list |
/topics/new |
NewTopicForm | Create new topic |
/topics/:topicId |
Topic | View single topic with its quizzes |
/quizzes |
Quizzes | All quizzes list |
/quizzes/new |
NewQuizForm | Create new quiz |
/quizzes/:quizId |
Quiz | View single quiz with flashcards |
- Create slice file in
src/features/[feature]/[feature]Slice.js - Define initial state, reducers, and selectors
- Export action creators and reducer
- Add reducer to
src/app/store.js
- Create component in appropriate feature folder
- Connect to Redux using
useSelectoranduseDispatch - Add route in
src/app/App.jsif needed - Update route constants in
src/app/routes.js
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Commit changes:
git commit -m 'Add feature' - Push to branch:
git push origin feature-name - Open a Pull Request
This project was bootstrapped with Create React App.