Click here to Skip to main content
15,890,579 members
Articles / Programming Languages / Scala

Madcap Idea Part 4: Prototyping the Screens

Rate me:
Please Sign up or sign in to vote.
5.00/5 (4 votes)
7 Jun 2017CPOL4 min read 7.1K   2  
Prototyping the screens

Last Time

Last time we looked at bringing in the Play Framework (scala based MVC web framework) and making the front end work with Play. This time, we will be looking at the initial prototypes of the screens.

This is my best guess of what they may look like right now, based on my initial requirements, but as with all things, once you get into the guts of it, changes will occur.

PreAmble

Just as a reminder, this is part of my ongoing set of posts which I talk about here:

https://sachabarbs.wordpress.com/2017/05/01/madcap-idea/, where we will be building up to a point where we have a full app using lots of different stuff, such as these:

  • WebPack
  • React.js
  • React Router
  • TypeScript
  • Babel.js
  • Akka
  • Scala
  • Play (Scala Http Stack)
  • MySql
  • SBT
  • Kafka
  • Kafka Streams

Mockup Tool of Choice

I am a big fan of the balsamiq mockup tools. This comes as a stand alone installed version or as a plug in for JIRA.

balsamiq provides the following (I am just listing the features I used, there are many more):

  • Drag and drop from a wide range of forms, containers, controls
  • Set content for controls (usually using some fancy design time behavior)
  • Set navigation links
  • Set properties like IsSelected, IsEnabled, etc.

This is what the windows installed balsamiq desktop version looks like, see how you have many categories of items to choose from.

image

And here is what I mean by the clever design time support. This is a data grid that I have double clicked on, where the text in design mode described the rendered results of the control.

 

image

It really is a very nice tool. Anyway, on with the initial screen designs:

Navbar

image

 

This will be a simple react-router / react-bootstrap based navigation bar. There is nothing more to say about that.

Login

image

 

This will be a login form which will be validated, and submitted to a Play framework controller, for further validation. The Play controller would look up the user details from a MySQL database, and if an entry is found, the user is considered logged on. Keeping it simple here, no oAuth no JWT, just simple lookup.

Passenger Register

image

 

If the user is a passenger, the sort of information that they will need to enter to register will be different from a driver who may need to register, as such there is a specific passenger registration form, which will be validated and sent to a Play controller endpoint for storage in MySQL.

Driver Register

image

 

If the user is a driver, we need more information about the vehicle, as such there is a specific driver registration form, which will be validated and sent to a Play controller endpoint for storage in MySQL.

Create Job

image

Only a passenger will be able to create new jobs. Since I am doing all this work on a single laptop which is ALWAYS in a single location, I am having to SIMULATE the geo-coordinates of a job by accepting the current users input for their current position. The passenger/driver users will provide this geo information by clicking on a google map. The geo co-ordinate update will either travel through a Kafka stream, –> Akka –> Comet, or may just use Akka –> Comet. I have not fully decided on this part yet.

There may only EVER be 1 active job, so if a logged in, passenger tries to create a 2nd job - this should cause an error.

image

View Job

Both passengers/drivers may view an active job. Drivers may "bid for a job" by clicking on the map provided the job is not already paired with a driver. A driver symbol will be a car, as before the driver will update their geo co-ordinates by clicking on the map. As before, the geo co-ordinate update will either travel through a Kafka stream, –> Akka –> Comet, or may just use Akka –> Comet.

 

image

A passenger may inspect a driver's details, and chose to accept the driver, at which point the passenger's job becomes assigned the chosen driver.

image

Drivers that are not allocated to the job will be removed from the map, and only geo updates from the paired passenger/driver will be reflected on the map.

Passenger Completion

image

Once a job has been completed (by clicking the "Complete" button), the passenger will be able to rank the driver. This will store the ranking for the driver. This could be stored directly in MySQL, but I want to play with Kafka Streams a bit more, so we use a Kafka Publisher –> Kafka Streams –> KTable arrangement to store the state. And then use Kafka active queries to get the data out again.

Driver Completion

image

 

The driver is also able to complete the job from their end (using the "complete" button), and is able to rank the passenger. This will work as described above.

View Ranking

image

Depending on which way I go with the ranking storage, this will either be a direct MySQL query or a Kafka Streams active query over a KTable.

Conclusion

This is perhaps the simplest of all the posts in this series, but it is an important one. Next time, we will try and statically implement these screens, and the associated routing that goes with them.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
United Kingdom United Kingdom
I currently hold the following qualifications (amongst others, I also studied Music Technology and Electronics, for my sins)

- MSc (Passed with distinctions), in Information Technology for E-Commerce
- BSc Hons (1st class) in Computer Science & Artificial Intelligence

Both of these at Sussex University UK.

Award(s)

I am lucky enough to have won a few awards for Zany Crazy code articles over the years

  • Microsoft C# MVP 2016
  • Codeproject MVP 2016
  • Microsoft C# MVP 2015
  • Codeproject MVP 2015
  • Microsoft C# MVP 2014
  • Codeproject MVP 2014
  • Microsoft C# MVP 2013
  • Codeproject MVP 2013
  • Microsoft C# MVP 2012
  • Codeproject MVP 2012
  • Microsoft C# MVP 2011
  • Codeproject MVP 2011
  • Microsoft C# MVP 2010
  • Codeproject MVP 2010
  • Microsoft C# MVP 2009
  • Codeproject MVP 2009
  • Microsoft C# MVP 2008
  • Codeproject MVP 2008
  • And numerous codeproject awards which you can see over at my blog

Comments and Discussions

 
-- There are no messages in this forum --