The purpose of this project is to go further with Java through the creation of a dashboard. To do this, you need to implement a web application that works like Netvibes.
-
Create a new mysql database by running this file : createDatabase.sql
-
Setup application.properties.example :
- Copy application.properties.example into src/main/resources
- Rename it into application.properties
- Change the database credentials with your own (l.8 : username & l.9 : password)
- Build the project in a new intellij project
- Run DashboardApplication.java
- Go to http://localhost:8080
- Run ./gradlew build
- Copy build/libs/dashboard-0.0.1-SNAPSHOT.war (in the build/libs/ folder) into the webapps folder of tomcat
- From a terminal navigate to tomcat/bin folder and execute
- catalina.bat run (on Windows)
- catalina.sh run (on Unix-based systems)
- Go to http://localhost:8080/dashboard-0.0.1-SNAPSHOT
-
Weather
- Get the weather of the city provided
- Get the forecast weather of the city provided
-
Youtube
- Get the informations of a video selected in the list provided
- Get the informations of a channel selected in the list provided
- Get the informations of a video you search
-
Steam
- Get the news of a game selected in the list provided
-
Movies
- Get the top 5 popular movies in a range of time between two dates
- Get the informations of the movie you want
-
Love calculator
- Get the percentage of chances between two people
- application.properties Sets the properties
- templates/ Contains html files
- static/css Contains style files
- static/js Contains javascript files
Java :
- DashboardApplication.java Is the entry point of the application
- about Contains the class that help to create the about.json file
- configuration Contains the file for the web security configuration
- controller Contains all the controllers of the APIs
- model Contains the models for the authentication
- repository Contains the repositories for the authentication
- service Contains the services for the authentication
- createDatabase.sql File to run to create the database in mysql
- build.gradle Defines the gradle dependencies
When calling :
- GET application-url/about.json Get information about the APIs in a json file
When calling :
-
GET application-url/login Set the login page of the application
-
POST application-url/login?user_name=user_name&password=password Login into the application if the credentials are in accordance with the values in the database
-
GET application-url/registration Set the registration page of the application
-
POST application-url/registration Register an user with the given params in the x-www-form-urlencoded type
-
GET application-url/user/home Set the home page of the application for an user
-
GET application-url/admin/home Set the home page of the application for an admin
When calling :
- GET application-url/api/loveCalculator?fname=fname&sname=sname
- See love calculator api
- Values and display are handled in the ajaxLoveGetPercentage.js file
When calling :
- GET application-url/api/movies/getByPopularity?bottom-date=2000-02-07&high-date=2000-11-30
- See get most popular movies api
- Values and display are handled in the ajaxMovies.js file
When calling :
- GET application-url/api/steam/getNews/{steamGameId} (eg. 1091500)
- See get steam game api
- Values and display are handled in the ajaxSteamGetNews.js file
When calling :
- PUT application-url/saveDashboard
- Register the dashboard in the database
When calling :
-
GET application-url/weather/city/{cityname} (eg. Nantes)
- See get weather by city api
- Values and display are handled in the ajaxWeatherGetMeteo.js file
-
GET application-url/forcastweather/city/getCityForecast?lat=11&lon=11
- See get weather hourly or daily api
- Values and display are handled in the ajaxForecastWeather.js file
When calling :
-
GET application-url/api/youtube/getVideo/{youtubeVideoId} (eg. oPc4z_wUKsM)
- See video youtube api
- Values and display are handled in the getVideoInfo.js file
-
GET application-url/api/youtube/getChannel/{youtubeChannelId} (eg. UCxo56gzJQ_fhb6svPqTSewg)
- See channel youtube api
- Values and display are handled in the getChannelInfo.js file
-
GET application-url/api/youtube/searchVideo/{searchString} (eg. poulet)
- See channel youtube api
- Values and display are handled in the searchVideo.js file