Code Monkey home page Code Monkey logo

play26-swagger-reactivemongo's Introduction

logo
Play Framework 2.6.x with Swagger and ReactiveMongo

A simple TODO app built with Play, Swagger and ReactiveMongo

travis build

How to run the app

You need

  • MongoDB Installed and running on your machine. Tutorial here
  • SBT (mandatory if you don't want to use an IDE)
  • IntelliJ to import the project (optional)
  • SBT plugin (optional)

Tho ways to run the project:

  • Import the project, run SBT and type run to launch the server.
  • cd into the project directory, run SBT and type run to launch the server or type sbt run.

Then open your favourite browser and go to

localhost:9000/api-docs

From the beautiful Swagger-UI interface you can perform all the CRUD operations you want

How to run the tests

In the tests directory there are tests written with the ScalaTest library.
To launch them just type test in a running SBT session or simply type sbt test

Enjoy.

Author: Riccardo Sirigu

play26-swagger-reactivemongo's People

Contributors

cchantep avatar ricsirigu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

play26-swagger-reactivemongo's Issues

A way to remove collection.flatMap from every query

Hi, I was wondering if there's a way to resolve the collection Future. If in Todo.scala model, this -

def collection: Future[JSONCollection]

could be converted to -

def collection: JSONCollection

Then in every query we could remove the collection.flatMap.

Example -

def addTodo(todo: Todo): Future[WriteResult] = {
   collection.flatMap(_.insert(todo))
}

would become -

def addTodo(todo: Todo): Future[WriteResult] = {
  collection.insert(todo)
}

attachments

Howdy,

first many thx for this use case with swagger and play

My question is... do you have maybe a example on how to use storage for images upload within a mongo document ect. maybe even extend your todo with attachments as example.

i can't find any examples for play mongo crud with images/attachments and really like to see some best practice thingy, if possible with swagger as wrapper around it.. that would be awesome.

Best regards,

Add aggregation queries

It will be awesome to have reactive mongo examples of aggregation queries to this application, but a todo application is a bit trival for this. I would suggest aggregation implementation for the mongo bios-example-collection

error

No Json serializer found for type Seq[models.Todo]. Try to implement an implicit Writes or Format for this type.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.