Skip to content

This activator project describes an auto complete functionality in Scala, Play & ReactiveMongo

License

Notifications You must be signed in to change notification settings

anand-singh/playing-autocomplete

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AutoComplete functionality using Scala, Play & ReactiveMongo

Play 2.5.x application with ReactiveMongo - reactive, asynchronous and non-blocking Scala driver for MongoDB.

This is a classic AutoComplete application, backed by a MongoDB database. It demonstrates:

  • Achieving, Futures to use more idiomatic error handling.
  • Accessing a MongoDB database, using ReactiveMongo.
  • Replaced the embedded JS & CSS libraries with WebJars.
  • Play and Scala-based template engine implementation
  • Bootswatch-United with Twitter Bootstrap to improve the look and feel of the application

Screen View


Prerequisite


  • Pre Installed MongoDB if you do not have it already. You can get it from here
  • Create DB autocomplete by executing $ use autocomplete
  • Create collection countries by executing $ db.createCollection("countries")
  • Import CSV data into countries collection
$ mongoimport --db autocomplete --collection countries --type csv --headerline --file /resources/contries.csv
  • Create wildcard text indexes db.countries.createIndex({"$**": "text"})

Deploy Instructions


  • Clone the project into your local system $ git clone git@github.com:anand-singh/playing-autocomplete.git
  • To run the Play framework 2.5.x, you need JDK 8 or later
  • Install Typesafe Activator if you do not have it already. You can get it from here: download
  • Execute $ bin/activator clean compile to build the product
  • Execute $ bin/activator run to execute the product
  • playing-autocomplete should now be accessible at localhost:9000

###References :-