Welcome to Posta, a blog application designed to learn and demonstrate the integration of Spring Boot for backend services with Angular for the front-end. This project aims to provide a platform for creating, reading, updating, and deleting (CRUD) blog posts, comments, and user authentication.
Posta serves as an educational tool for understanding how to build a full-stack application using:
- Backend: Spring Boot with JPA for database operations, Spring Security for authentication, and JWT for token management.
- Frontend: Angular for creating a responsive and interactive user interface.
The application features:
- User registration and authentication
- Post creation, editing, and deletion
- Comment system for posts
- Image handling: Upload images for posts, Display images on posts and user profiles, Delete images from the filesystem
- Role-based access control
- etc.
- Java 21
- Node.js (v22.12.0)
- npm (10.9.0)
- Angular CLI: (19.0.3)
- Angular (18.2.12)
- MySQL
- Apache Tomcat (11.0.2)
-
Clone the repository:
git clone https://github.com/angelokezimana/posta.git cd posta
-
Set up the database:
Create a new database named posta_db
in MySQL.
Update application.properties
or environment-specific properties files with your database credentials.
Build and run:
./mvnw spring-boot:run
- Navigate to the frontend folder:
cd src/main/webapp
- Install dependencies:
npm install
- Run the Angular app:
ng serve
Your Angular application will be accessible at http://localhost:4200/.
Use the commands above for running both backend and frontend in development mode.
-
Backend:
mvn clean install
to build a WAR file, then deploy on a server like Tomcat. -
Frontend:
npm run build
to generate a production build, then deploy to any static file server or use the backend as a reverse proxy.
- Backend (src/main/java/com/angelokezimana/posta/):
- config/: Configuration classes
- controller/: REST controllers
- service/: Business logic
- entity/: Database models
- repository/: JPA repositories
- Frontend (src/main/webapp/src/):
- app/: Angular modules, components, services
- assets/: Static files like images, SCSS
- environments/: Environment configurations
Access the OpenAPI specification at:
Development: http://localhost:8085/swagger-ui/index.html
Contributions are welcome! Please follow these steps:
-
Fork the repository:
git clone https://github.com/angelokezimana/posta.git
-
Create a new branch (
git checkout -b feature/YourFeature
) -
Make your changes
-
Commit your changes (
git commit -am 'Add some feature'
) -
Push to the branch (
git push origin feature/YourFeature
) -
Create a new Pull Request
This project is open source and available under the MIT License (LICENSE).