BattleScribeDataWeb is the web application that serves BattleScribe data files from the various data repositories on GitHub. It is a Java 8 web application designed to run on Google App Engine. It is built and deployed using Maven 3.5.
It consists of an Angular (JavaScript) front end and a RESTful (Jersey / JAX-RS) back end.
This guide is written from the perspective of a Netbeans IDE user running Windows, however you can use any IDE or toolset that supports Maven.
It is assumes that you have some experience with developing on Windows, or can translate the following to your operating system of choice. You should also have some knowledge of software development/programming using Java (or are willing to learn it!).
public_repo
and read:org
scopes. Take a note of the token.(Note: On Windows, references to "Google Cloud Shell" below means the "Google Cloud Shell" command line launched from the Start Menu.)
pom.xml
) will be referred to as the project folder.Start Cloud SDK Shell
and Run gcloud init
(https://cloud.google.com/sdk/docs/).gcloud init
from the Google Cloud Shell.gcloud components install app-engine-java
gcloud components update
bin
and boot
folders..../Maven/bin
folder needs to be on your PATH environment variable (https://superuser.com/questions/949560/how-do-i-set-system-environment-variables-in-windows-10).maven.properties
appengine.dev.project.name=YOUR_APP_ENGINE_DEV_PROJECT_NAME
(Use your App Engine development project name created when setting up the Cloud SDK above).
<project directory>/src/main/resources/common/java/
directory called github-user.properties
.
## GitHub User ##
github.anon.username=GITHUB_USER_NAME
github.anon.token=GITHUB_AUTHENTICATION_TOKEN
github.anon.email=BSDataAnon@users.noreply.github.com
(Use your own GitHub username and token).
local
Maven profile from the "Project Configuration" dropdown at the top.appengine:run
Maven goal).
local
Maven profile.appengine:run
Maven goal).
local-debug
Maven profile.SocketAttach
, Transport dt_socket
, Host localhost
, Port 5005
.appengine:deploy
Maven goal).
dev
Maven profile.pom.xml
in the project directory contains Maven configuration.
local
for running on the local serverlocal-debug
for debugging on the local serverdev
for deploying on your App Engine development environmenttest
and prod
are for the main BSData test and live App Engine environments. You will not be able to use these unless authorised./src/main/resources/
folder contains configuration files for each Maven profile, plus common properties files used by all profiles.
.../java/
files are general config used by the java app and are copied into the WEB-INF/classes/
folder upon build/deploy..../webapp/
files are used to configure the application server and are copied into the WEB-INF
folder upon build/deploy./src/main/webapp/
folder contains the web front end
.../app/
folder contains the Angular Javascript app/src/main/java/
folder contains the back end Java app.
rest
package contains RESTful web services (https://jersey.github.io/documentation/2.26/jaxrs-resources.html).
BattleScribeDataRestConfig.java
configures the app and performs startup tasks.viewmodel
package contains model classes that are used to pass data between the web services and the Angular front end.
model
package contains model classes for BattleScribe XML data files and indexes (http://simple.sourceforge.net/download/stream/doc/tutorial/tutorial.php).dao
package contains "Data Access Object" classes used used to read/write to data sources.
GitHubDao.java
is used for communicating with GitHub.repository
package contains classes for creating BattleScribe repository indexes (.bsi
) files.