Table of Contents
Server layer of an application that gives an opportunity to shorten url. The application solves problem with long unreadable links. In the next step of development process it will allow to collect statistics about shorten link.
Here's why:
- Some users are scared of long links
- Easy link management
- Keep track of link traffic
The project is still in development due to that some features may not be available.
The application is built with Java and Spring boot framework, Postgresql database and Docker. For authentication, it uses JWT bearer tokens.
To setup and run the project follow instructions below.
- Docker
- To install docker you can use some kind of package manager like
sudo apt install docker
- linux orbrew install docker
- macos - On windows go to docker website and download installer: Docker installer
- To install docker you can use some kind of package manager like
-
Clone the repo
git clone https://github.com/Wonderpol/url-shortener-service.git
-
Open the following file:
src/main/resources/application-prod.yml
vim src/main/resources/application-prod.yml
or open it in different text editor.
-
In config section enter your front end url and jwt secret key. The secret key can be generated using Allkeysgenerator. In the mail section provide your SMTP provider, email, and password.
config: frontend-url: FRONT_END_URL email-confirm-frontend-endpoint: /confirm-email request-password-reset-frontend-endpoint: /reset-password jwt: secret-key: JWT_SECRET_KEY email-template: confirm-email: email-confirm.html reset-password: reset-password.html spring: datasource: url: jdbc:postgresql://db:5432/urlshortenerdb username: admin password: password driver-class-name: org.postgresql.Driver jpa: hibernate: ddl-auto: update show-sql: true properties: hibernate: format_sql: false database: postgresql database-platform: org.hibernate.dialect.PostgreSQLDialect mail: host: smtp.gmail.com port: 587 username: YOUR_EMAIL password: YOUR_PASSWORD properties: mail: smtp: auth: true starttls: enable: true debug: true protocol: smtp test-connection: false
-
Now within the root folder open terminal and type:
docker-compose up
Now if everything went well the application will be available at: localhost:8080
Email template customization: feel free to customize emails templates that are sent to users.
Go to src/main/resources/templates
, open and edit html template.
Usage will be moved to OpenAPI Documentation
- Move Usage section to OpenAPI documentation
- Add all available endpoints to README
- Add reset password feature
- Add link statistics
- Add notification 30 days before link expire
- Multi-language Email Support
- Polish
See the open issues for a full list of proposed features ( and known issues).
Project is still in development