Spring MVC Application
This application is a cloud-enabled, mobile-ready, persistent remote storage based on Spring, which has
- A Fancy frontent based on Bootstrap v4
- A Champions League Simulator!
- Coding exercises
- A Contact Form
- Information about myself
- A cool section of my own country and learn languages!
- Connection to a remote database
New Features!
- Bootsrap framework
- Some jQuery exercises included
- CV
- Champions League Simulator: make your own prediction about the group stage results and we will calculate how many chances has a team to face the rest of them
You can also:
- Read information about Groefnia, an
imaginary amazing country of Europe
- Register as a Gorefnish citizen, read, update or delete your information (CRUD functionalities in a persistant database)
- Send a form to contact me or know where do I live
- Visit other cool websites
Tech
This app uses a number of open source projects to work properly:
Frontend
- [Bootstrap] - great UI boilerplate for modern web apps
- [jQuery] - JS library
- CSS3, HTML5, Javascript
Backend
- Java
- Spring - insert dependencies with beans! Easy to configure thru xml
- Maven - build your project
- JSP - powerful tool to render the pages with information of the server side
Database
- Postgresql 9
- JPA, Hibernate
Deployment
The code is open for your acces in the public repository on GitHub.
Installation
1- Environment
1.1 Install Eclipse
1.2 Install Maven: use Eclipse marketplace to install it (suggestion: install also plugins for edit JSP, CSS, JS...)
1.3 Install Postgresql
1.4 (Optional) Install Heroku cli
2- Clone this repository
$ git clone https://github.com/pdelho/SpringMVC
3- Configure your deployment environment
3.1- Local: Tomcat
3.2- Remote: Heroku. Execute
4- Set up your database
4.1 Local:
Connect to your database link
- Set your pass and user. The credentials will be set during next step. The database url matches usally this pattern:
postgresql://localhost:5432/postgres
- Execute in your database the query:
initTablePersons.sql
initTableTeams.sql
(Optional) initData.sql
4.2 Remote:
- Go to https://dashboard.heroku.com/apps/your-app
- In resources-addons, seach for postgresql and add it to your app (free plan available!). You will be given some credentials
- The database url matches usually this pattern:
postgresql://host:5432/postgres?user=user&password=pass&sslmode=require
- Execute in your database the query:
heroku pg:psql
initTablePersons.sql
initTableTeams.sql
(Optional) initData.sql
5- Configure your application.properties
- Firslty, open your setenvironment.bat and set the path of your local-application.properties
- Secondly, edit your local-application.properties with your database url, user and password (accordingly to the previous step)
- Finally, execute setenvironment.bat (don't forget to discard the changes in local-properties once you have executed the script)
6- Update Project
In eclipse: Maven-> Update. Or alt+F5
7- Generate war
In eclipse: Run as-> Maven build... And set goals as: clean install
8- Deploy your application
8.1-Local:
Run as-> Run on server (tomcat)
8.2-Remote:
Run as-> Maven build... And set goals as: heroku:deploy-war
9- Enjoy!
Verify the deployment by navigating to your server address in your preferred browser.
9.1-Local:
9.2-Remote
http://your-app-name.herokuapp.com/
ToDos
- Write MORE Tests
- Add Night Mode
- Validation
- AngularJS Exercises
- Travelmap
- Postgresql with two tables
- Request DELETE: https://stackoverflow.com/questions/13629653/using-put-and-delete-methods-in-spring-mvc
- Ajax to handle translation
- Javascript google maps functionality: how far are you from groefnia?
License
MIT
Free Software, Hell Yeah!