Skip to content

Norbit4/LicenseSystem

Repository files navigation

License System

The License System project provides full control over the application license system through an API with built-in authorization. It allows quick management of licenses, including creating, editing, deleting and viewing information. Integration with the Discord bot allows you to generate reports, check the validity of licenses and assign them to users, making administration much easier.

API is dedicate to minecraft plugins but can by used in other products and apps.

Used Languages and Tools:

Table of contents

How does it work?


schema


  • On startup:
curl -X 'GET' \
  'http://localhost:8080/api/v1/license/generateServerKey/<licenseKey>' \
  -H 'accept: */*' \
  -H 'Authorization: admin-secret-token'

When the application starts, it performs a reqest to the API to verify if the token key is correct and generate a new serverKey. If the license key is correct it sends the new generated serverKey.

  • On running:
curl -X 'PUT' \
  'http://localhost:8080/api/v1/license/isValidServerKey' \
  -H 'accept: */*' \
  -H 'Authorization: admin-secret-token' \
  -H 'Content-Type: application/json' \
  -d '{
  "licenseKey": "string",
  "serverKey": "string"
  }'

The application every x time sends a request to the API to verify if the server key is correct. If it is not correct it means that another application with the same license key has been started. Then the application closes.

Run

  1. Clone repository
git clone https://github.com/Norbit4/LicenseSystem
  1. Create discord bot and invite bot to your server

  2. Copy bot token and paste it to docker-compose.yml

  3. Start app

docker-compose up

Documentation

Documentation was created using OpenApi

preview: doc_example

Discord bot

The discord bot allows easy management of licenses and tokens.

preview:

  • Licenses

license_create

license_check

  • Report

report

  • Tokens

token_create

token_notfoud

Example implementation

Click to view

Tests

tests

logo