A Simple Login Application in Liftweb using Scala and MongoDB

Liftweb is an elegant , designer friendly and arguably the most powerful web framework that provides developers ability to create secure , scalable , maintainable , rich and interactive web applications .
It is built on the top of Scala and takes View-First approach rather going via the standard Model-View-Controller way.
Now , Let’s look at a simple example .
This is a simple login based application in Liftweb using Scala and MongoDB . If you want to use Liftweb as framework , Scala as Programming Language and MongoDB as Database then this demo project can be used as a starting point for your application .

You can found source code on the Knoldus GitHub account here : Login Template using Liftweb and Scala .

Requirements :

  • SBT
  • MongoDB
  • Getting Started with Code :

    • Set Up MongoDB
    • Start mongo: > mongod
    • Import into Eclipse by >sbt eclipse
    • Start application by >sbt ~container:start
    • To Run test cases >sbt test

    After starting application , Go to http://localhost:8080 and click on Demo ,
    you will see a Login screen .

    Screenshot from 2013-02-24 19:01:19

    Written by 

    Ayush is the Sr. Lead Consultant @ Knoldus Software LLP. In his 10 years of experience he has become a developer with proven experience in architecting and developing web applications. Ayush has a Masters in Computer Application from U.P. Technical University, Ayush is a strong-willed and self-motivated professional who takes deep care in adhering to quality norms within projects. He is capable of managing challenging projects with remarkable deadline sensitivity without compromising code quality.

    2 thoughts on “A Simple Login Application in Liftweb using Scala and MongoDB

    1. hi, how to convert this code a new version 2.12

      */
      private[lib] def doRequest[T](req: Request)(func: String => Box[T]): Box[T] =
      /*
      * See: http://dispatch.databinder.net/Choose+an+Executor.html
      */
      Http x (req as_str) {
      case (400, _, _, out) => Failure(parseError(out()))
      case (200, _, _, out) =>
      val o = out()
      logger.debug(“output from facebook: ” + o)
      func(o)
      case (status, b, c, out) =>
      //logger.debug(“b: “+b.toString)
      //logger.debug(“c: “+c.toString)
      Failure(“Unexpected status code: %s – %s”.format(status, out()))
      }

    Comments are closed.

    Knoldus Pune Careers - Hiring Freshers

    Get a head start on your career at Knoldus. Join us!

    %d bloggers like this: