Giter Site home page Giter Site logo

jeboehm / uh.cx Goto Github PK

View Code? Open in Web Editor NEW
4.0 5.0 1.0 316 KB

This is a link shortener based on Symfony 4 and PHP 7.2.

Home Page: https://uh.cx/

License: MIT License

PHP 85.39% JavaScript 1.01% Makefile 2.71% CSS 1.69% HTML 8.22% Shell 0.18% Dockerfile 0.81%
linkshortener php application docker-image uhcx symfony-project symfony symfony-flex symfony-application

uh.cx's Introduction

uh.cx url shortener

Build Status Coverage Status

This is a link shortener based on Symfony 4 and PHP 7.1. It brings its own Docker environment so you can start immediately. See uh.cx for a demonstration, get the source code on github.

Features

  • JSON API
  • Google Analytics integration
  • EU cookie warning
  • RSS Feed about the generated links
  • Administration interface

Installation

Execute the following command to start the container. Keep in mind that you have to change the MySQL credentials.

docker run \
    -d --name=uhcx \
    -e MYSQL_HOST=yourmysql.host \
    -e MYSQL_DB=mysqlDatabaseName \
    -e MYSQL_USER=username \
    -e MYSQL_PASSWORD=secret \
    -e VIRTUAL_HOST=uh.cx,preview.uh.cx \
    --restart=always \
    -m 128M \
    jeboehm/uh.cx:latest

In addition you need a reverse proxy in front of the app. I recommend jwilder/nginx-proxy.

Set up the default site by issuing the following command:

docker exec -it uhcx bin/console site:create YourSitesName uh.cx preview.uh.cx

Security

The following uri's should be protected by your webserver configuration:

  • /admin
  • /feed

Configuration

Google Analytics

The app supports Google Analytics. To enable the integration pass the environment variable GA_TRACKING=UA-XXXXX-1 to the container.

Enable / disable EU cookie warning

If you need the EU cookie warning feature, set the environment variable COOKIE_WARNING to true.

Development

Requirements:

  • Docker
  • NPM
  • PHP
  • docker-sync

The development environment can be set up by using make:

make dev # Build the development image (contains Xdebug), start up MySQL + App, start docker-sync.
make clean # Completely delete the development environment.

Other commands

make build # Build Docker image for production from scratch.
make test # Start up an test environment, execute PHPUnit and delete the environment afterwards.
make coverage # Start up an test environment, execute PHPUnit and build code coverage reports.
make assets # Execute NPM and Grunt to build the public asset files.
make commit # Format the source code.

uh.cx's People

Contributors

jeboehm avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

tayssirsahli

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.