AB
Abhishek2010dev/Blog-Platform-API
A high-performance, Rust-based blogging platform API built using Axum, SQLx, and Tokio with PostgreSQL as the database.
Blog Platform API
A high-performance, Rust-based blogging platform API built using Axum, SQLx, and Tokio with PostgreSQL as the database.
๐ Features
- Create, read, update, delete (CRUD) blog posts
- Search blog posts by title, content, or tags
- Fast and scalable with Axum
- Asynchronous database operations with SQLx
- Structured logging with Tower
๐ ๏ธ Tech Stack
- Language: Rust ๐ฆ
- Frameworks & Libraries: Axum, SQLx, Tokio
- Database: PostgreSQL
๐ API Endpoints
| Method | Endpoint | Description |
|---|---|---|
GET |
/ |
Welcome message |
POST |
/posts |
Create a new blog post |
GET |
/posts |
Retrieve all blog posts |
GET |
/posts/search?term= |
Search blog posts by a keyword |
GET |
/posts/{id} |
Retrieve a blog post by ID |
PUT |
/posts/{id} |
Update a blog post by ID |
DELETE |
/posts/{id} |
Delete a blog post by ID |
๐๏ธ Setup
1๏ธโฃ Prerequisites
- Install Rust: rustup.rs
- Install PostgreSQL: postgresql.org
2๏ธโฃ Clone the Repository
git clone https://github.com/Abhishek2010DevSingh/Blog-Platform-API
cd blog-platform-api3๏ธโฃ Configure Environment
Create a .env file and set up the database URL:
DATABASE_URL=postgres://user:password@localhost/blog_db
4๏ธโฃ Run Migrations
sqlx database create
sqlx migrate run5๏ธโฃ Start the Server
cargo runThe API will be available at http://localhost:3000.
๐ Inspiration
This project is inspired by the Blogging Platform API roadmap.
This README keeps it clean, informative, and professional. Let me know if you want modifications! ๐