Url Shortener is a web application built with Spring Boot that allows users to create shortened URLs. It provides a simple interface for generating and managing shortened links.
- Docker engine
- Clone the repository:
git clone [email protected]:jakubpraszkowski/UrlShortener.git cd url-shortener
- Create a .env file in the root directory with the following content:
DATABASE_URL=jdbc:postgresql://java_db:5432/prod_db DATABASE_USERNAME=postgres DATABASE_PASSWORD=postgres SPRING_PROFILES_ACTIVE=online
- Build and start the project:
docker-compose up --build
To run the tests, use the following command:
mvn test
The project uses Springdoc OpenAPI to generate API documentation. To access the API documentation, follow these steps:
- Ensure the application is running.
- Open your browser and navigate to http://localhost:8080/swagger.
The application properties are configured in the following files:
- application.properties: Common properties.
- application-dev.properties: Development-specific properties.
- application-online.properties: Online-specific properties.
The application follows a typical Spring Boot architecture with the following components:
- Controller: Handles HTTP requests and responses.
- Service: Contains business logic.
- Repository: Interacts with the database.
- Entity: Represents database tables.
- Java 17
- Docker
- PostgreSQL
- Maven
- JUnit 5
- Mockito 2
- Swagger