-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Major refactoring, simplification and version update
Play Framework 2.6.13 Mongo Scala driver 2.2.1 Sbt 0.13.15 Scala 2.11.8
- Loading branch information
Ismet Ozozturk
committed
Apr 7, 2018
1 parent
282d9ce
commit 6fa3c21
Showing
36 changed files
with
559 additions
and
514 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
language: scala | ||
|
||
scala: | ||
- 2.11.7 | ||
- 2.11.8 | ||
|
||
jdk: | ||
- oraclejdk8 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,65 @@ | ||
# Scalongo [![Build Status](https://travis-ci.org/iozozturk/scalongo.svg)](https://travis-ci.org/iozozturk/scalongo) [![works badge](https://cdn.rawgit.com/nikku/works-on-my-machine/v0.2.0/badge.svg)](https://github.com/nikku/works-on-my-machine) | ||
# Scalongo [![Build Status](https://travis-ci.org/iozozturk/scalongo.svg)](https://travis-ci.org/iozozturk/scalongo) [![works badge](https://cdn.rawgit.com/nikku/works-on-my-machine/v0.2.0/badge.svg)](https://github.com/nikku/works-on-my-machine) | ||
|
||
|
||
This is a sample seed project showcasing new scala driver for MongoDb on Play Framework 2.5.0 | ||
This is a sample seed project showcasing new scala driver for MongoDb on Play Framework 2.6.13 | ||
|
||
Best suitable for your REST backends, Single Page Application(SPA) backends | ||
|
||
### What is this repository for? ### | ||
|
||
* Bootstrap your Play Application with MongoDb | ||
* Play Framework 2.5.0 | ||
* Play Framework 2.6.X | ||
* No frontend implemented | ||
* REST backend for all kind of your SPA or mobile applications | ||
* Sample MailGun api used for automated emails for signup, reset pass etc. | ||
|
||
### Implemented routines/endpoints ### | ||
|
||
* signup | ||
* activate account | ||
* login | ||
* logout | ||
* forgot password | ||
* set new password | ||
* secure endpoint | ||
|
||
### How do I get set up? ### | ||
|
||
* Download the project | ||
* Start your local MongoDb instance | ||
* Start your local MongoDB instance | ||
* Make changes at application.conf if necessary | ||
* run "./activator run" command at root directory | ||
* navigate to localhost:9000 on your browser | ||
* in order for MailService to work fill in your MailGun apiKey in application.conf | ||
|
||
### Sample Requests ### | ||
|
||
* **POST** localhost:9000/signup | ||
* **POST** localhost:9000/api/signup | ||
* **Content-Type:**application/json | ||
``` | ||
{ | ||
"username" : "ismet", | ||
"password" : "123456", | ||
"email" : "[email protected]", | ||
"name" : "ismet" | ||
} | ||
``` | ||
|
||
* **POST** localhost:9000/login | ||
* **POST** localhost:9000/api/login | ||
* **Content-Type:**application/json | ||
``` | ||
{ | ||
"username" : "ismet", | ||
"email" : "ismet@ismet.com", | ||
"password" : "123456" | ||
} | ||
``` | ||
|
||
* **GET** localhost:9000/secure | ||
* **GET** localhost:9000/api/secure | ||
|
||
* **POST** localhost:9000/logout | ||
* **POST** localhost:9000/api/logout | ||
|
||
### License ### | ||
|
||
Copyright 2015 İsmet Özöztürk | ||
Copyright 2018 İsmet Özöztürk | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package common | ||
|
||
import play.api.Logger | ||
|
||
trait AppLogger { | ||
protected lazy val logger = Logger(getClass.getName) | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package common | ||
|
||
import org.mongodb.scala.bson.ObjectId | ||
import play.api.libs.json._ | ||
|
||
trait JsonDecoders { | ||
implicit val objectIdWrites = new Writes[ObjectId] { | ||
def writes(objId: ObjectId) = JsString(objId.toString) | ||
} | ||
|
||
implicit val objectIdReads = new Reads[ObjectId] { | ||
override def reads(json: JsValue): JsResult[ObjectId] = JsSuccess(new ObjectId(json.as[String])) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.