ππ§ Haskell / Yesod
tzemanovic opened this issue Β· comments
Current Status
Codebase in progress: https://github.com/tzemanovic/haskell-yesod-realworld-example-app
Todo:
- π Fork the starter repo & post the link in this issue
- π¨ Create logo for repo & update issue status (@EricSimons)
- π¨ Implement all of Conduit's functionality per the spec & API
- π Move repo to main org & Peer review final codebase by admins/community (RFC)
- π Tag v1 release and officially list it on the README!
Hi, I've got this implementation ready. Please, let me know what to do for the next step.
@tzemanovic this looks amazing! π a few suggestions:
- Could you summarize "How it works" in the README itself (its okay if not the whole blog post, at least some key information)?
- Could you run Postman API tests against your stack to ensure they work, and maybe even add to Travis YML file?
Great work!!!
Hi Anish, thank you!
- I've had a link to a blog post with overview of the project, but it wasn't very visible, so I've updated it.
- Thanks for fixing the tests in #255, I've ran them and all are passing except for the timestamp tests such as:
tests['Article\\'s \"createdAt\" property is an ISO 8601 timestamp'] = new Date(article.createdAt).toISOString() === article.createdAt;",
SQLite seems to be using 3 more decimals for microseconds, which get lost in the new Date(t).toISOString()
conversion, but this is a valid ISO 8601 date.
With the updates from #255 and #260, this is passing the postman tests now:
Conduit
β Auth
β³ Register
POST https://localhost:3443/api/users [200 OK, 733B, 79ms]
β Response contains "user" property
β User has "email" property
β User has "username" property
β User has "bio" property
β User has "image" property
β User has "token" property
β³ Login
POST https://localhost:3443/api/users/login [200 OK, 733B, 33ms]
β Response contains "user" property
β User has "email" property
β User has "username" property
β User has "bio" property
β User has "image" property
β User has "token" property
β³ Login and Remember Token
POST https://localhost:3443/api/users/login [200 OK, 733B, 31ms]
β Response contains "user" property
β User has "email" property
β User has "username" property
β User has "bio" property
β User has "image" property
β User has "token" property
β Global variable "token" has been set
β³ Current User
GET https://localhost:3443/api/user [200 OK, 733B, 4ms]
β Response contains "user" property
β User has "email" property
β User has "username" property
β User has "bio" property
β User has "image" property
β User has "token" property
β³ Update User
PUT https://localhost:3443/api/user [200 OK, 732B, 6ms]
β Response contains "user" property
β User has "email" property
β User has "username" property
β User has "bio" property
β User has "image" property
β User has "token" property
β Articles
β³ All Articles
GET https://localhost:3443/api/articles [200 OK, 436B, 4ms]
β Response code is 200 OK
β Response contains "articles" property
β Response contains "articlesCount" property
β articlesCount is an integer
β articlesCount is 0 when feed is empty
β³ Articles by Author
GET https://localhost:3443/api/articles?author=johnjacob [200 OK, 436B, 4ms]
β Response code is 200 OK
β Response contains "articles" property
β Response contains "articlesCount" property
β articlesCount is an integer
β articlesCount is 0 when feed is empty
β³ Articles Favorited by Username
GET https://localhost:3443/api/articles?favorited=jane [200 OK, 436B, 3ms]
β Response code is 200 OK
β Response contains "articles" property
β Response contains "articlesCount" property
β articlesCount is an integer
β articlesCount is 0 when feed is empty
β³ Articles by Tag
GET https://localhost:3443/api/articles?tag=dragons [200 OK, 436B, 3ms]
β Response code is 200 OK
β Response contains "articles" property
β Response contains "articlesCount" property
β articlesCount is an integer
β articlesCount is 0 when feed is empty
β Articles, Favorite, Comments
β³ Create Article
POST https://localhost:3443/api/articles [200 OK, 834B, 11ms]
β Response contains "article" property
β Article has "title" property
β Article has "slug" property
β Article has "body" property
β Article has "createdAt" property
β Article's "createdAt" property is an ISO 8601 timestamp
β Article has "updatedAt" property
β Article's "updatedAt" property is an ISO 8601 timestamp
β Article has "description" property
β Article has "tagList" property
β Article's "tagList" property is an Array
β Article has "author" property
β Article has "favorited" property
β Article has "favoritesCount" property
β favoritesCount is an integer
β³ Feed
GET https://localhost:3443/api/articles/feed [200 OK, 436B, 3ms]
β Response code is 200 OK
β Response contains "articles" property
β Response contains "articlesCount" property
β articlesCount is an integer
β articlesCount is 0 when feed is empty
β³ All Articles
GET https://localhost:3443/api/articles [200 OK, 855B, 3ms]
β Response code is 200 OK
β Response contains "articles" property
β Response contains "articlesCount" property
β articlesCount is an integer
β Article has "title" property
β Article has "slug" property
β Article has "body" property
β Article has "createdAt" property
β Article's "createdAt" property is an ISO 8601 timestamp
β Article has "updatedAt" property
β Article's "updatedAt" property is an ISO 8601 timestamp
β Article has "description" property
β Article has "tagList" property
β Article's "tagList" property is an Array
β Article has "author" property
β Article has "favorited" property
β Article has "favoritesCount" property
β favoritesCount is an integer
β³ All Articles with auth
GET https://localhost:3443/api/articles [200 OK, 855B, 3ms]
β Response code is 200 OK
β Response contains "articles" property
β Response contains "articlesCount" property
β articlesCount is an integer
β Article has "title" property
β Article has "slug" property
β Article has "body" property
β Article has "createdAt" property
β Article's "createdAt" property is an ISO 8601 timestamp
β Article has "updatedAt" property
β Article's "updatedAt" property is an ISO 8601 timestamp
β Article has "description" property
β Article has "tagList" property
β Article's "tagList" property is an Array
β Article has "author" property
β Article has "favorited" property
β Article has "favoritesCount" property
β favoritesCount is an integer
β³ Articles by Author
GET https://localhost:3443/api/articles?author=tzemanovic [200 OK, 855B, 5ms]
β Response code is 200 OK
β Response contains "articles" property
β Response contains "articlesCount" property
β articlesCount is an integer
β Article has "title" property
β Article has "slug" property
β Article has "body" property
β Article has "createdAt" property
β Article's "createdAt" property is an ISO 8601 timestamp
β Article has "updatedAt" property
β Article's "updatedAt" property is an ISO 8601 timestamp
β Article has "description" property
β Article has "tagList" property
β Article's "tagList" property is an Array
β Article has "author" property
β Article has "favorited" property
β Article has "favoritesCount" property
β favoritesCount is an integer
β³ Articles by Author with auth
GET https://localhost:3443/api/articles?author=tzemanovic [200 OK, 855B, 3ms]
β Response code is 200 OK
β Response contains "articles" property
β Response contains "articlesCount" property
β articlesCount is an integer
β Article has "title" property
β Article has "slug" property
β Article has "body" property
β Article has "createdAt" property
β Article's "createdAt" property is an ISO 8601 timestamp
β Article has "updatedAt" property
β Article's "updatedAt" property is an ISO 8601 timestamp
β Article has "description" property
β Article has "tagList" property
β Article's "tagList" property is an Array
β Article has "author" property
β Article has "favorited" property
β Article has "favoritesCount" property
β favoritesCount is an integer
β³ Articles Favorited by Username
GET https://localhost:3443/api/articles?favorited=jane [200 OK, 436B, 2ms]
β Response code is 200 OK
β Response contains "articles" property
β Response contains "articlesCount" property
β articlesCount is an integer
β articlesCount is 0 when feed is empty
β³ Articles Favorited by Username with auth
GET https://localhost:3443/api/articles?favorited=jane [200 OK, 436B, 3ms]
β Response code is 200 OK
β Response contains "articles" property
β Response contains "articlesCount" property
β articlesCount is an integer
β articlesCount is 0 when feed is empty
β³ Single Article by slug
GET https://localhost:3443/api/articles/how-to-train-your-dragon-toll6b [200 OK, 834B, 3ms]
β Response contains "article" property
β Article has "title" property
β Article has "slug" property
β Article has "body" property
β Article has "createdAt" property
β Article's "createdAt" property is an ISO 8601 timestamp
β Article has "updatedAt" property
β Article's "updatedAt" property is an ISO 8601 timestamp
β Article has "description" property
β Article has "tagList" property
β Article's "tagList" property is an Array
β Article has "author" property
β Article has "favorited" property
β Article has "favoritesCount" property
β favoritesCount is an integer
β³ Articles by Tag
GET https://localhost:3443/api/articles?tag=dragons [200 OK, 855B, 4ms]
β Response code is 200 OK
β Response contains "articles" property
β Response contains "articlesCount" property
β articlesCount is an integer
β Article has "title" property
β Article has "slug" property
β Article has "body" property
β Article has "createdAt" property
β Article's "createdAt" property is an ISO 8601 timestamp
β Article has "updatedAt" property
β Article's "updatedAt" property is an ISO 8601 timestamp
β Article has "description" property
β Article has "tagList" property
β Article's "tagList" property is an Array
β Article has "author" property
β Article has "favorited" property
β Article has "favoritesCount" property
β favoritesCount is an integer
β³ Update Article
PUT https://localhost:3443/api/articles/how-to-train-your-dragon-toll6b [200 OK, 833B, 4ms]
β Response contains "article" property
β Article has "title" property
β Article has "slug" property
β Article has "body" property
β Article has "createdAt" property
β Article's "createdAt" property is an ISO 8601 timestamp
β Article has "updatedAt" property
β Article's "updatedAt" property is an ISO 8601 timestamp
β Article has "description" property
β Article has "tagList" property
β Article's "tagList" property is an Array
β Article has "author" property
β Article has "favorited" property
β Article has "favoritesCount" property
β favoritesCount is an integer
β³ Favorite Article
POST https://localhost:3443/api/articles/how-to-train-your-dragon-toll6b/favorite [200 OK, 832B, 4ms]
β Response contains "article" property
β Article has "title" property
β Article has "slug" property
β Article has "body" property
β Article has "createdAt" property
β Article's "createdAt" property is an ISO 8601 timestamp
β Article has "updatedAt" property
β Article's "updatedAt" property is an ISO 8601 timestamp
β Article has "description" property
β Article has "tagList" property
β Article's "tagList" property is an Array
β Article has "author" property
β Article has "favorited" property
β Article's 'favorited' property is true
β Article has "favoritesCount" property
β favoritesCount is an integer
β Article's 'favoritesCount' property is greater than 0
β³ Unfavorite Article
DELETE https://localhost:3443/api/articles/how-to-train-your-dragon-toll6b/favorite [200 OK, 833B, 3ms]
β Response contains "article" property
β Article has "title" property
β Article has "slug" property
β Article has "body" property
β Article has "createdAt" property
β Article's "createdAt" property is an ISO 8601 timestamp
β Article has "updatedAt" property
β Article's "updatedAt" property is an ISO 8601 timestamp
β Article has "description" property
β Article has "tagList" property
β Article's "tagList" property is an Array
β Article has "author" property
β Article has "favorited" property
β Article has "favoritesCount" property
β favoritesCount is an integer
β Article's "favorited" property is true
β³ Create Comment for Article
POST https://localhost:3443/api/articles/how-to-train-your-dragon-toll6b/comments [200 OK, 665B, 4ms]
β Response contains "comment" property
β Comment has "id" property
β Comment has "body" property
β Comment has "createdAt" property
β "createdAt" property is an ISO 8601 timestamp
β Comment has "updatedAt" property
β "updatedAt" property is an ISO 8601 timestamp
β Comment has "author" property
β³ All Comments for Article
GET https://localhost:3443/api/articles/how-to-train-your-dragon-toll6b/comments [200 OK, 668B, 2ms]
β Response code is 200 OK
β Response contains "comments" property
β Comment has "id" property
β Comment has "body" property
β Comment has "createdAt" property
β "createdAt" property is an ISO 8601 timestamp
β Comment has "updatedAt" property
β "updatedAt" property is an ISO 8601 timestamp
β Comment has "author" property
β³ Delete Comment for Article
DELETE https://localhost:3443/api/articles/how-to-train-your-dragon-toll6b/comments/1 [200 OK, 407B, 2ms]
β³ Delete Article
DELETE https://localhost:3443/api/articles/how-to-train-your-dragon-toll6b [200 OK, 407B, 3ms]
β Profiles
β³ Register Celeb
POST https://localhost:3443/api/users [200 OK, 745B, 31ms]
β Response contains "user" property
β User has "email" property
β User has "username" property
β User has "bio" property
β User has "image" property
β User has "token" property
β³ Profile
GET https://localhost:3443/api/profiles/celeb_tzemanovic [200 OK, 541B, 3ms]
β Response code is 200 OK
β Response contains "profile" property
β Profile has "username" property
β Profile has "bio" property
β Profile has "image" property
β Profile has "following" property
β³ Follow Profile
POST https://localhost:3443/api/profiles/celeb_tzemanovic/follow [200 OK, 540B, 4ms]
β Response code is 200 OK
β Response contains "profile" property
β Profile has "username" property
β Profile has "bio" property
β Profile has "image" property
β Profile has "following" property
β Profile's "following" property is true
β³ Unfollow Profile
DELETE https://localhost:3443/api/profiles/celeb_tzemanovic/follow [200 OK, 541B, 3ms]
β Response code is 200 OK
β Response contains "profile" property
β Profile has "username" property
β Profile has "bio" property
β Profile has "image" property
β Profile has "following" property
β Profile's "following" property is false
β Tags
β³ All Tags
GET https://localhost:3443/api/tags [200 OK, 434B, 2ms]
β Response code is 200 OK
β Response contains "tags" property
β "tags" property returned as array
βββββββββββββββββββββββββββ¬βββββββββββ¬βββββββββββ
β β executed β failed β
βββββββββββββββββββββββββββΌβββββββββββΌβββββββββββ€
β iterations β 1 β 0 β
βββββββββββββββββββββββββββΌβββββββββββΌβββββββββββ€
β requests β 31 β 0 β
βββββββββββββββββββββββββββΌβββββββββββΌβββββββββββ€
β test-scripts β 46 β 0 β
βββββββββββββββββββββββββββΌβββββββββββΌβββββββββββ€
β prerequest-scripts β 17 β 0 β
βββββββββββββββββββββββββββΌβββββββββββΌβββββββββββ€
β assertions β 280 β 0 β
βββββββββββββββββββββββββββ΄βββββββββββ΄βββββββββββ€
β total run duration: 1024ms β
βββββββββββββββββββββββββββββββββββββββββββββββββ€
β total data received: 7.43KB (approx) β
βββββββββββββββββββββββββββββββββββββββββββββββββ€
β average response time: 8ms β
βββββββββββββββββββββββββββββββββββββββββββββββββ
Fantastic!