|
1 |
| -# README |
| 1 | +# Awesome Blog API |
2 | 2 |
|
3 |
| -This README would normally document whatever steps are necessary to get the |
4 |
| -application up and running. |
| 3 | +Welcome to the Awesome Blog API repository! This project is built using Ruby on Rails, Grape API, JWT (JSON Web Tokens), and Swagger. It provides a robust backend for a web blog application, allowing you to create, retrieve, update, and delete blog posts, comments, and more through a RESTful API. |
5 | 4 |
|
6 |
| -Things you may want to cover: |
| 5 | +## Table of Contents |
7 | 6 |
|
8 |
| -* Ruby version |
| 7 | +- [Features](#features) |
| 8 | +- [Prerequisites](#prerequisites) |
| 9 | +- [Getting Started](#getting-started) |
| 10 | + - [Installation](#installation) |
| 11 | +- [JWT Authentication](#jwt-authentication) |
| 12 | +- [Swagger Documentation](#swagger-documentation) |
| 13 | +- [Contributing](#contributing) |
| 14 | +- [License](#license) |
9 | 15 |
|
10 |
| -* System dependencies |
| 16 | +## Features |
11 | 17 |
|
12 |
| -* Configuration |
| 18 | +- User authentication and authorization using JWT. |
| 19 | +- CRUD operations for blog posts, comments, and user profiles. |
| 20 | +- API documentation using Swagger. |
| 21 | +- Consistent and clean codebase following Ruby on Rails best practices. |
13 | 22 |
|
14 |
| -* Database creation |
| 23 | +## Prerequisites |
15 | 24 |
|
16 |
| -* Database initialization |
| 25 | +Before you begin, ensure you have the following prerequisites installed: |
17 | 26 |
|
18 |
| -* How to run the test suite |
| 27 | +- Ruby (version 3.2.0) |
| 28 | +- Ruby on Rails (version 7.0) |
19 | 29 |
|
20 |
| -* Services (job queues, cache servers, search engines, etc.) |
| 30 | +## Getting Started |
21 | 31 |
|
22 |
| -* Deployment instructions |
| 32 | +### Installation |
23 | 33 |
|
24 |
| -* ... |
| 34 | +1. Clone the repository: |
| 35 | + |
| 36 | + ```bash |
| 37 | + git clone [email protected]:tuanle03/code_learn_api.git |
| 38 | + cd code_learn_api |
| 39 | + ``` |
| 40 | + |
| 41 | +2. Install dependencies: |
| 42 | + ```bash |
| 43 | + bundle install |
| 44 | + ``` |
| 45 | +3. Set up the database: |
| 46 | + ```bash |
| 47 | + rails db:create db:migrate |
| 48 | + ``` |
| 49 | +4. Start project |
| 50 | + ```bash |
| 51 | + rails server |
| 52 | + ``` |
| 53 | +## JWT Authentication |
| 54 | +This project uses JSON Web Tokens (JWT) for user authentication. Make sure to include the JWT token in the Authorization header of your requests: |
| 55 | + ```bash |
| 56 | + Authorization: Bearer YOUR_JWT_TOKEN |
| 57 | + ``` |
| 58 | + |
| 59 | +## Swagger Documentation |
| 60 | +Explore the API endpoints and test them using the Swagger documentation at `http://localhost:3000/doc`. |
| 61 | + |
| 62 | +## Contributing |
| 63 | +We welcome contributions! If you find a bug or have an enhancement in mind, please open an issue or submit a pull request. |
| 64 | + |
| 65 | +## License |
| 66 | +This project is licensed under the MIT License. |
| 67 | + |
| 68 | +Happy coding! |
| 69 | + |
0 commit comments