https://github.com/asjordi/url-shortener-java
Url shortener with Java and Jakarta EE
https://github.com/asjordi/url-shortener-java
docker docker-compose hibernate jakarta-ee java jpa jsp jstl-tags mysql servlet tomcat-server
Last synced: 28 days ago
JSON representation
Url shortener with Java and Jakarta EE
- Host: GitHub
- URL: https://github.com/asjordi/url-shortener-java
- Owner: ASJordi
- License: mit
- Created: 2024-03-30T15:01:04.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-11-07T20:11:53.000Z (over 1 year ago)
- Last Synced: 2025-01-29T22:34:28.654Z (over 1 year ago)
- Topics: docker, docker-compose, hibernate, jakarta-ee, java, jpa, jsp, jstl-tags, mysql, servlet, tomcat-server
- Language: Java
- Homepage: https://url.asjordi.dev
- Size: 3.17 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## About :computer:
URL Shortener is a web application that allows you to shorten URLs with a custom alias. To do this, it uses MySQL to store the URLs and the aliases. Implements a AUTH_CODE to protect the creation of new URLs. The application is developed with Java and Jakarta EE. Implements JDBC and JPA to interact with the database. The application is deployed on a VPS using Docker.

## Demo :movie_camera:
https://github.com/ASJordi/url-shortener-java/assets/48893030/ce0019c5-de80-4144-bb62-973210f1fea0
## Stack :hammer_and_wrench:
* Java SE
* Jakarta EE
* JPA - Hibernate
* JDBC
* JSP
* JSTL
* CDI
* Tomcat
* MySQL
* CSS
* Water.css
## Installation :gear:
> You can run the application in a Docker container or in your local environment.
> If you don't want to build the application, you can download the Docker image from the [Packages section](https://github.com/ASJordi/url-shortener-java/pkgs/container/url-shortener-java)
### Docker :whale:
- Build the Docker image
```bash
docker build -t todo-app .
```
- Run the Docker container
```bash
docker container run -p 8080:8080 todo-app
```
- Use `docker-compose` to run the application with MySQL and PhpMyAdmin
```bash
docker compose up -d
```
> Make sure to create the database with the script in `src/main/resources/db/db.sql` before running the application.
### Local :computer:
- Clone the repository
```bash
git@github.com:ASJordi/url-shortener-java.git
```
- Create a MySQL database with the script in `src/main/resources/db/db.sql`
- Configure the database connection in `src/main/webapp/META-INF/context.xml`
- Install dependencies with Maven
- Configure tomcat to use the MySQL connector
- Run the application with:
```bash
mvn tomcat7:redeploy
```
## License :page_facing_up:
Distributed under the MIT License. See `LICENSE` for more information.
## Contact :email:
Jordi Ayala - [@ASJordi](https://twitter.com/ASJordi)
Project Link: [https://github.com/ASJordi/url-shortener-java](https://github.com/ASJordi/url-shortener-java)