Skip to content

ahmadmo/scala-play-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

scala-play-example

Completely written in Scala programming language, with the help of

What you will find in this repository:

  • How to add more abstraction to Slick (here)
  • Auto table generation on startup using Slick (here)
  • Handling complex forms in Play! (here or here)
  • Token-based Authentication using JWT (here)
  • Advanced scheduling with akka (here and here)
  • Managing concurrent db inserts/updates using akka actors (here)
  • Working with shapeless tuples (here) and lenses (here)
  • etc.

DB configuration

Currently using H2 db (see here), but you can easily replace it with your favorite db. (More information)

TODO

  • Source code documentation
  • Add more functionalities & features
  • Play with Slick thread-pool & connection-pool configurations
  • Do some load & performance tests using gatling
  • Provide comparison between Slick and Hibernate ORM

API

# Location
GET                 /province/list
GET                 /city/list/:provinceId

# Car Brand & Model
POST                /car/brand/add
GET                 /car/brand/list
GET                 /car/brand/search/:name
POST                /car/model/:brandId/add
GET                 /car/model/list/:brandId
GET                 /car/model/search/:brandId/:name

# Auth
POST                /auth/login
GET                 /auth/me
GET                 /auth/login/list
POST                /auth/token
POST                /auth/logout

# File
GET                 /file/:name

# Seller
POST                /seller/register
PUT                 /seller/photo/upload
DELETE              /seller/photo/delete
GET                 /seller/info/:id
GET                 /seller/info
GET                 /seller/list
GET                 /seller/list/:sellerType
GET                 /seller/list/:location/:locationId
GET                 /seller/list/:sellerType/:location/:locationId

# Ad
POST                /ad/submit
PUT                 /ad/submit/:id
PUT                 /ad/cancel/:id
GET                 /ad/info/:id
PUT                 /ad/view/:id
PUT                 /ad/view/phone/:id
GET                 /ad/list

Note: for more information, please import this dump file to your Postman app.