Giter Site home page Giter Site logo

airline's Introduction

Test deploy

An opensource airline game.

Live at https://www.airline-club.com/

Screenshot 1 Screenshot 2 Screenshot 3

Setup

  1. Install Java openjdk 11
  2. Install MySQL 8 and then create database airline_v2_1, create a user sa, for password you might use admin or change it to something else. Make sure you change the corresponding password logic in the code to match that (https://github.com/patsonluk/airline/blob/master/airline-data/src/main/scala/com/patson/data/Constants.scala#L184)
  3. Navigate to airline-data and run activator publishLocal. If you see encoding error, add character-set-server=utf8mb4 to your /etc/my.cnf and restart mysql. it's a unicode characters issue, see https://stackoverflow.com/questions/10957238/incorrect-string-value-when-trying-to-insert-utf-8-into-mysql-via-jdbc
  4. In airline-data, run activator run,
    1. Then, choose the one that runs MainInit. It will take awhile to init everything.
  5. Set google.mapKey in application.conf with ur google map API key value. Be careful with setting budget and limit, google gives some free credit but it CAN go over and you might get charged!
  6. For the "Flight search" function to work, install elastic search 7.x, see https://www.elastic.co/guide/en/elasticsearch/reference/current/install-elasticsearch.html . For windows, I recommand downloading the zip archive and just unzip it - the MSI installer did not work on my PC
  7. For airport image search and email service for user pw reset - refer to https://github.com/patsonluk/airline/blob/master/airline-web/README
  8. Now run the background simulation by staying in airline-data, run activator run, select option MainSimulation. It should now run the backgroun simulation
  9. Open another terminal, navigate to airline-web, run the web server by activator run
  10. The application should be accessible at localhost:9000

Nginx Proxy w/ Cloudflare HTTPS

In Cloudflare go to your domain and then SSL/TLS > Origin Server. Click Create Certificate > Generate private key and CSR with Cloudflare > Drop down choose ECC > Create

Save your Origin Certificate and your Private Key to a file. Example:

Orgin Certificate: domain.com.crt

Private Key: domain.com.key

Example nginx virtualhost conf file:

server {

  listen 443 ssl http2;
  listen [::] ssl http2;
  server_name domain.com;

  ssl_certificate      /usr/local/nginx/conf/ssl/domain.com/domain.com.crt;
  ssl_certificate_key  /usr/local/nginx/conf/ssl/domain.com/domain.com.key;

  add_header X-Frame-Options SAMEORIGIN;
  add_header X-Xss-Protection "1; mode=block" always;
  add_header X-Content-Type-Options "nosniff" always;
  add_header Referrer-Policy "strict-origin-when-cross-origin";

  access_log /home/nginx/domains/domain.com/log/access.log combined buffer=256k flush=5m;
  error_log /home/nginx/domains/domain.com/log/error.log;

  location /assets  {
    alias    /home/airline/airline-web/public/;
    access_log on;
    expires 30d;
  }

  location / {
    proxy_pass http://localhost:9000;
    proxy_pass_header Content-Type;
    proxy_read_timeout     60;
    proxy_connect_timeout  60;
    proxy_redirect         off;

    # Allow the use of websockets
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection 'upgrade';
    proxy_set_header Host $host;
    proxy_cache_bypass $http_upgrade;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  }

}

Banners

Self notes, too much trouble for other people to set it up right now. Just do NOT enable the banner. (disabled by default, to enable change bannerEnabled in application.conf

For the banners to work properly, need to setup google photo API. Download the oauth json and put it under airline-web/conf. Then run the app, the log should show an oauth url, use it, then it should generate a token under airline-web/google-tokens. Now for server deployment, copy the oauth json google-oauth-credentials.json to conf AND the google-tokens (as folder) to the root of airline-web.

Attribution

Some icons by Yusuke Kamiyamane. Licensed under a Creative Commons Attribution 3.0 License

airline's People

Contributors

patsonluk avatar spencerm avatar daprof1 avatar lash12 avatar bohaska avatar germanwings avatar bertauchekurtis avatar topspin85 avatar henderb avatar tjmoores avatar edoebzd avatar frankpigeon avatar cazh0 avatar kiike avatar flykaroline avatar maeyanie avatar felixm-byte avatar grebfar 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.