Giter Site home page Giter Site logo

janakiramvit / gcpwebapp_poc Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 2.26 MB

Using java spring boot, angular, html for building a web app on google cloud.

Shell 0.14% Batchfile 0.10% Java 0.31% HTML 0.80% JavaScript 66.55% TypeScript 1.26% CSS 30.83%

gcpwebapp_poc's Introduction

Example WebApp on Google Cloud App Engine

What is this?

This is a webapp that can run on google cloud directly if you replace values as mentioned below in 'Points to check'. or you can design your web app for google cloud based on the layout of this code

Scope

What you will learn from this?

  • You will know what should be the basic layout of the web app for it to work on Google cloud.
  • Configuration commands and hints needed for successful deployment of app on Google Cloud app engine

What you will not learn from this?

  • How to create or setup Cloud App engine env, or Cloud DB or GCP env setup on local machine etc
    • But some of it is covered in the pre-deploy section below
  • if you need more help for this, connect to me on LI - Janakiram Pulipati

Tech Stack:

  • Web Services: Java spring boot
  • Front End: Angular, Html
  • Back End: Google Cloud SQL (MySQL)
  • Deployed on Google App Engine
  • Dependency mgmt: Maven

I have not followed the google model to create this webapp, but its been inspired from Google documentation. Also I put Chanrith's name here as I took his help through out in developing this project. https://developers.google.com/eclipse/docs/creating_new_webapp

Points to check:

  • in pom.xml, check properties tag, values have to be replaced there for all strings with {replace-value}
  • check application.properties, replace with appropriate values in flower brackets
  • in resources/public/index.html, replace line 8 with appropriate value
    • i think this has to be replaced only if you're using google-sign-in in the application
  • check if src/main/appengine/app.yaml has everything right
  • in src/main/java/in/mw/attendance/attendanceRepository.java replace {dbname} with your database name
  • implement same step for feedbackRepository too

Now code is all set to deploy.

Pre Deploy:

  • Check if app runs on your system by replacing values of LocalDB in application.properties
  • If it successfully runs on LocalDB, then comment the localDB config and uncomment the CloudDB string value and keep the code ready to deploy
  • Before deploy, make sure:
    • Cloud app engine is up and running, billing is enabled etc for your app engine
    • Cloud DB is up and running
    • IMPORTANT: Incoming connection addresses in Cloud DB includes your VM IP addresses from App Engine
      • Go to your DB - 'Access control' -> 'Authorization' -> 'Add Networks' -> Add VM IPaddress from App Engine
    • IMPORTANT: Oauth is enabled for your app, this is how to do it:

Deploy

  • Once all the above setup is done on cloud, deploy the app to GCP from your local machine, this is easy
  • Go to the top level folder of your app and run
    • mvn appengine:deploy
  • If it throws more questions at this stage, it means you have not setup the cloud environment properly

After deploy

  • Console would read Deployment 'Success' and you can browse the app by running 'gcloud app browse'

P.S:

  • This definitely works. But I am sure this code can be optimized a bit more.

gcpwebapp_poc's People

Contributors

janakiramvit avatar ramexpedia avatar

Watchers

 avatar  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.