DailyBook is a backend-first social blogging platform that enables users to write posts, follow authors, manage content visibility, and receive notifications.
The system is inspired by Medium-like writing platforms and focuses on secure authentication, social graph logic, and strict server-side authorization rather than frontend-heavy features.
- Secure user authentication using JWT
- Blog post creation with multiple visibility levels
- Social following system with request–approval workflow
- Notification system for social interactions
- Strict backend-enforced access control
- User registration and login using JWT-based authentication
- Token expiration and validation
- Secured REST APIs using Spring Security 6
- All protected routes require valid authentication tokens
- Authorization checks enforced at service layer
Sensitive configuration such as JWT secrets and database credentials are managed using environment variables.
Users can create, update, and delete blog posts.
Each post supports:
- Title and content
- Tags for categorization
- Images uploaded via a cloud-based image storage service
Each post has one of the following visibility levels:
PUBLIC— visible to all usersPRIVATE— visible only to the authorFOLLOWERS_ONLY— visible only to approved followers
Post visibility and access control are strictly enforced on the backend, independent of frontend behavior.
The backend supports cloud-based image uploads for blog posts and user profiles.
- Images are uploaded from the client to a cloud storage service
- The backend stores and serves only secure image URLs
- This approach avoids local file storage and improves scalability
Image upload handling is integrated with authenticated endpoints to prevent unauthorized uploads.
DailyBook implements a request-based follow system:
- Users can send follow requests
- Requests must be approved by the recipient
- Users can reject follow requests
- Approved followers gain access to followers-only posts
- Users can unfollow at any time
APIs are provided to fetch:
- Followers list
- Following list
- Pending follow requests
The notification system informs users about social interactions:
- Follow request received
- Follow request approved
Features include:
- Fetch all notifications
- Fetch unread notification count
- Mark individual notifications as read
- Mark all notifications as read
Backend
- Java 17+
- Spring Boot
- Spring Security 6
- JWT Authentication
- MongoDB
- Cloud-based Image Storage
- Maven
The backend follows a layered architecture:
- Controller Layer — Handles HTTP requests and responses
- Service Layer — Business logic and authorization checks
- Repository Layer — MongoDB data access
- DTOs — Request and response contracts
- Security Layer — JWT filters and access validation
Authorization and visibility rules are enforced at the service layer to ensure data security.
POST /auth/register— Register a new userPOST /auth/login— Authenticate and receive JWTPOST /entries— Create a blog postGET /entries/explore— Get public postsPOST /follow/request/{userId}— Send follow requestPOST /follow/approve/{requestId}— Approve follow requestGET /notifications— Fetch notifications
spring.application.name=DailyBook
server.port=8080
spring.data.mongodb.uri=${MONGODB_URI}
jwt.secret=${JWT_SECRET}
jwt.expiration=604800000## 🚀 Running Locally
```bash
git clone https://github.com/anupamchaubey/Daily-Book
cd dailybook-backend
mvn spring-boot:runThis project was built with a backend-first approach, emphasizing:
- Secure authentication and authorization
- Social graph design (followers & requests)
- Backend-enforced content visibility
- Cloud-based image upload handling
- Clean and maintainable REST APIs
The frontend is intentionally lightweight to keep the focus on backend engineering.
- Redis caching for feeds
- Pagination and infinite scrolling
- Rate limiting
- Advanced search and filtering
- Unit and integration testing
Anupam
B.Tech CSE
Backend / SDE Aspirant
This project is licensed under the MIT License.