Converse Nest is a simple micro-blogging based API. It's simple to integrate and fun to use!!!
https://github.com/pndemo/converse_nest.git
cd converse_nestruby -vThe ouput should start with something like ruby 2.5.0
If not, install the right ruby version using rbenv (it could take a while):
rbenv install 2.5.0Using Bundler:
bundle installrails db:create db:migraterails s| Endpoint | Functionality | Access |
|---|---|---|
| POST /signup | Create a new user account | PUBLIC |
| Endpoint | Functionality | Access |
|---|---|---|
| POST /auth/login | Login a registered user | PUBLIC |
| Endpoint | Functionality | Access |
|---|---|---|
| GET /posts | Get all blog posts | PRIVATE |
| POST /posts | Create a new blog post | PRIVATE |
| PUT /posts/:id | Update an existing blog post | PRIVATE |
| DELETE /posts/:id | Delete an existing blog post | PRIVATE |
| Endpoint | Functionality | Access |
|---|---|---|
| GET /posts/:post_id/comments | Get all post comments | PRIVATE |
| POST /posts/:post_id/comments | Create a new post comment | PRIVATE |
| PUT /posts/:post_id/comments/:id | Update an existing post comment | PRIVATE |
| DELETE /posts/:post_id/comments/:id | Delete an existing post comment | PRIVATE |
Install httpie on your computer and make tests using the format below. Please note that the same testing format applies to the comments module.
http localhost:3000/signup name='Paul' email='paul@mail.com' password='strong' password_confirmation='strong'http localhost:3000/auth/login email='paul@mail.com' password='strong'http localhost:3000/posts \
Authorization:'eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJleHAiOjE1NTEwMjEzMTF9.sf1lsNjEMFUMBfUJvZdquDx60aib-1ngMFAi6E9PC-8'http POST localhost:3000/posts title='My Weekend' content='It was so awesome' created_by='Paul' \
Authorization:'eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJleHAiOjE1NTEwMjEzMTF9.sf1lsNjEMFUMBfUJvZdquDx60aib-1ngMFAi6E9PC-8'http PUT localhost:3000/posts/1 title='My Best Weekend' \
Authorization:'eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJleHAiOjE1NTEwMjEzMTF9.sf1lsNjEMFUMBfUJvZdquDx60aib-1ngMFAi6E9PC-8'http DELETE localhost:3000/posts/1 \
Authorization:'eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJleHAiOjE1NTEwMjEzMTF9.sf1lsNjEMFUMBfUJvZdquDx60aib-1ngMFAi6E9PC-8'The syntax is similar getting, posting, updating and deleting posts as illustrated above.
While this app provides simple micro-blogging functionalities of registering, authenticating, adding posts and comments, the next steps are to improve data validation and user management by enabling users to edit their information, change their password and control accessability of blog posts they posted by them.
This app is licensed under the MIT license.