Skip to content

imounish/tinyls-old

Repository files navigation

TinyLS - URL Shortener Service

A modern, secure, and scalable URL shortening service built with Spring Boot, React, and PostgreSQL.

🌟 Features

  • URL Shortening: Create short, memorable URLs from long ones
  • Authentication: Secure login with Google and GitHub OAuth2
  • Analytics: Track clicks and usage patterns
  • API: RESTful API for programmatic access
  • Monitoring: Prometheus metrics and Grafana dashboards
  • Security: JWT-based authentication, HTTPS, and secure headers

🏗️ Architecture

The project consists of several components:

  • Frontend: React-based web application
  • Backend: Spring Boot REST API
  • Database: PostgreSQL for data persistence
  • Infrastructure: Docker, Traefik, Prometheus, and Grafana

🚀 Quick Start

Prerequisites

  • Docker and Docker Compose
  • Java 21
  • Node.js 22+
  • Maven
  • Git

Local Development Setup

  1. Clone the repository

    git clone https://github.com/yourusername/tinyls.git
    cd tinyls
  2. Set up environment variables

    cp url-shortener/.env.example url-shortener/.env
    cp frontend/.env.example frontend/.env

    Edit the .env files with your configuration.

  3. Start the development environment

    docker compose watch
  4. Access the applications

Staging Environment

To run the staging environment locally:

docker compose -f docker-compose.yml -f docker-compose.staging.yml up -d

📚 Documentation

🛠️ Project Structure

tinyls/
├── frontend/          # React frontend application
├── url-shortener/     # Spring Boot backend application
├── infra/             # Infrastructure configurations
│   ├── traefik/       # Traefik reverse proxy configs
│   ├── prometheus/    # Prometheus monitoring configs
│   └── grafana/       # Grafana dashboard configs
└── docs/              # Project documentation

🔧 Configuration

Environment Variables

See Environment Variables for detailed configuration options.

OAuth2 Setup

  1. Create OAuth2 applications in Google and GitHub
  2. Configure the redirect URIs:
    • Google: https://api.staging.tinyls.com/login/oauth2/code/google
    • GitHub: https://api.staging.tinyls.com/login/oauth2/code/github
  3. Add the client IDs and secrets to your environment variables

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

See Contributing Guide for more details.

🔄 CI/CD Pipeline

The project uses GitHub Actions for continuous integration and deployment:

Workflows

  • Dependency Updates: Weekly automated dependency checks
  • Code Formatting: Automated code formatting with Spotless and Prettier
  • Testing: Automated testing for backend, frontend, and E2E tests
  • Code Review: Automated code quality checks with SonarQube, CodeQL, and Code Climate
  • Staging Deployment: Automated deployment to staging environment
  • Production Deployment: Automated deployment to production environment

Environments

  • Development: Local development environment
  • Staging: Pre-production testing environment
  • Production: Live production environment

Quality Gates

  • Code coverage requirements
  • Security scan results
  • Performance benchmarks
  • Accessibility standards

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

About

tinyls - Short URLs, BIG Impact

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published

Contributors 68