Quoxy is a project that implements an API authenticator proxy using Go and SQLite. It features a token subscription system managed via Cron jobs for secure token management and storage, along with a reverse proxy component to redirect authenticated requests to the API. The name "Quoxy" is a merge between the words "quote" and "proxy," reflecting its role in securely managing and directing API requests.
.
├── api
│ └── handler
│ ├── health.go
│ ├── index.go
│ ├── not_found.go
│ ├── subscription.go
│ ├── token.go
│ └── version.go
├── cmd
│ └── token-proxy
├── config.example.yaml
├── deployment
│ └── database
├── internal
│ ├── database
│ ├── frequency_cron
│ ├── models
│ ├── proxy
│ ├── tests
│ └── token_handler
├── scripts
│ ├── debug.sh
│ ├── sql
│ ├── start.sh
│ └── test.sh
├── todo.md
├── util
│ ├── config
│ ├── env
│ ├── error_handler
│ ├── log
│ └── network
└── version.txt
Certainly! Here's a brief overview of the content in each folder of your project:
-
api: Contains handlers for different API endpoints.
- handler: Contains individual handler files for different endpoints like health checks, subscriptions, tokens, etc.
-
cmd: Contains the main application entry point.
- token-proxy: Contains the main Go file for starting the API authenticator proxy.
-
config.example.yaml: An example configuration file. Users can copy this file to
config.yaml
and modify it according to their needs. -
deployment: Contains deployment-related files.
- database: Contains a Docker Compose file for deploying the SQLite database in a container.
-
internal: Contains internal application logic.
- database: Contains database-related logic and utilities.
- frequency_cron: Contains logic for managing cron jobs.
- models: Contains data models for subscriptions and tokens.
- proxy: Contains logic for the reverse proxy.
- tests: Contains test files and utilities for testing the application.
- token_handler: Contains logic for handling tokens.
-
scripts: Contains shell scripts for debugging, starting, and testing the application.
- debug.sh: Shell script for debugging purposes.
- start.sh: Shell script for starting the application.
- test.sh: Shell script for running tests.
-
util: Contains utility packages for the application.
- config: Contains utilities for managing configuration settings.
- env: Contains utilities for managing environment settings.
- error_handler: Contains utilities for handling errors.
- log: Contains utilities for logging.
- network: Contains utilities for managing network settings.
-
version.txt: A file containing the version information for the project.
This structure organizes the project into logical components, making it easier to maintain and extend in the future.
- Token Subscription System: Utilizes Cron jobs for secure token management and storage.
- Reverse Proxy: Redirects authenticated requests to the API.
- Go (1.22)
- Clone the repository:
git clone https://github.com/yourusername/api-authenticator-proxy.git
- Navigate to the project directory:
cd api-authenticator-proxy
- Install dependencies:
go mod download
- Set up the configuration variables:
cp config.example.yaml config.yaml
- Set up the environment variables:
cp .env.example .env
- Start the application:
bash scripts/debug.sh
- The application will run on the port specified in the
config.yaml
file.
- Run the test suite:
bash scripts/test.sh
A docker-compose.yaml
file is included for deploying the supported databases for testing reasons.
- Navigate to the deployment directory:
cd deployment/database
- Start the database container:
docker-compose up -d
Contributions are welcome! Please submit a pull request or open an issue for any enhancements or bugs.
This project is licensed under the MIT License.
For any questions or inquiries, please contact [mdhouib195@gmail.com].