AlexPravda1 / flight-planner

Project to help Flight Dispatchers working with Leon Software to ease navigation across the flight list

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Welcome to Flight reporting application!

airplane

The goal of this project is:

  • Create a Java application using Spring and Hibernate
  • Provide Stateless JWT authentication
  • Provide overview of the flights based on Flight Planning system

This is a web project, which could be characterized as a data gathering application.
The project is based on the principles of SOLID and three-tier software architecture.
Besides, such frameworks as Spring Web, Spring REST, Spring Security, Hibernate have been used to accomplish the task.
Authentication and authorization are also represented as a part of a project in a form of JWT tokens stored in HTTP Only Cookie.
HTTP requests can be sent in JSON format and are stored in a database.

Technologies that were used to create the service:

  • Java 11
  • MySQL
  • Hibernate
  • Spring (Core, WEB, Security)
  • Apache Tomcat (to run app locally)
  • JWT Tokens (encrypted) are stored in HTTP Only Cookies
  • JSP page to represent the result
  • JSON mapping into POJO classes via DozerMapper
  • Maven Checkstyle Plugin

Overview

Project flow:

  1. User authentication is done via stateless JWT, encrypted and saved as access token in HTTP Cookie
  2. Data is taken from Planning System via GraphQL request
  3. Received JSON is mapped to POJO and placed into static Map
  4. Map is updated via scheduled service every 15 mins
  5. Based on selected filters, JSP page is rendered

Project has multiple endpoints with user and admin access

POST: /register (to create a user) - ALL Roles (but Airline AccessKey is required for proper results display)
GET: /profile (to get information about the user and list of availbale aircraft) - ALL Roles
GET: /flights (to get list of the flights) - ALL Roles. Can be parametrized with:
=> daysRange - between 0 and 90 days, to filter list for specific date range from today till indicated amount of days.
=> registration - string format, to filter list for specific aircraft.
=> hasNotes - boolean, filter list for flights with remarks only.
=> hasFiles - boolean, filter list for flights with files attached only.

GET: /users (to get list of available users in the system) - ADMIN Role
GET: /users/by-email (to get specific user info) - ADMIN Role

Example how to add data into the application (using for example Postman)

{"email":"bob@gmail.com", "password":"bobsPass", "repeatPassword":"bobsPass", "name":"Bob", "surname":"Smith"} POST: /register

How to start project locally:

  1. Install and configure Apache Tomcat (recommended version 9.0.50)
  2. Install and configure and create a schema in MySQL
  3. Fork and clone this project
  4. To connect to database in application you need change configuration information in the file from /resources/application.properties to the ones you specified when installing MySQL
  5. DB properties are configured as ENV variables or can be placed into 'application.properties' file:
    db.driver= YOUR_DB_DRIVER
    db.password= YOUR_DB_PASSWORD
    db.url= YOUR_DB_URL
    db.username= YOUR_DB_USERNAME
    security.cipher.secret-key= SECRET_WORD_FOR_COOKIE_ENCRYPTION
    security.jwt.cookie.token= TOKEN_NAME (JWT token will be saved with this name in the Cookie)
    security.jwt.token.secret-key= JWT_TOKEN_SECRET_WORD
  1. Run this project using Tomcat local server
Couple of screenshots below.
Main screen with filter settings: 

main

Profile with the list of the aircraft: 

profile

List of the filtered flights:

list

About

Project to help Flight Dispatchers working with Leon Software to ease navigation across the flight list


Languages

Language:Java 96.4%Language:CSS 3.5%Language:Procfile 0.1%