Blog Web Application that holds posts per user.
- Ruby
- Ruby on Rails
- RSpec, PostgreSQL
To use this project you first need to have installed the following:
- Node.js
- Ruby
- PostgreSQL
- Rails
- Ruby version
The version of ruby that is needed for this project is
- 2.7.0
Once you have installed them, you need to use the following command to clone the repository:
git clone https://github.com/Yothu/blog-app.git
Next, use this command to create the databases:
rake db:create
Use this command to run the migrations if necesessary:
rails db:migrate
Some of the authentication pages of this project send emails for email confirmation and password modification.
Use this command to install mailcatcher, a package that lets you catch and see the emails sent by the authentication pages.
gem install mailcatcher
Then use this command to run it:
mailcatcher
Enter this address in the browser to use mailcatcher:
http://127.0.0.1:1080
or
smtp://127.0.0.1:1025
Finally, use the following command to initialize the live server:
rails s
POST a User
curl localhost:3000/api/v1/signup -H "Content-Type: application/json" -d '{ "user": { "name": "[NAME]","email": "EMAIL","password": "[PASSWORD]" } }'
GET all Users
curl localhost:3000/api/v1/users -H "Authorization: [AUTH TOKEN]"
GET a User
curl localhost:3000/api/v1/users/[USER ID] -H "Authorization: [AUTH TOKEN]"
GET all Post of a User
curl localhost:3000/api/v1/users/[USER ID]/posts -H "Authorization: [AUTH TOKEN]"
GET a Post of a User
curl localhost:3000/api/v1/users/[USER ID]/posts/[POST ID] -H "Authorization: [AUTH TOKEN]"
GET all Comments of a Post of a User
curl localhost:3000/api/v1/users/[USER ID]/posts/[POST ID]/comments -H "Authorization: [AUTH TOKEN]"
GET a Comment of a Post of a User
curl localhost:3000/api/v1/users/[USER ID]/posts/[POST ID]/comments/[COMMENT ID] -H "Authorization: [AUTH TOKEN]"
POST a Comment in a Post of a User with your Account
curl localhost:3000/api/v1/users/[USER ID]/posts/[POST ID]/comments -H "Content-Type: application/json" -H "Authorization: [AUTH TOKEN]" -d '{ "text": "we did it!" }'
To check the test use the following command:
bundle exec rspec ./spec
👤 David Vergaray
- GitHub: @Yothu
- Twiter: @Daivhy
- LinkedIn: David Vergaray
👤 Sahar Abdel Samad
- GitHub: @sahar-abdelsamad
- Twitter: @abdelsamadsahar
- LinkedIn: sahar-abdel-samad
Give a ⭐️ if you like this project!
- Thanks to my family for their suport.
This project is MIT licensed.