This is an admin tool for managing PS Keyboard verification requests for my PS Keyboard webpage.
It's repo can be found here
The CLI supports both interactive and non-interactive modes.
-
Create a
.envfile based on the .env.example file:cp .env.example .env
-
Set the
DATABASE_URLin your.envfile. -
Build and run the app:
go build -o admin ./admin
Running the binary without any flags launches interactive mode:
./admin-
Print all verification requests:
./admin -print
-
Accept a verification request:
./admin -accept <request-id>
-
Reject a verification request:
./admin -reject <request-id>
main.go: Entry point that sets up the applicationinternal/cli: Command-line interface handlinginternal/config: Configuration loading from environmentinternal/db: Database connection and repositoryinternal/model: Data modelsinternal/service: Business logicinternal/ui: User interface components
-
Clone the repository
-
Install dependencies:
go mod download
-
Create a
.envfile with your database configuration -
Run the app:
go run main.go
- The main command processing happens in
cli.ExecuteCommandin the internal/cli/cli.go file. - Business logic is implemented in
service.VerificationServicein the internal/service/verification.go file.
- Implement asynchronous request handling for better performance
- Replace the current flag-based command parsing with a more robust solution like Cobra for better help documentation, nested commands, and improved user experience