Welcome to the CodeLearn 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.
- Features
- Prerequisites
- Getting Started
- JWT Authentication
- API Documentation
- Interactive Database Queries
- Contributing
- License
- User authentication and authorization using JWT.
- CRUD operations for blog posts, comments, and user profiles.
- API documentation using Swagger.
- Consistent and clean codebase following Ruby on Rails best practices.
Before you begin, ensure you have the following prerequisites installed:
- Ruby (version 3.2.0)
- Ruby on Rails (version 7.0)
-
Clone the repository:
git clone git@github.com:tuanle03/code_learn_api.git cd code_learn_api
-
Install dependencies:
bundle
-
Set up the database:
rails db:create db:migrate db:seed
-
Start project
rails s
This project uses JSON Web Tokens (JWT) for user authentication. Make sure to include the JWT token in the Token header of your requests:
Token: YOUR_TOKEN
Explore the API endpoints and test them using the Swagger documentation at http://localhost:2106/docs
.
We use Blazer for running SQL queries on our database. To access the Blazer dashboard, go to http://localhost:2106/mio
. You can create, save, and run queries interactively. Blazer helps us gain insights into our data and make informed decisions.
We welcome contributions! If you find a bug or have an enhancement in mind, please open an issue or submit a pull request.
This project is licensed under the MIT License.
Happy coding!