Reaching out for help to get started

20 views
Skip to first unread message

Vasan

unread,
Oct 11, 2017, 9:24:48 AM10/11/17
to Lift
Hi,
I am learning Lift to implement in one of my gamification projects. I am trying to introduce Lift/scala stack in my company and a lone developer on this project.

I hope I could get some quick tips and pointers to fast track my adoption. Also felt like discussing is better way to learn than troubleshooting and trying out as a lone journey. 

I will be using SQL Server DB and Tomcat container. Downloaded LIFT 3.o to edit the files, learn by playing around to get started.

1. My site is within a firewall and users can access the link only if they are inside our intranet. From the intranet, I can pass the name and email address to this app for just storing in the DB. I need help to know how I can store these values in the DB using Lift during onPageLoad. I will need to perform validation actions like new user/repeat user, and display different views.
I don't need the Login/sign up features as I get validated user information from another system.

2. As the user is interacting with the site, clicking on links and buttons in various boxes on the page, I need to store some of these actions in the DB, (to mark a box area in the screen as visited and show in a different color;  Add scores on click of a button, etc) and retrieve this view (score/visited states) on subsequent and multiple visits to allow them to continue from where the user left last.

3. The big feature of this is the display of a leaderboard with stats on scores and ranking users based on scores earned in a day. There could be around 1500 users whom I would wish to display and rank. So pagination and any available snippets could help.

The scope looks small at this time, as I am just starting out. If successful, this has potential to grow into a big attraction with multi player games, etc and hence I wish to start out in LIFT/Scala stack to scale gracefully.

Any guidance will be helpful. Thank you!

Regards
Vasan

Matt Farmer

unread,
Oct 11, 2017, 9:32:30 AM10/11/17
to Lift
Hey Vasan - welcome to Lift!

(1) With regard to checking authentication information, does this information come from an HTTP header? Or something else? In any event, adding a handler to LiftRules.earlyInStateful would probably be the ticket. From there you can check declared SessionVars for whether or not the app currently knows about a logged in user for this HTTP session. If that check fails, you could then do whatever you need to do to on the Lift side to set up the user.

I don't think I can provide a bunch of guidance on (2) except to say that I've found Lift's built in persistence stuff confusing, so I tend to use the Slick library for DB interactions right now. That said, there are tons of people on the list who can provide help with Mapper and Record (Lift's libraries for DBs).

I also don't know of any pre-built pagination snippets. I tend to roll my own since the requirements each time I do it are subtly different. You might find Comets and their ability to re-render pieces of pages on the fly useful.

You may also be interested in a few projects I've open sourced that use Lift. AnchorTab is an old one that I don't maintain, but may provide some useful examples. Judicial Manager is one I'm currently building out.

Cheers,
Matt

--
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code

---
You received this message because you are subscribed to the Google Groups "Lift" group.
To unsubscribe from this group and stop receiving emails from it, send an email to liftweb+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages