A complete Blog Application with Spring Boot REST API backend and React frontend.
- JWT-based Authentication & Authorization
- User Management (Register, Login, Update Profile)
- Post Management (CRUD with Image Upload)
- Category Management
- Comment System
- Pagination & Sorting
- Role-Based Access Control
- Swagger/OpenAPI Documentation
- Modern UI with Tailwind CSS
- Responsive Design
- User Authentication Flow
- Post Creation with Image Upload
- Category Filtering
- Comment System
- User Dashboard
| Layer | Technology |
|---|---|
| Backend | Spring Boot 3.2.5, Spring Security 6, Spring Data JPA |
| Frontend | React 18, Vite, Tailwind CSS, React Router v6 |
| Database | MySQL 8 |
| Authentication | JWT (JSON Web Tokens) |
| API Docs | SpringDoc OpenAPI / Swagger |
BlogAppApis/
├── block-app-api/ # Spring Boot Backend
│ ├── src/main/java/org/code/
│ │ ├── controllers/ # REST Controllers
│ │ ├── entities/ # JPA Entities
│ │ ├── services/ # Business Logic
│ │ ├── security/ # JWT & Auth
│ │ └── config/ # Configuration
│ └── pom.xml
│
└── frontend/ # React Frontend
├── src/
│ ├── components/ # Reusable Components
│ ├── pages/ # Page Components
│ ├── context/ # Auth Context
│ └── services/ # API Services
└── package.json
- Java 21+
- Node.js 18+
- MySQL 8+
- Maven 3.8+
git clone https://github.com/taksh11982/BlogAppApis.git
cd BlogAppApisCREATE DATABASE `blog-app`;Update block-app-api/src/main/resources/application.properties:
spring.datasource.url=jdbc:mysql://localhost:3306/blog-app
spring.datasource.username=your_username
spring.datasource.password=your_passwordcd block-app-api
./mvnw spring-boot:runBackend runs at: http://localhost:8081
cd frontend
npm install
npm run devFrontend runs at: http://localhost:3000
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/v1/auth/login |
User login |
| POST | /api/v1/auth/register |
User registration |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/posts/ |
Get all posts |
| GET | /api/post/{id} |
Get post by ID |
| POST | /api/user/{userId}/category/{catId}/posts |
Create post |
| PUT | /api/post/{id} |
Update post |
| DELETE | /api/post/{id} |
Delete post |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/categories/ |
Get all categories |
| POST | /api/categories/ |
Create category |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/posts/{postId}/comments |
Add comment |
| DELETE | /api/comments/{id} |
Delete comment |
- Register:
POST /api/v1/auth/register - Login:
POST /api/v1/auth/login→ Returns JWT token - Use token in headers:
Authorization: Bearer <token>
Taksh
- GitHub: @taksh11982
⭐ Star this repo if you find it helpful! Creating a sample project for learning springboot only backend project.