-
Notifications
You must be signed in to change notification settings - Fork 0
restful api implementation
This is a simple web application that exposes a REST API. This application uses Maven as the build tool and the current LTS version of Kotlin 1.7. I hope to add more functionality to this application in the future but for now this project uses the following dependencies:
- Spring Web
- Spring JPA/Hibernate
- Mysql Database
- Junit
You can run this application from your IDE or by running the following command:
./mvnw spring-boot:runThis application uses Junit 5 unit tests and Tescontainers.
If you want to build an artifact that can be used in production you have 2 options. This application uses JAR as the
packaging type.
./mvnw clean package- KPI Data Retrieval: Users can retrieve key performance indicators for weather data within specified time frames.
- Custom Time Range Queries: Supports querying data based on custom date ranges provided by the user.
- Summary and Precipitation Type Analysis: Allows analysis based on weather summary and precipitation types.
- Browsable API UI: Integrated Swagger UI for easy navigation and testing of the API endpoints.
-
Exposing DB credentials: Since this is a test project proper DB credentials import mechanisms like a parameter store (eg:- AWS SSM) has not been implemented.
-
Error Handling: Exception handling needs to be more robust to cover a wider range of potential failures and provide more informative error messages.
Given more time and resources, the following enhancements are planned:
- SSM Database Credential Fetching: Implement AWS Systems Manager (SSM) to securely fetch database credentials, avoiding hard-coded sensitive information.
- Arrow Integration: Utilize the Arrow library to bring more idiomatic functional programming constructs to the Kotlin codebase, enhancing readability and maintainability.
- Inline Functions: Leverage Kotlin's inline functions for higher-order functions to reduce overhead and improve performance.
- PIA Security: Implement Privacy Impact Assessment (PIA) compliant security measures to ensure user data is handled with the highest standards of privacy and security.
- API Rate Limiting: Introduce rate limiting to prevent abuse and ensure fair usage of the API resources.
Verify the interactions between different parts of the application, such as service layers, databases, and other APIs.
- Spring Boot Test
- Testcontainers for testing with real databases
- RestAssured for testing REST APIs
- Test the integration between different layers of the application.
- Use Testcontainers to test against a real database in a Docker container.
- Test REST endpoints with RestAssured to ensure they are working as expected.
Verify the system as a whole and ensure that the flow of the application from start to finish works as expected.
- Selenium, Cypress for web UI
- Postman/Newman for API flows
- Automate user interactions with the front end and ensure the backend processes these as expected.
- Use Postman/Newman to simulate API sequences that mimic real-world use cases.
Ensure the application performs well under expected and peak load conditions.
- JMeter
- Gatling
- Simulate multiple users accessing the application to test its load capacity.
- Analyze response times, throughput, and resource utilization.