An example project using Spring (component-based) and Angular 2.
- Install Firefox: https://www.mozilla.org/en-US/firefox/new/
- Install postgres:
brew install postgres
- Follow instructions to start postgres now and on restart
- Create a postgres database super user admin with password 'admin':
createuser admin --superuser --password
- Create postgres databases:
createdb spring-ng2-example && createdb spring-ng2-example-test
mkdir -p deployment/example-api/src/resources
cp applications/example-api/src/resources/application.yml.example deployment/example-api/src/resources/application.yml
- Create a test user
EMAIL=john.doe@example.com PASSWORD=test123 ./gradlew :applications/example-api:runAppTask -PtaskName=createUser
- Run migrations with the following command:
./gradlew flywayMigrate -Dflyway.user=admin -Dflyway.password=admin -Dflyway.url=jdbc:postgresql://localhost/spring-ng2-example
gradle bootRun
- Navigate to
http://localhost:8080/
- Check out
http://localhost:8080/swagger-ui.html
to see all functionality of the backend.
The front end build has a few node tasks that will help when developing locally. To get started
run the npmInstall
gradle task followed by the run
gradle task. Run will compile, setup watchers
for ts and scss files, and open a browser with browser-sync enabled.
./gradlew :applications/example-api:migrateTestDatabase
./gradlew clean test