Commit 757ba00d authored by johnnymoretti's avatar johnnymoretti
Browse files

first commit

parents
Pipeline #22942 failed with stages
in 1 minute and 29 seconds
# Oetzi Words
### Requirements
- Mysql
- Tomcat 8.5
- Java 8
- Maven
- NodeJS with Npm or Yarn
*Tested with tomacat 8.5.72 NodeJs v14.18.0 Java 1.8.0_241*
### Getting Started
Setup your mysql server and load the sql structure dump with :
mysql -u a_valid_user -p < oetzi_words.sql
Setup Apache Tomcat server with:
curl -LO https://archive.apache.org/dist/tomcat/tomcat-8/v8.5.72/bin/apache-tomcat-8.5.72.tar.gz
tar -xvf apache-tomcat-8.5.72.tar.gz
### Run Release
Download relase from github and copy `OetziWords.war` in the webapps folder of your apache tomcat installation.
Run the server with:
apache-tomcat-8.5.72/bin/startup.sh
Wait ~20 secs and shutdown th server with
apache-tomcat-8.5.72/bin/shutdown.sh
Now edit the `config.prop` in `apache-tomcat-8.5.72/webapps/OetziWords/WEB-INF` and write the correct parameters for your installation db host, db user, db password and and path to the image folder. Save the file and restart the server. Done.
Go to `http://localhost:8080/OetziWords/`
#### Attention !!! The mysql server must be started before of the tomcat server
### Make a release from code
Clone this repo with
git clone https://github.com/commul/oetzi.git
go to oezti folder `cd oetzi` and make the `war` package with
mvn package
You will find the war file in the target folder
### Working on the game UI on a separete server
First you need to configure your tomcat in order to accept cross origin connection
Edit the web.xml file in the `apache-tomcat-8.5.72/conf` and add the cors filter adding the lines to the file before the Default session configuration section
<filter>
<filter-name>CorsFilter</filter-name>
<filter-class>org.apache.catalina.filters.CorsFilter</filter-class>
<init-param>
<param-name>cors.allowed.origins</param-name>
<param-value>*</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>CorsFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
Restart your tomcat server
Got to the `oetzi_game` folder in the repository repository clone
and install javascript dependencies with
`yarn install` or `npm install`
Change line 63/64 of main.js file in src/js folder by switching the comment.
This operation permits the ui to call the backend at `http://localhost:8080/oetzi_words/` instead of to the relative path.
Run the game ui with
`yarn run start` or `npm run start`
Now the game runs at `http://localhost:1234`
### Update the webapp ui
If you want to update the game ui in the tomcat backend switch again the comment on line 63/64 and run
`yarn run deploy` or `npm run deploy`
Make new web archive with `mvn packge` in the root folder of the repository and copy the new `war` file in the webapps folder of tomcat, wait the refresh the url `http://localhost:8080/OetziWords/`
### Repository content
- oetzi_game folder (game ui code)
- oetzi_words_image folder (sample set of images)
- OetziWordsSupportData.tar.gz file (file containing sprites, images used in game development)
- oetzi_words.sql file (dump of the database structure)
- src folder (code of the tomcat web application)
- pom.xml (maven project definition file)
\ No newline at end of file
# editorconfig.org
root = true
[*]
charset = utf-8
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
## GITATTRIBUTES FOR WEB PROJECTS
#
# These settings are for any web project.
#
# Details per file setting:
# text These files should be normalized (i.e. convert CRLF to LF).
# binary These files are binary and should be left untouched.
#
# Note that binary is a macro for -text -diff.
######################################################################
## AUTO-DETECT
## Handle line endings automatically for files detected as
## text and leave all files detected as binary untouched.
## This will handle all files NOT defined below.
* text=auto
## SOURCE CODE
*.bat text eol=crlf
*.coffee text
*.css text
*.htm text
*.html text
*.inc text
*.ini text
*.js text
*.json text
*.jsx text
*.less text
*.od text
*.onlydata text
*.php text
*.pl text
*.py text
*.rb text
*.sass text
*.scm text
*.scss text
*.sh text eol=lf
*.sql text
*.styl text
*.tag text
*.ts text
*.tsx text
*.xml text
*.xhtml text
## DOCKER
*.dockerignore text
Dockerfile text
## DOCUMENTATION
*.markdown text
*.md text
*.mdwn text
*.mdown text
*.mkd text
*.mkdn text
*.mdtxt text
*.mdtext text
*.txt text
AUTHORS text
CHANGELOG text
CHANGES text
CONTRIBUTING text
COPYING text
copyright text
*COPYRIGHT* text
INSTALL text
license text
LICENSE text
NEWS text
readme text
*README* text
TODO text
## TEMPLATES
*.dot text
*.ejs text
*.haml text
*.handlebars text
*.hbs text
*.hbt text
*.jade text
*.latte text
*.mustache text
*.njk text
*.phtml text
*.tmpl text
*.tpl text
*.twig text
## LINTERS
.babelrc text
.csslintrc text
.eslintrc text
.htmlhintrc text
.jscsrc text
.jshintrc text
.jshintignore text
.prettierrc text
.stylelintrc text
## CONFIGS
*.bowerrc text
*.cnf text
*.conf text
*.config text
.browserslistrc text
.editorconfig text
.gitattributes text
.gitconfig text
.gitignore text
.htaccess text
*.npmignore text
*.yaml text
*.yml text
browserslist text
Makefile text
makefile text
## HEROKU
Procfile text
.slugignore text
## GRAPHICS
*.ai binary
*.bmp binary
*.eps binary
*.gif binary
*.ico binary
*.jng binary
*.jp2 binary
*.jpg binary
*.jpeg binary
*.jpx binary
*.jxr binary
*.pdf binary
*.png binary
*.psb binary
*.psd binary
*.svg text
*.svgz binary
*.tif binary
*.tiff binary
*.wbmp binary
*.webp binary
## AUDIO
*.kar binary
*.m4a binary
*.mid binary
*.midi binary
*.mp3 binary
*.ogg binary
*.ra binary
## VIDEO
*.3gpp binary
*.3gp binary
*.as binary
*.asf binary
*.asx binary
*.fla binary
*.flv binary
*.m4v binary
*.mng binary
*.mov binary
*.mp4 binary
*.mpeg binary
*.mpg binary
*.ogv binary
*.swc binary
*.swf binary
*.webm binary
## ARCHIVES
*.7z binary
*.gz binary
*.jar binary
*.rar binary
*.tar binary
*.zip binary
## FONTS
*.ttf binary
*.eot binary
*.otf binary
*.woff binary
*.woff2 binary
## EXECUTABLES
*.exe binary
*.pyc binary
# Include your project-specific ignores in this file
# Read about how to use .gitignore: https://help.github.com/articles/ignoring-files
# Useful .gitignore templates: https://github.com/github/gitignore
node_modules
dist
.cache
yarn.lock
This diff is collapsed.
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
</profile>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/oetzi_game.iml" filepath="$PROJECT_DIR$/.idea/oetzi_game.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/temp" />
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
<excludeFolder url="file://$MODULE_DIR$/tmp" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
{
"name": "oezi",
"version": "0.0.1",
"description": "Oetzi words - prototype",
"keywords": "",
"license": "",
"author": "Giovanni Moretti",
"homepage": ".",
"scripts": {
"build": "parcel build src/index.html --public-url ./",
"clean": "rm -rf ./node_modules/* && rm -rf ./node_modules/.bin && rm -rf ./node_modules/.yarn-integrity && rm -rf ./.cache && rm -rf ./dist",
"dev": "parcel src/index.html --open",
"start": "rm -rf dist && npm run build && npm run dev",
"deploy": "rm -rf dist && npm run build && rm -rf ../src/main/webapp/*.js && rm -rf ../src/main/webapp/*.css && rm -rf ../src/main/webapp/*.html && rm -rf ../src/main/webapp/assets && cp -r ./dist/* ../src/main/webapp/",
"test": "echo \"Error: no test specified\" && exit 1"
},
"staticFiles": {
"staticPath": "public",
"watcherGlob": "**"
},
"devDependencies": {
"parcel-bundler": "^1.12.4",
"parcel-plugin-static-files-copy": "^2.6.0"
},
"dependencies": {
"axios": "^0.26.0",
"bootbox": "^5.5.2",
"eslint": "^8.1.0",
"phaser": "^3.55.2",
"bootstrap": "^4.4.0",
"jquery": "^3.4.1",
"popper.js": "^1.16.0"
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment