From a4ff5216ef3f806931b68358bedb055f968d6a87 Mon Sep 17 00:00:00 2001 From: MarcUs7i <96580944+MarcUs7i@users.noreply.github.com> Date: Wed, 2 Apr 2025 12:03:41 +0200 Subject: [PATCH] Updated README.md --- LICENSE | 7 +++++++ README.md | 46 +++++++++++++++++++++++++--------------------- 2 files changed, 32 insertions(+), 21 deletions(-) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..b369d7f --- /dev/null +++ b/LICENSE @@ -0,0 +1,7 @@ +Copyright 2025 MarcUs7i + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md index 06d5ae8..34002ee 100644 --- a/README.md +++ b/README.md @@ -1,36 +1,43 @@ # uLinkShortener -This project is the code behind [u.marcus7i.net](https://u.marcus7i.net), a custom URL shortener. It uses Flask, MongoDB, and Docker for quick deployment. +This project is the code behind [u.marcus7i.net](https://u.marcus7i.net), a custom URL shortener. It uses Go, MongoDB, and Docker for quick deployment. ## Prerequisites -- Python +- Go - MongoDB database (local or remote) - Docker & Docker Compose (optional, for containerized deployments) ## Setup 1. Clone the repository -2. Create a virtual environment (optional): - ``` - python -m venv env - source env/bin/activate # Linux/Mac - env\Scripts\activate # Windows - ``` -3. Install dependencies: - ``` - pip install -r requirements.txt - ``` 4. Define environment variables in the `.env` file: ``` MONGO_URI=mongodb://:@:/ + PORT= ``` ## Running Locally -1. Start MongoDB -2. Run: + +### Without Docker + +1. Install dependencies: ``` - python server.py + go mod download + ``` +2. Build and run: + ``` + go run cmd/api/main.go + ``` + +### With Docker + +1. Build and run with docker compose: + ``` + docker-compose -f docker-compose-build.yml up --build + ``` +2. Use of pre-built image: + ``` + docker compose up -d ``` -3. Access the app at http://localhost:5000 ## Docker Deployment 1. Build and run containers: @@ -39,9 +46,6 @@ This project is the code behind [u.marcus7i.net](https://u.marcus7i.net), a cust ``` 2. The application will be available at http://localhost:5000 -## Using GHCR +## License -Pull the prebuilt image: - ```bash - docker pull ghcr.io/MarcUs7i/ulinkshortener:latest - ``` \ No newline at end of file +This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details. \ No newline at end of file