party-game

APACHE-2.0 License

Stars
1

Party Game

This is a Next.js project bootstrapped with create-next-app.

Getting started

  1. Clone the repository
    git clone https://github.com/GoogleCloudPlatform/devrel-demos.git
    
  2. Navigate to the Party Game directory
    cd devrel-demos/app-dev/party-game/
    
  3. Install dependencies:
    npm install
    
  4. Run the development server:
    npm run dev
    
  5. Open http://localhost:3000 with your browser to see the result.

Make a change to the application

You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.

Add a question

To add a question to the database:

  1. A project administrator will need to give you access:
    1. Visit https://console.firebase.google.com/project/cloud-quiz-next/settings/iam
    2. Click Add Member
      • Role should be Develop -> Admin
  2. Go to the firestore questions collection https://console.firebase.google.com/project/cloud-quiz-next/firestore/data/~2Fquestions
  3. Click Add document
    1. Click Auto-ID
    2. Add a prompt field, type string, with the value of the question you want to ask.
    3. Add an answers field of type array
    4. For each possible answer, add:
      • text for the possible answer
      • isCorrect boolean for if the answer is correct

Deploy on Cloud Run

TODO: Add more detail to this section for quick project creation

gcloud run deploy party-game --source .

Architecture

flowchart TD
    A[UI <br /> NextJS <br /> /app folder] -->|Post| B[Validation API <br /> NextJS <br /> /api folder]
    B --> |Update| C[(Firestore Database <br /> protected by <br /> Firebase Auth)]
    C -->|GET| A