This is a demo play web application for SCRUD funtionalities I. The user story This is a demo application for writing a basic business funtions (big use cases) as following:
- Create an user
- Update an user
- Delete an user
- Read users information
- Searching for users The user story will follow the INVEST nmemonic.
II. The technical usage are included as followings:
- Scala v2.11.4 language for development
- Redis with newest version together with a Redis driver. Redis is not a RDBMS so it requires a special design (for Key-Value DB). please see design DB and other application design document inside /docs/design folder.
- Behavior Driven Development, from user story to behavior check and then complete application.
- Reactive bahavior for both backend and front-end, non-blocking way
- Front-end is web-based developed by HTML, Coffee and Knockout
- Based on Play framework 2.1, BST 0.13 and Typesafe activator template.
III. Role definition
- Normal user (including guest)
- Administrator for the first step of the application we should care for normal user
IV. Actions for Role
- For normal user (here in after will be called User), when access to web front-end, can create another user.
- User can update another user information by loading them from the list.
- User can delete another user from the list
- User can search another users information by providing some search condition such as name and/or age
- User can read another users information. In the future time, user can only modify its information. Adminitrator can do asll as described above.
V. BDD - Behavior checking classes All behavior checking classes located in default package of test source folder.
- BaseAcceptanceSpec.scala: Base class for AcceptanceSpec BDD Style
- BaseUnitSpec.scala: Base class for FlatSpec BDD Style (Unit)
- CreatingUserFeatureSpec.scala: check behavior of creting user
- DeletingUserFeatureSpec.scala: check behavior of deleting user
- GettingUserFeatureSpec.scala: check behavior of getting an user
- IntegrationSpec.scala: Play automatic generated BDD class
- ListingUserFeatureSpec.scala: check behavior of listing all user
- SearchingUserFeatureSpec.scala: check behavior of searching user
- UpdatingUserFeatureSpec.scala: check behavior of updating user For easy testing, each file should be tested separately.
VI. Compile, test and run and configure VI.1. Compile,test and run As a Typesafe activator web application, you can start application by running 'activator' command as or combine 'activator' command with some option to start the task immediately, here in after are some ways: Firstly, you change to project folder, apply to all below: cd
- Do the following command in a terminal (each command in one line, terminated by key cd ./activator compile test run
- ./activator run or you can combine as many as you can: ./activator compile test run or ./activator -jvm-debug 9999 reload compile test ~run
- For supporting eclipse project you could do: ./activator eclipse with-source=true After that you can import eclipse project from project folder with new .project and .classpath files
After running the application, you can access the main page by URL: http://localhost:9000
NOTICE: All of above are supposed that you are working in Linux environment. VI.2. Configure Because this project is based on SBT so most configuration should be found at /build.sbt For route definition (please see more on playframework formal website) please see in file /conf/routes For play plugin, please see in file /conf/play.plugin
For more detail please contact: [email protected]