A modern, full-stack blogging platform built with Angular and Spring Boot. 01Blog enables users to create, share, and discover engaging content with features like user authentication, post management, commenting, notifications, and admin moderation tools.
- Overview
- Features
- Tech Stack
- Prerequisites
- Installation
- Running the Application
- Project Structure
- API Documentation
- Database
- Contributing
01Blog is a comprehensive blogging platform designed for content creators and readers. It provides a seamless experience for publishing posts with media attachments, engaging with other users through comments and likes, and discovering new content through personalized feeds and user suggestions.
- User Management: Registration, authentication, and profile management
- Content Creation: Rich post creation with support for multiple media files (images and videos)
- Social Features: Follow/unfollow users, personalized feeds, and user discovery
- Engagement: Like posts, comment on content, and receive notifications
- Moderation: Admin dashboard for content and user management, report handling
- Real-time Notifications: Stay updated with activities and new content
- π Secure authentication with JWT tokens
- π€ User profiles with follower/following statistics
- π Create and edit blog posts with rich content
- πΌοΈ Upload multiple media files (up to 5 per post) - images and videos
- β€οΈ Like and unlike posts
- π¬ Comment on posts in real-time
- π Discover new users and content
- π Real-time notification system
- π° Personalized feed based on followed users
- π¨ Report inappropriate content or users
- π Dashboard with platform statistics
- π₯ User management and moderation
- π Post management and visibility control
- π© Content report review and handling
- π« User ban/unban capabilities
- ποΈ Hide/unhide posts
- Framework: Angular 20.3.2 (Standalone Components)
- Language: TypeScript
- Styling: SCSS with CSS Variables
- HTTP Client: Angular HttpClient
- Notifications: ngx-toastr
- UI Icons: Font Awesome 6.5.2
- State Management: RxJS Observables
- Framework: Spring Boot 3.x
- Language: Java 21
- Database: PostgreSQL
- ORM: Jakarta Persistence (JPA)
- Security: Spring Security with JWT
- Build Tool: Maven
- File Storage: Local filesystem with validation
- Containerization: Docker
- Orchestration: Docker Compose
- Version Control: Git
- Node.js 22+ and npm
- Java 21+
- Maven 3.8+
- Docker & Docker Compose (for containerized setup)
- PostgreSQL 17 (if running without Docker)
Create a .env file in the project root:
# Database Configuration
POSTGRES_DB=zerooneblog
POSTGRES_USER=postgres
POSTGRES_PASSWORD=your_secure_password
POSTGRES_PORT=5432
# Backend Configuration
SPRING_DATASOURCE_URL=jdbc:postgresql://localhost:5432/zerooneblog
SPRING_DATASOURCE_USERNAME=postgres
SPRING_DATASOURCE_PASSWORD=your_secure_password
# Frontend Configuration
API_URL=http://localhost:8080/apigit clone https://github.com/heisenstack/01blog.git
cd 01blogcd frontend
npm install
cd ..cd backend
mvn clean install
cd ..Docker Compose simplifies the setup by orchestrating all services in containers.
- Docker & Docker Compose installed
- Build and start all services:
docker-compose up -d- Verify services are running:
docker-compose psExpected output:
CONTAINER ID IMAGE PORTS
<id> 01blog-backend 0.0.0.0:8080->8080/tcp
<id> 01blog-frontend 0.0.0.0:4200->4200/tcp
<id> postgres:17-alpine 0.0.0.0:5432->5432/tcp
-
Access the application:
- Frontend:
http://localhost:4200 - Backend API:
http://localhost:8080/api
- Frontend:
-
Stop services:
docker-compose down- View logs:
docker-compose logs -f
# For specific service:
docker-compose logs -f backend
docker-compose logs -f frontenddocker run -d \
--name blog-db \
-e POSTGRES_DB=zerooneblog \
-e POSTGRES_USER=postgres \
-e POSTGRES_PASSWORD=password \
-p 5432:5432 \
postgres:17-alpineOr use a local PostgreSQL installation:
# macOS with Homebrew
brew services start postgresql
# Ubuntu/Debian
sudo systemctl start postgresql
# Windows
net start postgresql-x64-15cd backend
# Load environment variables
export $(cat ../.env | grep -v '^#' | grep -v '^$' | xargs)
# Run Spring Boot application
mvn spring-boot:runBackend will be available at: http://localhost:8080
Initial Admin Credentials (created automatically):
- Username:
admin - Password:
Admin123
In a new terminal:
cd frontend
npm install # if not done already
ng serveFrontend will be available at: http://localhost:4200
The application will automatically reload when you modify source files.
01blog/
βββ backend/
β βββ src/
β β βββ main/
β β β βββ java/com/zerooneblog/api/
β β β β βββ domain/ # Entity models
β β β β βββ service/ # Business logic
β β β β βββ infrastructure/ # Repositories
β β β β βββ interfaces/ # DTOs & Controllers
β β β β βββ ZerooneblogApplication.java
β β β βββ resources/
β β β βββ application.yml
β β βββ test/
β βββ pom.xml
β βββ Dockerfile
βββ frontend/
β βββ src/
β β βββ app/
β β β βββ auth/ # Authentication components
β β β βββ pages/ # Page components
β β β βββ components/ # Reusable components
β β β βββ services/ # API services
β β β βββ models/ # TypeScript interfaces
β β β βββ admin-dashboard/ # Admin panel
β β β βββ app.routes.ts
β β βββ index.html
β β βββ main.ts
β βββ package.json
β βββ angular.json
β βββ Dockerfile
βββ docker-compose.yml
βββ .env
βββ README.md
POST /api/auth/signup # User registration
POST /api/auth/login # User login
GET /api/auth/verify # Token verification
POST /api/auth/logout # User logout
GET /api/posts # Get all posts (paginated)
POST /api/posts # Create new post
GET /api/posts/{id} # Get post details
PUT /api/posts/{id} # Update post
DELETE /api/posts/{id} # Delete post
POST /api/posts/{id}/like # Like a post
DELETE /api/posts/{id}/like # Unlike a post
POST /api/posts/{id}/report # Report a post
GET /api/posts/feed # Get personalized feed
GET /api/users/{username} # Get user profile
POST /api/users/{username}/follow # Follow user
DELETE /api/users/{username}/follow # Unfollow user
POST /api/users/{username}/report # Report user
POST /api/comments # Create comment
PUT /api/comments/{id} # Update comment
GET /api/comments # Get comments (paginated)
DELETE /api/comments/{id} # Delete comment
GET /api/admin/dashboard # Dashboard statistics
GET /api/admin/users # Get all users (paginated)
GET /api/admin/reports # Get reports (paginated)
POST /api/admin/posts/{id}/hide # Hide post
POST /api/admin/posts/{id}/unhide # Unhide post
DELETE /api/admin/posts/{id} # Delete post
POST /api/admin/users/{id}/ban # Ban user
POST /api/admin/users/{id}/unban # Unban user
Main Tables:
users- User accounts and authenticationposts- Blog postspost_media- Media files attached to postscomments- Post commentspost_likes- User likes on postsuser_followers- Follow relationshipsreports- Content and user reportsnotifications- User notifications
The backend uses PostgreSQL with automatic schema initialization via Spring Boot JPA.
Connection Details:
- Host:
localhost(without Docker) orblog-db(with Docker Compose) - Port:
5432 - Database:
zerooneblog - Username:
postgres - Password: configured in
.env
# Using psql
psql -h localhost -U postgres -d zerooneblog
# Using Docker (if running containerized database)
docker exec -it blog-db psql -U postgres -d zerooneblog- JWT Authentication: Secure token-based authentication
- Password Encryption: Passwords hashed using Spring Security
- File Upload Validation: Whitelist of allowed media types and extensions
- CORS Configuration: Controlled cross-origin requests
- Role-based Access Control: Admin and User roles
- Input Validation: Server-side validation of all inputs
- Report System: Content moderation and user reporting
Images:
- JPEG, PNG, GIF, WebP
- Maximum size: 10MB
- Maximum files per post: 5
Videos:
- MP4, WebM, MOV, AVI
- Maximum size: 50MB
- Maximum files per post: 5
cd frontend
ng build --configuration productionProduction build output: frontend/dist/
cd backend
mvn clean package -DskipTestsProduction JAR: backend/target/01blog-api.jar
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
For issues, questions, or suggestions, please open an issue on the GitHub repository.
Last Updated: 2026