This Project built in Java is a simple REST API that provides the feature of an image repository. For the moment two versions exist : v1 which stores the images on AWS S3
These versions are accessible through the two branches available on this repository.
Specifically this API offers the following features:
- Upload one or more image
- Download an image
Currently two routes are supported :
http://localhost:8282/
and
http://localhost:8282/images
Please consult the api documentation
This application has been built around the hexagonal architecture pattern. There are 4 layers : interface layer (REST interface), service layer,domain layer and persistence layer. This architecture presents the following pros:
- Easily change the external dependencies (cloud storage)
- Easier to maintain
- Easier to change technologies
- Easier to test
The app is running on https://img-repo-manefz.herokuapp.com/. Please consult the api documentation
Before running the app locally a few steps are required to setup S3 (v1).
- Java 1.8.*
- Maven 3.8.*
An AWS S3 account, with an IAM user. You need to save your two keys ( aws_access_key_id, aws_secret_access_key) in a file with the following name : s3_config.properties
Refer to the provided example for the properties file
The file needs to be placed in a folder "resources" as illustrated in the following example :
image-repo (project root)
└───resources
│ s3_config.properpeties
...
- Any REST client (Postman, Insomnia etc.)
This API was developed in Java with Jersey(implementation of JAX-RS) and Jetty (HTTP Container). Note : JAX-RS stands for Jakarta RESTful web services.
Once all the requirements are met simply run the following commands.
-
Clone the repo
-
In the root directory, run
mvn clean install
- In the root directory, run
mvn clean compile exec:java
Now the project should be up and running on
http://localhost:8282/
To run the tests, run
mvn test
Please consult the api documentation
- Implement an authentification system
- Add other features (buy and sell images)
- Throttle requests and limit amount of uploads per user (S3 free tier is not unlimited!)
- More unit tests
- Implement a basic UI to make this API easier to test manually