This is a simple rest service project to deal with various common need, something like:
- url
- alias
- shortner
- pdf
- merge, split, etc...
- image
- Extract text
- Etc ...
This tool intended to make life easier.
Besides daily usage, this project is also a learning-project. Which is means that this project is build with these "things" in mind:
- Clean code
- 12 Factor App
- Securing rest api
- More to comes....
- Java (18)
- Spring boot
- Hibernate
- Security (Jwt)
- JUnit
- JSON
- Springdoc & Swagger-UI
- SQL (PostgreSQL)
- Docker
From docker container, we can deploy it to cloud hosting provider line AWS ECS, etc...
To install and run this module, you need
- Git
- Java (from 11)
- Maven
- Docker
- A running PostgreSQL Instance
And do following steps:
- Fork or just clone this repo.
- open terminal and change to project main directory
- compile the project, it will produce JAR file
$ mvn clean package
- Containerize the project
$ docker build -f Dockerfile -t common-tasks-service .
- Check if the image already on list
$ docker image ls
- Then we can run the image
$ docker run --name common-tasks-service-test -e SPRING_DATASOURCE_URL='database_url' -e SPRING_DATASOURCE_USERNAME='database_user_name' -e SPRING_DATASOURCE_PASSWORD='database_password' -e APP_JWTSECRETKEY='some_secret_key' -p 8080:8080 common-tasks-service
As you can see on command, there is some environment (-e) that we need to give.
-
SPRING_DATASOURCE_URL
- A running PostgreSQL database instance url
- For example : jdbc:postgresql://localhost:5432/tool
- Dont forget to add jdbc:postgresql: before the url
- A running PostgreSQL database instance url
-
SPRING_DATASOURCE_USERNAME
- Username that is used to login to database
-
SPRING_DATASOURCE_PASSWORD
- Password that is used to login to database
-
SERVICE_IDENTIFIER
- Custom value(string) to identify the service in runtime
- Default value is "none"
-
APP_JWTSECRETKEY
- some string that will be used to generate & validate jwt token