A full-stack blog application built with React and Spring Boot, featuring user authentication, blog management, and responsive design.
- User Authentication: Secure JWT-based login and registration
- Blog Management: Create, read, update, and delete blog posts
- Public Access: Anyone can view blogs, only authenticated users can create/edit
- Responsive Design: Works seamlessly on desktop and mobile devices
- Pagination: Efficient blog listing with pagination support
- Author Controls: Blog authors can edit and delete their own posts
- React 18 - Modern UI framework
- React Router - Client-side routing
- Tailwind CSS - Utility-first CSS framework
- Axios - HTTP client for API requests
- Spring Boot 3.5.5 - Java web framework
- Spring Security - Authentication and authorization
- Spring Data JPA - Database abstraction layer
- PostgreSQL - Relational database
- JWT - Stateless authentication tokens
- Java 21 or higher
- Node.js 18 or higher
- PostgreSQL 12 or higher
- Maven 3.6 or higher
git clone <repository-url>
cd BlogApp-- Create database
CREATE DATABASE blogapp;
-- Create user (optional)
CREATE USER blogapp_user WITH PASSWORD 'your_password';
GRANT ALL PRIVILEGES ON DATABASE blogapp TO blogapp_user;cd blogapp
# Update application.properties with your database credentials
# src/main/resources/application.properties
# Run the Spring Boot application
mvn spring-boot:runThe backend will start on http://localhost:8082
cd blogfront/blogfront
# Install dependencies
npm install
# Start the development server
npm run devThe frontend will start on http://localhost:5173
BlogApp/
βββ blogapp/ # Spring Boot backend
β βββ src/main/java/
β β βββ com/blogapp/blogapp/
β β βββ controller/ # REST controllers
β β βββ service/ # Business logic
β β βββ entity/ # JPA entities
β β βββ dto/ # Data transfer objects
β β βββ config/ # Configuration classes
β β βββ security/ # Security components
β βββ src/main/resources/
β βββ application.properties
β βββ schema.sql
βββ blogfront/blogfront/ # React frontend
β βββ src/
β β βββ components/ # Reusable components
β β βββ pages/ # Page components
β β βββ contexts/ # React contexts
β β βββ services/ # API services
β βββ public/
βββ README.md
POST /api/auth/register- User registrationPOST /api/auth/login- User loginPOST /api/auth/logout- User logout
GET /api/blogs- Get all blogs (public, paginated)GET /api/blogs/{id}- Get blog by ID (public)POST /api/blogs- Create new blog (authenticated)PUT /api/blogs/{id}- Update blog (author only)DELETE /api/blogs/{id}- Delete blog (author only)
- Home Page (
/) - Public blog listing with pagination - Login Page (
/login) - User authentication - Register Page (
/register) - User registration - Create Blog (
/create) - Blog creation (protected) - Blog Detail (
/blog/:id) - Individual blog view (public) - Edit Blog (
/edit/:id) - Blog editing (author only)
- JWT-based stateless authentication
- Password encryption using BCrypt
- Route protection for authenticated users
- Author-only access for blog editing/deletion
- CORS configuration for cross-origin requests
The application is fully responsive and optimized for:
- Desktop (1024px+)
- Tablet (768px - 1023px)
- Mobile (320px - 767px)
# Build the JAR file
mvn clean package
# Run the JAR
java -jar target/blogapp-0.0.1-SNAPSHOT.jar# Build for production
npm run build
# The dist/ folder contains the production buildcd blogapp
mvn testcd blogfront/blogfront
npm testFrontend URL: https://blog-app-kappa-two-40.vercel.app/
- Register a new account or login with existing credentials
- Browse blogs on the home page (no authentication required)
- Create new blogs after logging in
- Edit or delete your own blog posts
- View detailed blog posts by clicking on titles
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.

