A full-stack social blogging platform with a dark, modern UI featuring real-time notifications, user interactions, and comprehensive admin controls.
-
Authentication & Authorization
- JWT-based secure authentication
- Role-based access control (USER/ADMIN)
- Token expiration handling with automatic logout
- Session persistence across browser refreshes
-
Social Interactions
- Create, edit, and delete posts with rich text content
- Like/unlike posts
- Comment on posts with nested replies
- Follow/unfollow other users
- View personalized feed from followed users
-
User Profiles
- Customizable profile with avatar upload
- View user statistics (posts, followers, following)
- Browse user's post history
- Real-time follower/following counts
-
Real-Time Notifications
- Instant notifications for:
- New followers
- Post likes
- Comments on your posts
- Replies to your comments
- Unread badge indicator
- Mark as read functionality
- Beautiful dropdown notification center
- Instant notifications for:
-
User Discovery
- Search users by username
- Browse user profiles
- Follow suggestions
-
User Management
- View all registered users
- Ban/unban users
- Monitor user activity
- View user statistics
-
Content Moderation
- View all posts across the platform
- Delete inappropriate content
- Monitor post engagement
-
Report Management
- Review user-reported content
- Approve or reject reports
- Take moderation actions
-
Modern Dark Theme
- Sleek black background with accent colors
- Smooth animations and transitions
- Responsive design for all devices
- Material Design components
-
Creepy Login Animation
- Interactive scary face with eye tracking
- Smooth smile animation on input focus
- Glowing red accents
-
Error Handling
- Custom 404 Not Found page
- Comprehensive error component for 403, 404, 500 errors
- User-friendly error messages with navigation options
- Header hidden on error pages
- Framework: Spring Boot 3.5.7
- Language: Java 17
- Database: PostgreSQL 16
- Security: Spring Security + JWT
- ORM: Spring Data JPA / Hibernate
- Build Tool: Maven
- Framework: Angular 18
- UI Library: Angular Material
- Styling: CSS3 with custom animations
- HTTP Client: Angular HttpClient
- Routing: Angular Router
- State Management: RxJS
- Java 17 or higher
- Node.js 18+ and npm
- PostgreSQL 16+
- Maven 3.8+
git clone <repository-url>
cd 01blogCreate a PostgreSQL database:
CREATE DATABASE blog01;Update database credentials in backend/src/main/resources/application.properties:
spring.datasource.url=jdbc:postgresql://localhost:5432/blog01
spring.datasource.username=your_username
spring.datasource.password=your_passwordcd backend
# Build the project
./mvnw clean package -DskipTests
# Run the application
./mvnw spring-boot:runThe backend will start on http://localhost:8080
cd frontend
# Install dependencies
npm install
# Start the development server
ng serveThe frontend will start on http://localhost:4200
After the first run, you can create an admin account by:
- Register a normal user
- Manually update the database to set role to 'ADMIN'
UPDATE users SET role = 'ADMIN' WHERE username = 'your_username';In application.properties:
# JWT secret key (change in production!)
app.jwtSecret=mySecretKeyForJWT01BlogApplicationVerySecureKey2024
# Token expiration time
# 30 seconds for testing
app.jwtExpirationInMs=30000
# 24 hours for production (recommended)
# app.jwtExpirationInMs=86400000# Max file size for uploads
spring.servlet.multipart.max-file-size=50MB
spring.servlet.multipart.max-request-size=50MB01blog/
βββ backend/
β βββ src/main/java/com/_blog/_blog/
β β βββ config/ # Security & CORS configuration
β β βββ controller/ # REST API endpoints
β β βββ model/ # Entity classes
β β βββ repository/ # Data access layer
β β βββ security/ # JWT & authentication
β β βββ Application.java
β βββ src/main/resources/
β βββ application.properties
β
βββ frontend/
βββ src/app/
βββ components/ # Angular components
β βββ login/
β βββ register/
β βββ dashboard/
β βββ user-profile/
β βββ admin-dashboard/
β βββ error/
β βββ shared/
β βββ header/
β βββ post-card/
β βββ profile-sidebar/
β βββ create-post/
βββ services/ # API & business logic services
- JWT Authentication: Stateless token-based authentication
- Password Encryption: BCrypt hashing
- CORS Protection: Configured for localhost development
- Role-Based Access Control: USER and ADMIN roles
- HTTP-Only Tokens: Secure token storage
- Request Validation: Input sanitization and validation
- SQL Injection Prevention: Parameterized queries via JPA
POST /api/auth/register- Register new userPOST /api/auth/login- User login
GET /api/posts- Get all postsGET /api/posts/user/{username}- Get user's postsPOST /api/posts- Create postPUT /api/posts/{id}- Update postDELETE /api/posts/{id}- Delete postPOST /api/posts/{id}/like- Toggle likePOST /api/posts/{id}/comments- Add comment
GET /api/user/me- Get current userGET /api/user/{username}- Get user profilePOST /api/user/follow/{username}- Follow/unfollow userGET /api/user/subscribed-posts- Get feed from followed users
GET /api/notifications- Get all notificationsGET /api/notifications/unread- Get unread countPUT /api/notifications/{id}/read- Mark as read
GET /api/admin/users- Get all usersPUT /api/admin/users/{id}/ban- Ban userGET /api/admin/posts- Get all postsGET /api/admin/reports- Get all reports
The application handles various error scenarios:
- 401 Unauthorized: Token expired/invalid β Automatic logout
- 403 Forbidden: No permission β Error page with message
- 404 Not Found: Resource doesn't exist β Error page
- 500 Server Error: Backend issue β Error page with retry option
Edit frontend/src/styles.css or component-specific CSS files:
/* Primary colors */
--primary-color: #e91e63;
--accent-color: #ff2e2e;
--background-color: #000000;For production, use 24 hours (86400000 ms):
app.jwtExpirationInMs=86400000For testing, use 30 seconds:
app.jwtExpirationInMs=30000- Backend Port: 8080
- Frontend Port: 4200
- Database Port: 5432
- Auto-reload: Both frontend and backend support hot reload during development
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License.
- Angular Material for UI components
- Spring Boot for backend framework
- PostgreSQL for database
- JWT.io for token generation
For issues and questions:
- Open an issue on GitHub
- Check existing issues for solutions
Built with β€οΈ and β by [Your Name]