An open API service indexing awesome lists of open source software.

https://github.com/norbit4/licensesystem

System to manage and implement product licenses
https://github.com/norbit4/licensesystem

api discord docker java javascript license product-license

Last synced: 5 months ago
JSON representation

System to manage and implement product licenses

Awesome Lists containing this project

README

          

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?](#work)
- [Documentation](#doc)
- [Discord bot](#bot)
- [Example implementation](#implementation)
- [Tests](#tests)

How does it work?


![schema](https://github.com/Norbit4/LicenseSystem/assets/46154743/dcca63ec-6953-41b3-8c13-5e425c0f85f9)


- *On startup:*

```yml
curl -X 'GET' \
'http://localhost:8080/api/v1/license/generateServerKey/' \
-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:*

```yml
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.

Back to top

Run

1. Clone repository

```
git clone https://github.com/Norbit4/LicenseSystem
```

2. [Create discord bot](https://discord.com/developers/docs/intro) and invite bot to your server

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

4. Start app

```
docker-compose up
```

Back to top

Documentation

Documentation was created using [OpenApi](https://github.com/OAI)

- local env: http://localhost:8080/swagger-ui/index.html

preview:
![doc_example](https://github.com/Norbit4/LicenseSystem/assets/46154743/d1097c45-80ed-4bc4-bfa0-dff6c6ae417d)

Back to top

Discord bot

The discord bot allows easy management of licenses and tokens.

preview:
- Licenses

![license_create](https://github.com/Norbit4/LicenseSystem/assets/46154743/85352472-e3d1-4111-b64a-4dab94a1c053)

![license_check](https://github.com/Norbit4/LicenseSystem/assets/46154743/190be861-74c0-4c47-bf17-14a78eca3670)

- Report

![report](https://github.com/Norbit4/LicenseSystem/assets/46154743/353c196e-2779-4b80-8475-379067f9b6f5)

- Tokens

![token_create](https://github.com/Norbit4/LicenseSystem/assets/46154743/219d97b3-1834-4a06-b957-7b30c9f5fb73)

![token_notfoud](https://github.com/Norbit4/LicenseSystem/assets/46154743/81a1b8ca-0403-4977-a34c-0c3d75b6a724)

Back to top

Example implementation

[Click to view](https://github.com/Norbit4/LicenseSystem/tree/master/example/exampleplugin/src/main/java/pl/norbit/exampleplugin)

Tests

![tests](https://github.com/Norbit4/LicenseSystem/assets/46154743/bce4a16e-ebc0-4029-a552-0bf36b0977c7)


logo

Back to top