gothinkster / realworld

"The mother of all demo apps" β€” Exemplary fullstack Medium.com clone powered by React, Angular, Node, Django, and many more

Home Page:https://main--realworld-docs.netlify.app/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

πŸ—„πŸ”§ 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:

  1. Could you summarize "How it works" in the README itself (its okay if not the whole blog post, at least some key information)?
  2. 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!

  1. 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.
  2. 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!