Blogography is a full-stack blogging platform built with Spring Boot and React, featuring a clean and modern user interface. It allows users to create, read, update, and delete blog posts with support for categories and tags.
- User Authentication: Secure login and registration system with JWT
- Blog Post Management: Create, read, update, and delete blog posts
- Categories & Tags: Organize posts with categories and tags
- Rich Text Content: Support for formatted blog content
- Reading Time: Automatic calculation of post reading time
- Responsive Design: Mobile-friendly interface
- Modern UI: Built with NextUI components
- Java 17
- Spring Boot 3.x
- Spring Security with JWT authentication
- Spring Data JPA
- PostgreSQL database
- Maven for dependency management
- React 18
- TypeScript
- NextUI for UI components
- Axios for API calls
- React Router for navigation
- DOMPurify for content sanitization
- Java 17 or higher
- Node.js 16 or higher
- PostgreSQL 14 or higher
- Maven 3.8 or higher
-
Clone the repository:
git clone https://github.com/CodeMahmoud/blography.git cd blogography -
Configure the database:
- Create a PostgreSQL database
- Update the database configuration in
src/main/resources/application.properties:spring.datasource.url=jdbc:postgresql://localhost:5432/your_database spring.datasource.username=your_username spring.datasource.password=your_password
-
Build and run the backend:
mvn clean install mvn spring-boot:run
-
Navigate to the frontend directory:
cd frontend -
Install dependencies:
npm install
-
Start the development server:
npm run dev
The application will be available at:
- Backend: http://localhost:8080
- Frontend: http://localhost:5173
POST /api/v1/auth/register- Register a new userPOST /api/v1/auth/login- Login and get JWT token
GET /api/v1/posts- Get all published postsGET /api/v1/posts/{id}- Get a specific postPOST /api/v1/posts- Create a new postPUT /api/v1/posts/{id}- Update a postDELETE /api/v1/posts/{id}- Delete a postGET /api/v1/posts/drafts- Get draft posts (authenticated)
GET /api/v1/categories- Get all categoriesPOST /api/v1/categories- Create a new categoryPUT /api/v1/categories/{id}- Update a categoryDELETE /api/v1/categories/{id}- Delete a category
GET /api/v1/tags- Get all tagsPOST /api/v1/tags- Create new tagsDELETE /api/v1/tags/{id}- Delete a tag
blogography/
├── frontend/ # React frontend application
│ ├── src/
│ │ ├── components/ # Reusable UI components
│ │ │ ├── components/ # Reusable UI components
│ │ │ ├── pages/ # Page components
│ │ │ ├── services/ # API service
│ │ │ └── types/ # TypeScript types
│ │ └── package.json
│ └── src/ # Spring Boot backend
│ ├── main/
│ │ ├── java/
│ │ │ ├── controllers/ # REST controllers
│ │ │ ├── domain/ # Domain models and DTOs
│ │ │ ├── repositories/ # JPA repositories
│ │ │ ├── services/ # Business logic
│ │ │ └── security/ # Security configuration
│ │ └── resources/ # Configuration files
│ └── test/ # Test files
└── pom.xml # Maven configuration
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.