Project created for 2017 edition of Get Noticed! (Daj się poznać) contest. Aim of the application is to optimize car travel times in the city.
- Backend
- Grails 3.2.7
- Spock
- CodeNarc
- Joda Time
- Database Migration Plugin
- Build Test Data Plugin
- Chakram
- js-joda
- mysql
- MySQL 5.7.17
- Grails 3.2.7
- Frontend
- Angular 5.2.0
- Angular Material
- js-joda
- Angular 5.2.0
Project is separated into three main directories:
- backend - Contains Grails project source code
- frontend - Contains Angular project source code
- api-tests - Contains source code for Chakram REST API tests
- Install MySQL 5.7.17
- Install Node.js (6.11.0) with npm (3.10.10)
- Clone the repository
git clone https://github.com/piotrgajow/shortcuts-web.git
- Setup database connection in
backend/grails-app/conf/application.yml
- propertiesdataSource.username
dataSource.password
anddataSource.url
- Start MySQL database
- Start application backend
cd backend
./grailsw run-app
- Start application frontend
cd frontend
npm install
npm start
- backend unit tests + static code analysis
cd backend ./gradlew check
- backend REST API tests
cd api-tests npm install npm test
- frontend unit tests + static code analysis
cd frontend npm install npm run lint npm test
Please report any issues and feature requests on the issue page of this repository
-
Install required software
sudo apt-get update sudo apt-get install mysql-server-5.7 sudo apt-get install default-jdk apt-get install tomcat8
-
Prepare configuration
mkdir -p /home/tomcat/shortcuts
In this directory create file
application.groovy
with content and valid mysql password:dataSource { password = 'XXX' }
-
Build application
cd backend grails package
cd frontend npm run build
-
Upload artifacts
scp backend/build/libs/*.war user@server:~/shortcuts-api.war
scp frontend/dist/* user@server:~/shortcuts-dist
-
Host the application
rm -rf /var/lib/tomcat8/webapps/shortcuts-api rm /var/lib/tomcat8/webapps/shortcuts-api.war cp ~/shortcuts-api.war /var/lib/tomcat8/webapps/shortcuts-api.war
rm /var/lib/tomcat8/webapps/shortcuts/* cp ~/shortcuts-dist/* /var/lib/tomcat8/webapps/shortcuts/