Git Product home page Git Product logo

vmaramreddy2 / developer-journey-app Goto Github PK

View Code? Open in Web Editor NEW

This project forked from googlecloudplatform/developer-journey-app

0.0 0.0 0.0 527 KB

Developer Journey App is a gaming sample app, built with Cloud Run, Cloud Storage, Cloud Firestore, and Cloud Build.

Home Page: https://cloud.google.com/architecture/application-development/dynamic-app-javascript

License: Apache License 2.0

JavaScript 2.01% TypeScript 46.00% CSS 0.41% HCL 10.29% Dockerfile 1.00% HTML 40.28%

developer-journey-app's Introduction

Developer Journey Dynamic Web App

Developer Journey App gives developers a fun user interface for exploring a simple maze to find and collect resources that provide technical tips.

The main goal of the app, however, is to showcase how to write Next.js apps to reap the performance benefits of Google Cloud and Cloud CDN.

Launch

Open in Cloud Shell

Features

This is a demo app built with TypeScript, Next.js and React. The app demonstrates Static Generation and Server-side Rendering techniques for pre-rendering cacheable pages.

This demo runs on Google Cloud using the following services:

Getting Started

Prerequisites

To run Dev Journey locally using your own machine, you will need to install the following:

Installing the Firestore Emulator for local development is optional. If you don't use the emulator, you will need to create a database on Cloud Firestore that you can use for development and testing.

The Google Cloud Firestore emulator requires a Java 8+ JRE installed and on your system PATH

If you need to install Java, you can get it from here: https://adoptium.net/

  • To choose a specific version, to to: https://adoptium.net/temurin/releases/
  • If you're on a Mac with an Apple Silicon M1 or M2 chip, choose the aarch64 architecture.
  • Choose JRE instead of the full JDK package unless you plan to do Java development.

Run the app locally

  1. Start the Firestore Emulator

    Choose the port you want to use for the Firestore Emulator, for example 9999.

    Note: If you choose a port that is not 9999 for this demo, you will need to update the host property in database.ts to match your selected port.

    Export the FIRESTORE_EMULATOR_HOST environment variable:

    export FIRESTORE_EMULATOR_HOST="localhost:9999"

    When the exported FIRESTORE_EMULATOR_HOST environment variable is set, the Firestore client will automatically use it to connect to the emulator.

    To start the emulator:

    gcloud emulators firestore start --host-port="$FIRESTORE_EMULATOR_HOST"

    Press Ctrl-C when you want to stop the Firestore emulator.

  2. Get the code

    Clone this repo and change your current working directory to it:

     git clone https://github.com/googlecloudplatform/developer-journey-app.git
     cd developer-journey-app
  3. Set local development environment variables

    Copy the example .env.local.example file to a new file .env.local:

    cp .env.local.example .env.local

    This file is used by Next.js to define default development values such as FIREBASE_EMULATOR_HOST. If neccessary, change any of the default values provided.

  4. Install npm dependencies:

    npm install
  5. Run the development server:

    npm run dev

    Open http://localhost:3000 with your browser to see the result.

    You can start editing the application. The browser auto-refreshes when you save changes.

    The repo's package-lock.json will be ignored by git if you commit changes (configured in .gitignore).

Tests

Before running tests, make sure you have the Firestore Emulator running on your local machine on the indicated port.

To run Jest tests:

FIRESTORE_EMULATOR_HOST="localhost:9999" npm test

To run Jest tests in watch mode:

FIRESTORE_EMULATOR_HOST="localhost:9999" npm run test:watch

ts-jest is installed as a dev dependency to support writing tests in TypeScript. The jest configuration (jest.config.js) sets preset: 'ts-jest' to enable this.

Jest will run tests located in __test__ directories (for example: src/lib/__test__/database.test.ts).

Deployment

For instructions on how to deploy this application to a Google Cloud Project, see the Cloud Architecture Center.

Contributing

See CONTRIBUTING for more information how to get started.

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms. See Code of Conduct for more information.

License

Apache 2.0 - See LICENSE for more information.

developer-journey-app's People

Contributors

subfuzion avatar lukeschlangen avatar rogerthatdev avatar pattishin avatar dependabot[bot] avatar release-please[bot] avatar ruyadorno avatar averikitsch avatar iennae avatar vmaramreddy2 avatar glasnt avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.