A backend for storing books and their authors. Created using TDD Approach to cement the core Rails development skills such as
- TDD Approach => Request tests, Controller tests ...
- Exception Handling via custom errorHandlers inheriting from StandardError
- Endpoints protection
- Writing custom serializers/Representers
- Handling Rails jobs
- Authentication is done using JWT.
- Hashing Passwords with Bcrypt for Maximum protections
- LInting using Rubocop to maintain code best practices
- Kanban board for tasks distribution(more Applicable in Team)
- Code Review => Reviewed my own PRs just to add an 'extra eye'
- Rails
- Rspec
- PostgreSQL
- jwt
AUthenticate User - returns a JWT token
Endpoint: POST https://localhost/api/v1/authenticate
{
"username":"kalunge",
"password":"qwerty"
}
{
"token": "eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxfQ.DiPWrOKsx3sPeVClrm_j07XNdSYHgBa3Qctosdxax3w"
}
Create Book and Author - returns newly CReated Book
Endpoint: Post https://localhost/api/v1/books
{
"book":
{
"title":"kalunge's Newest Book"
},
"author":
{
"first_name":"Titus",
"last_name":"Kalunge",
"age": 27
}
}
{
"id": 7,
"title": "kalunge's Newest Book",
"author_name": "Titus Kalunge",
"author_age": 27
}
Get Books - returns list of 66 bible books
Endpoint: GET https://localhost/api/v1/books
Authenticated:
[
{
"id": 1,
"title": "The meaning of Marriage",
"author_name": "Timothy Keller",
"author_age": 70
},
{
"id": 2,
"title": "The Freedom of Self forgetfulbess",
"author_name": "Robert Chire Sproul",
"author_age": 78
},
{
"id": 3,
"title": "The Fear of Man",
"author_name": "John Piper",
"author_age": 68
},
{
"id": 4,
"title": "12 Rules for Life",
"author_name": "Timothy Keller",
"author_age": 70
},
{
"id": 5,
"title": "Ascccx ",
"author_name": "Timothy Keller",
"author_age": 70
},
{
"id": 6,
"title": "kalunge's Newest Book",
"author_name": "Titus Kalunge",
"author_age": 27
}
]
Rspec spec/
👤 Titus Muthomi
- GitHub: @Kalunge
- Twitter: @titus_muthomi
- LinkedIn: Titus Muthomi
Contributions, issues, and feature requests are welcome!
Feel free to check the issues page.
Give a ⭐️ if you like this project!