A RESTful API service for an agro-platform connecting farmers and buyers. Implemented a role model (Farmer, Client), category and product management, order processing, and farm store statistics.
- Language: Java 25
- Framework: Spring Boot 4.0.3 (Web, Data JPA)
- Database: PostgreSQL
- Authentication: JWT Tokens
- Tools: Maven
- Documentation: Swagger (Springdoc OpenAPI)
-
Authentication: Registration and login (issuing a JWT token).
-
Public access: View product lists, categories, and search by name.
-
FARMER Role:
-
Manage your categories (create, delete).
-
Manage products (add, delete).
-
View your store's orders.
-
Get statistics (revenue, customers).
-
CLIENT Role:
-
Place an order.
-
Cancel orders.
This project uses PostgreSQL. Before running, make sure you have the database installed and running, and the connection settings are specified in application.properties (or application.yml).
- Clone the repository:
git clone https://github.com/theaprilthreatwind/aitu-mvp-project.git
cd aitu-mvp-project- Configure the PostgreSQL database: Create a database (e.g., agrohub) and update the configuration in src/main/resources/application.properties:
spring.datasource.url=jdbc:postgresql://localhost:5432/agrohub
spring.datasource.username=your_username
spring.datasource.password=your_password
spring.jpa.hibernate.ddl-auto=update- Run the application:
./mvnw spring-boot:run- Enabling frontend access (the entire frontend bridge is built via ngrok):
ngrok config add-authtoken <38DU12yBHRx4Jo34wRMlPxpFZP8_89xoDdkLsa2iec1G7PE2q>
ngrok http 8080Copy the URL (for example: https://unnegotiated-apocalyptically-paulette.ngrok-free.dev) and share it with the frontend developers.
- Swagger API Documentation: After successfully launching, navigate to: https://unnegotiated-apocalyptically-paulette.ngrok-free.dev/swagger-ui/index.html (you can test all endpoints here without third-party software).
Author: Miron Naidanov