Skip to content

An On-Line Travel Reservation System built with the Scala Play framework

License

Notifications You must be signed in to change notification settings

rossanthony/play-travel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Play Travel

An On-Line Travel Reservation System

Coursework submission for Birkbeck MSc module, Component Based Software Development.

Backend Stack

Build Tools

Frontend

Build and run locally

Firstly you will need to setup a local MySQL database and add the credentials in the config here: conf/application.conf.

Assuming you already have SBT installed and the project cloned, it can be started locally by running: sbt run from the project root folder. By default it will fire up on 127.0.0.1:9000.

Upon first loading the frontend page (or requesting one of the REST endpoints) the code will compile and Play will show a message regarding migrations (or evolutions as Play calls them) which need to be run, just click the red button and let Play do its magic. (for reference the migration SQL scripts can be found here: conf/evolutions/default/*)

Once the migrations have run, then you will need to add some seed data to test with (a test user, flights etc) these will need to be imported into your database manually (via something like SequelPro). The seed SQL scripts can be found in: conf/seeds/* (import all .sql files in this folder).

The seed data includes a user with the following credentials:

username: r@a.com
password: pw123

which can be tested on the login page: http://127.0.0.1:9000/auth/sign-in

Progress

Unfortunately despite having devoted around two solid weeks to this project (spread out over several months) I have been unable to meet all of the requirements. Being relatively new to Scala and completely new to Play + Slick, I found it particular challenging to get all of the required elements of the coursework completed. The parts I have managed to get working are as follows:

  • User sign-up and login (for online travellers)
  • Login for admin users (reservation managers)
  • Dashboard for reservation managers; with list view of flights, ability to delete + create flights
  • Flight searching with some of the required filters in place

Things outstanding

  • Frontend booking of flights and viewing of previous bookings. Models for bookings and tickets are in place, however I did not have time to complete the frontend part for this.
  • Admin screens for viewing bookings, showing how many seats are sold per flight etc.
  • Write unit tests

Particular challenges with Slick

It has been a difficult and somewhat frustrating experience at times dealing with Slick and its API for building SQL queries. Dealing with joins and filtering I found particularly troublesome at first and the documentation on the Slick website is a bit sketchy in parts.

I ended up getting help on Stackoverflow for a few issues:

Resolving these issues among others, caused significant setbacks in terms of the timescale.

Conclusion / outcomes

While it is disappointing to have fallen short in getting everything in the spec done on time, nevertheless I feel it has been a rewarding and beneficial experience. It has certainly sparked a keen interest in the potential of Play + Slick and I plan to continue with this build in my own time. While it may have been easier and more feasible to get all (or closer to all) of the requirements met if using JEE (e.g Spring Roo) instead, however I set myself the challenge of attempting it with Scala, Play + Slick and persisted with this goal, setbacks aside.

It was only when I had already gone too far down this road that it became increasingly evident that I was running behind schedule and would likely be unable to complete all parts of the spec. So, while in some respects I am the victim of the age-old sunk costs fallacy, I still standby my decision for the reasons already mentioned. I hope that those examining this coursework will take these points on board when considering the final mark.

About

An On-Line Travel Reservation System built with the Scala Play framework

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published