Skip to content

dlphn/girlsflix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java Apache Maven Apache Tomcat API

GirlsFlix is a web app that allows you to search for TV series and add your favorites so you never miss any new episode.

GirlsFlix

Description

It is a Java school project developed by 3 students from CentraleSupélec : Jihane, Sophie, and Delphine as part of the POOA Module.

Features

The GirlsFlix web app allows you to:

  • 📺 Browse through TV series
  • 🔍 Search for specific series and filter by genre
  • 📄 Get details about a series
  • 👤 Log in to your profile and customize it
  • 🌟 Add your favorites
  • 📬 Get a notification when a new episode of one of your favorite series will be aired soon
  • 🎁 Be surprised with a random popular series suggestion
  • 💬 Get recommendations based on your preferred genres

If you want to test notifications quickly, try adding a series with a "Prochainement" badge. 😉

Installation

Settings

Add Keys.java in src/main/java/com.gfx (ignored by Git).

package com.gfx;

public class Keys {
	public static final String apiKey = "${tmdb_api_key}";
	
	public static final String mongoUser = "${mongo_user}";
	public static final String mongoPwd = "${mongo_password}";
	public static final String mongoHost = "${mongo_host}";
	public static final String mongoDb = "${mongo_db}";
	
	public static final String mysqlUser = "${mysql_user}";
	public static final String mysqlPwd = "${mysql_password}";
	public static final String mysqlHost = "${mysql_host}";
	public static final String mysqlDb = "${mysql_db}";
}

Dependencies

  • JDK 10.0.2 - download latest
  • Maven 3.5.4 - download latest
  • Tomcat 9.0.12 - download latest

Start server on Eclipse

Eclipse IDE for Java EE Web Developers (Photon v4.9.0) - download link.

Add Apache Tomcat to Eclipse

Import project to Eclipse

File -> Import...

Maven -> Existing Maven Projects -> Next

Browse girlsflix/GirlsFlix -> Finish

In the Project Explorer panel, Right Click on the project GirlsFlix -> Maven -> Update Maven Project -> Force Update of Snapshots/Releases

Build project

In the Project Explorer panel, Right Click on the project GirlsFlix -> Run As -> Maven Build...

Add Goals: clean install. Click Apply and Run.

Run on server

In the Project Explorer panel, Right Click on the project GirlsFlix -> Run As -> Run on Server

You can then go to localhost:8080/GirlsFlix and voilà! 🎉

Issues you might face while starting the server

1. 'Starting Tomcat v9.0 Server at localhost' has encountered a problem.

If you have a bad internet connection, fetching all the series from the database might take more than 45s so you will want to increase start up time.

Open the Servers view -> double click tomcat -> drop down the timeouts section -> increase Start time

2. Red messages in Console when starting the server.

This is normal. The text that is in red is being written to the System.err stream, the text in black is written to System.out. Nothing is inherently wrong, that's just how the system is differentiating the output streams. You can configure the display to your liking by : right-click in the console > "Preferences" > "Standard Error text" > Choose the color you want, for example black.

Project structure

Technology stack:

Project structure

src
└─ main
   ├─ java					// nos classes java
   |  └─ com
   |     └─ gfx					// com.gfx notre package de base
   |        ├─ controller			// nos controllers qui reçoivent les requêtes, utilisent les services et préparent les données renvoyées avec les vues jsp
   |        ├─ domain				// classes qui définissent notre domaine
   |        |  ├─ series			// classes qui définissent les séries
   |        |  └─ users				// classes qui définissent les utilisateurs
   |        ├─ service				// les services
   |        ├─ Config.java			// configuration générale
   |        ├─ Keys.java			// clés et mots de passe
   |        ├─ SpringConfig.java		// la configation de spring
   |        └─ SpringSecurity.java		// les profils d'exécution
   └─ webapp					// les fichiers qui vont à la racine de l'application web
      ├─ css
      ├─ js
      ├─ lib
      └─ WEB-INF
         ├─ jsp					// les templates jsp qui produisent le html
         ├─ tags				// les tag files (morceaux de template)
         ├─ dispatcher-servlet.xml		// configuration web de spring
         └─ web.xml				// configuration web d'une application
pom.xml						// fichier de configuration de maven

UML diagram (can be found in the images folder) :

GirlsFlix

Spring MVC

Spring Framework for web apps.

The starting point is the web.xml file in src/main/webapp/WEB-INF. This file defines the different app configurations and uses the dispatcher-servlet.xml for dispatching incoming requests towards the right controllers and views.

dispatcher-servlet.xml also initiates the scheduled task com.gfx.service.Scheduler in the background, which will:

  1. Update data in Mongo from the TMDB API;
  2. Update the Java objects from Mongo;
  3. Launch the notification process for episodes airing soon.

For now, the scheduler is set to be repeated every 5 min for testing purposes, but it is meant to be run every day early in the morning:

<property name="period" value = "300000"/>

Spring Security

Handles authentication and sessions. It is configured in com.gfx.SpringSecurity.java.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Team

About

Search for TV series and add your favourites

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published