irpcpro/tele-link

Tele Link (link shortener) a pure php project with custom micro framework.

1.0.0 2023-01-13 15:21 UTC

This package is auto-updated.

Last update: 2024-10-30 01:54:06 UTC


README

Version: 1.0.0

Link shortening system (PHP) pure php project with custom micro framework.

Latest Stable Version Total Downloads License PHP Version Require

Installation

Install this project via Composer:

composer create-project irpcpro/tele-link
Requires:
  • php: "^7.4",
  • vitodtagliente/pure-routing: "^1.0",
  • rych/phpass: "^2.0",
  • firebase/php-jwt: "^6.3",
  • ext-json: "*",
  • ext-mysqli: "*"

Database Configuration

for set your database configuration, edit config/app-config.php


Create Default Database Tables

Run this script to create database tables

~ composer run-script sql-creator

Run Application

For run application, just need to run server on .\public\

~ cd .\public\
~ php -S localhost:8080

Or run server on .\public\ directory.


Routes

- Login [POST]:
{{host}}/api/v1/user/login
{
    "username": "admin",
    "password": "123"
}

- Create Link [POST]

⚠️ need authorization

{{host}}/api/v1/shortener/create
{
    "link": "https://facebook.com"
}

- Get All Links [GET]

⚠️ need authorization

{{host}}/api/v1/shortener/get-all?limit=10

- Delete Links [DELETE]

⚠️ need authorization

{{host}}/api/v1/shortener/delete/{link_id}

- Edit Links [EDIT]

⚠️ need authorization

{{host}}/api/v1/shortener/edit
{
    "link_id": 5,
    "link": "http://google-new.com"
}