Kimono backend API
To run the application, ensure you have the following preconditions met:
- A PostgreSQL database setup with the following configuration:
- Database Name:
kimono
- Username:
kimono
- Password:
password
- Database Name:
Follow these steps to set up the required PostgreSQL database:
-
Log in to your PostgreSQL server:
psql -U postgres
-
Create a new database named
kimono
:CREATE DATABASE kimono;
-
Create a new user with the username
kimono
and passwordpassword
:CREATE USER kimono WITH PASSWORD 'password';
-
Grant all privileges on the
kimono
database to thekimono
user:GRANT ALL PRIVILEGES ON DATABASE kimono TO kimono;
-
Exit the PostgreSQL prompt:
\q
Your PostgreSQL database is now ready to use with the application.
src/
: The main source code of the projectmain/
: Contains the application logicjava/com/kimono/backend/
: Java package for the backend projectconfig/
: Configuration-related classes (e.g., security, application setup)controllers/
: REST API controllersdomain/
: JPA entities and domain objectsmappers/
: Classes for mapping between entities and DTOsrepositories/
: Data repository interfaces for database interactionsservices/
: Business logic and service layer
resources/
: Configuration and resource filesapplication.properties
: Spring Boot configuration
test/
: Test files for unit and integration testingjava/com/kimono/backend/
: Test files corresponding to main application code
target/
: Compiled output and build artifacts (generated)
- Spring Boot: Framework for building backend applications in Java
- Hibernate: ORM for database interaction
- PostgreSQL: Relational database management system
- Lombok: Reduces boilerplate code in Java
- Swagger UI: For API documentation and testing
- JUnit: Unit testing framework
- Maven: Build and dependency management tool
Install dependencies with Maven and start a development server:
./mvnw clean install
./mvnw spring-boot:run
Unit and integration tests are written using JUnit. Run the tests using Maven:
./mvnw test
To create a production build of the application:
./mvnw clean package
The resulting JAR file can be found in the target/
directory.
The API documentation is automatically generated using Swagger and can be accessed at:
http://localhost:8080/swagger-ui.html