The Trivia App is a mobile application built with React Native and Expo. This app allows users to test their knowledge across various categories through True / False trivia questions. The questions are fetched from an open trivia API, providing a diverse range of topics and difficulty levels.
- Multiple Categories: Choose from a wide range of trivia categories such as General Knowledge, Science, History, and more.
- Dynamic Question Fetching: Questions are fetched in real-time from an external API, ensuring a fresh experience every time.
- Progress Tracking: See how well you’re doing as you progress through the quiz.
- Detailed Results: Review your performance at the end of each quiz.
There are a few enhancements that I plan to implement when time permits:
- Description: Integrating a light/dark theme toggle will enhance the user experience by allowing users to switch between light and dark modes depending on their preference or system settings.
- Description: Implementing internationalization (i18n) will enable the app to support multiple languages, making it accessible to a broader audience. Using
react-i18next
will provide a robust solution for managing translations and localization.
To run and develop this project, you'll need the following tools installed on your machine:
- Node.js: Recommended version 14.x or later
- npm: Comes with Node.js, used to manage project dependencies
- Expo CLI: To run and develop the app using Expo's managed workflow
- Git: For version control
First, clone the repository to your local machine:
git clone https://github.com/endritvitija/trivia-app.git
cd trivia-app
Install the necessary dependencies using npm:
npm install
Start the Expo development server to run the app:
npm start
This command will open the Expo Developer Tools in your web browser. From here, you can run the app on an emulator, a physical device, or a web browser.
The project includes unit tests to ensure the app's functionality. To run the tests:
npm test
This will run the Jest test suite, including the unit tests for API requests.
- Select a Category: On the home screen, choose a trivia category to begin your quiz.
- Answer Questions: For each question, select the correct answer from the provided options.
- Track Your Progress: As you answer questions, track your progress and see how well you're doing.
- Review Results: After completing the quiz, review your results to see how many questions you got right.
- Restart or Select a New Category: Once you've completed a quiz, you can start a new quiz with the same or different category.
src/api/
: Axios Interceptors.src/assets/
: Fonts and Images.src/components/
: Reusable UI components such as buttons, text fields, etc.src/constants/
: Model and Types.src/screens/
: Different screens of the app like HomeScreen, QuestionScreen, and ResultsScreen.src/services/
: Services that handle API requests.src/atoms/
: State management using Jotai for managing app-wide state like questions, progress, etc.