This guide walks you through cloning TriviaPP, wiring up its two external backends (Firebase and AWS Amplify), and launching the app in your browser or on an Android device. By the end you will have a fully functional local instance of the Star Wars trivia app running with live authentication, a working leaderboard, and dynamic SWAPI-powered questions.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/dreancaste/TriviaPP/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Make sure the following tools are installed before you begin:- Node.js ≥ 18 — required by Angular 17 and the Ionic CLI
- Angular CLI 17 —
npm install -g @angular/cli@17 - Ionic CLI —
npm install -g @ionic/cli - Android Studio — only needed if you want to build and run on a physical device or Android emulator
Setup
Clone the repository and install dependencies
Clone the project from GitHub and install all npm packages:This installs Ionic, Angular, Capacitor, AWS Amplify, the Firebase SDK, and all other dependencies listed in
package.json.Configure Firebase
TriviaPP uses Firebase Firestore for the online daily leaderboard. Open
You can find all of these values in the Firebase Console → Project Settings → Your apps → SDK setup and configuration.See Firebase Setup for detailed instructions on creating a Firebase project and enabling Firestore.
src/firebase.config.ts and replace the placeholder values with your own Firebase project credentials:| Field | Description |
|---|---|
apiKey | Your Firebase Web API key |
authDomain | OAuth redirect domain for your project |
projectId | Unique identifier for your Firestore database |
storageBucket | Firebase Storage bucket URL |
messagingSenderId | Cloud Messaging sender ID |
appId | Firebase Web App ID |
Configure AWS Amplify authentication
TriviaPP authenticates users with AWS Amplify backed by Amazon Cognito. Amplify requires a configuration file at the project root.
- If you are using Amplify Gen 2, place your generated
amplify_outputs.jsonfile in the project root. - If you are using Amplify Gen 1, place
amplifyconfiguration.jsonin the project root instead.
amplify push (Gen 1) or npx ampx generate outputs (Gen 2) from a configured Amplify backend.See AWS Amplify Auth Setup for step-by-step instructions on provisioning a Cognito User Pool and connecting it to TriviaPP.Start the development server
Launch the Ionic development server:This runs
ionic serve and opens the app at http://localhost:8100. Hot-reload is enabled — any saved change in src/ is reflected instantly in the browser.(Optional) Build and run on Android
To run TriviaPP on a physical Android device or emulator, build the Angular app, sync the native project, and open it in Android Studio:From Android Studio, select your target device and click Run. The Capacitor Camera and Haptics plugins will be fully functional on a real device.
Available Scripts
The following npm scripts are defined inpackage.json:
| Script | Command | Description |
|---|---|---|
npm start | ionic serve | Start the local dev server at http://localhost:8100 |
npm run build | ng build | Compile the Angular app into www/browser/ for production |
npm test | ng test | Run the unit test suite with the Angular test runner |