License API is an open-source API designed to help manage licenses for your product. This project is built with Go.
- go
.envbased on .env.examplesettings.yaml
The recommended way to deploy License API is via Docker. To get started, simply run:
docker compose upIf you prefer to build the application from source, you can do so with the following command:
go build -o main.exe cmd/api/main.goNote that when building from source, you must deploy your own instance of the database. While MongoDB is typically managed via Docker, you'll need to ensure your database is properly configured and running if you opt out of Docker.
License API uses MongoDB to store and manage licenses. The licenses are stored in the following JSON format:
{
"license": "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX",
"username": "combo23",
"createdAt": "1723018924",
"updatedAt": "1723018924",
"expiresAt": "1723018924",
"hwid":"cdd31a3e-d3c7-45cc-b271-e3ce4d1e568e",
"status":"active"
}Example implementations of this licensing system can be found in the examples directory. These examples demonstrate how to integrate the License API into your own product.
Comprehensive documentation about the API endpoints is available in the API_documention.md file
The Makefile included with this project provides several commands to streamline common tasks:
run all make commands with clean tests
make all buildbuild the application
make buildrun the application
make runCreate DB container
make docker-runShutdown DB container
make docker-downlive reload the application
make watchrun the test suite
make testclean up binary from the last build
make clean