Giter Site home page Giter Site logo

siz-api's Introduction

siz-api

Siz.io API

Dependencies and technology

  • ReactiveMongo
  • Vagrant
  • Docker
  • BCrypt
  • Spracebook

Commands :

Run the app in test

sbt run
open http://localhost:9000

Run in docker

docker build . -tag "siz-api"
docker run -t -p 9000:9000 siz-api
open http://localhost:9000

Run in a docker in vagrant

vagrant up
open http://localhost:9000

siz-api's People

Contributors

jdauphant avatar fredoche avatar

Stargazers

 avatar

Watchers

 avatar James Cloos avatar Guillaume avatar  avatar  avatar Sofiane Beors avatar

siz-api's Issues

Migration Play 2.4

Dans le cadre de la migration de l'appli vers play 2.4, plusieurs items sont à prévoir:

  • changement java 8 dans travis et dans docker.
  • changement du plugin reactive-mongo-play: le nouveau utilise l'injection, et le nom a changé.
  • Voir si cela donne plus de flexibilité pour résoudre les problèmes d'atente de mongo dans les tests.
  • Global.scala don't exist anymore
  • Refactoring filter for injection
  • Remove v1.0 API compatibility

Tâches techniques à évaluer et implémenter

  • swagger
  • newrelic
  • spring data
  • vérifier les en tete de cache http sur les routes cacheables
  • utiliser un framework d'auth genre silouette
  • avoir un bout de l'api distribuée (pas forcément les comptes user) pour baisser la latence

Reconfigurer sbt pour qu'il forke

Au runtime et lors des tests, sbt est pour le moment configuré pour ne pas forker, ce qui peut poser des problèmes lors des réutilisations de contexte d'une part, et poser des problèmes de Metaspace d'autre part lors d'une session sbt console un peu longue.

ShowLastStoryToNewUserSpec "by recording user info each time he gets a video by slug" fail on tokenip

https://travis-ci.org/siz-io/siz-api/builds/73225142

[info] ShowLastStoryToNewUserSpec
[info] 
[info] When a new user (no user account) sees a story in his browser, the mobile app   should
[info]   show the same video
[error]     x by recording user info each time he gets a video by slug
[error]      The mock was not called as expected: 
[error]      Wanted but not invoked:
[error]      eventDao.addEvent(<any>);
[error]      -> at services.ShowLastStoryToNewUserSpec$$anonfun$1$$anonfun$apply$1$$anonfun$apply$2$$anon$1$$anonfun$3.apply(ShowLastStoryToNewUserSpec.scala:52)
[error]      Actually, there were zero interactions with this mock. (ShowLastStoryToNewUserSpec.scala:52)
[info] 

Error 500 when trying to get stories

I got this error when trying to get stories from the Feed

Error Domain=com.alamofire.error.serialization.response Code=-1011 "Request failed: internal server error (500)" UserInfo=0x17de39f0 {com.alamofire.serialization.response.error.response=<NSHTTPURLResponse: 0x17eb2260> { URL: http://api.dev.siz.io/stories?filterBy=recommends } { status code: 500, headers {
Connection = "keep-alive";
"Content-Length" = 52;
"Content-Type" = "application/json; charset=utf-8";
Date = "Fri, 03 Jul 2015 10:35:37 GMT";
Server = "nginx/1.6.2";
} }, NSErrorFailingURLKey=http://api.dev.siz.io/stories?filterBy=recommends, NSLocalizedDescription=Request failed: internal server error (500), com.alamofire.serialization.response.error.data=<7b226572 726f7273 223a7b22 7469746c 65223a22 496e7465 726e616c 20617069 20657272 6f722c20 74727920 6c617465 72227d7d>}
getStories(filterBy:sinceId:lastSkippedId:complete:) error -1011

Find a way to have multiple trusted proxies

Using variables to configure proxy FORWARDED_TRUSTED_PROXIES permit only one subnet.

Solution :

  • Use multiple variable _1 _2 _3
  • Find how to made a list from env variable in configuration
  • Hard code docker subnet
  • Accept all 0.0.0.0/0

API returns status code 500 when trying to get LikedStories

getStories(filterBy:sinceId:lastSkippedId:complete:) error -1011
<NSHTTPURLResponse: 0x1804e480> { URL: http://api.dev.siz.io/stories?filterBy=likes&lastSkippedId=558a85c045e9ab000d52dd5a } { status code: 500, headers {
Connection = "keep-alive";
"Content-Length" = 52;
"Content-Type" = "application/json; charset=utf-8";
Date = "Mon, 29 Jun 2015 10:22:52 GMT";
Server = "nginx/1.6.2";
} }
{
errors = {
title = "Internal api error, try later";
};
}

Add permissions

  • Add a permission to CreateStory
  • Write test to check permission

Type date in mongo objects

Pour le moment, les objets avec les champs supposément date sont en fait en Double:
Par ex, dans Users:
{
"_id" : ObjectId("559e959de30000e3004beb31"),
"email" : "[email protected]",
"passwordHash" : "$2a$10$RK0CvIuBO0elM9ccGZ0ePuBOJPPhgWkepFKBnWmMFvi3tTayxbr3m",
"username" : "paul.the.boss",
"creationDate" : 1436456949304.0000000000000000
}

Comprendre pourquoi, résoudre le bug et migrer les objets.

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.