Internal Technical Documentation · Version 1.0
This document provides a complete, end-to-end guide for deploying, configuring, and maintaining the MyOpsAgent backend. It is intended for internal engineering teams, DevOps personnel, and future developers who will work on the platform.
MyOpsAgent is designed to be lightweight, portable, and easy to deploy on a wide range of hosting environments — from shared hosting to dedicated servers and cloud platforms. This guide ensures that deployments are consistent, secure, and reproducible across all environments.
MyOpsAgent has minimal infrastructure requirements. The following configuration is recommended for production deployments.
mysqlijsonmbstringopensslThe MyOpsAgent backend uses a clean, modular directory structure:
public_html/
api.php
docs/
api.md
overview.pdf
setup-guide.pdf
error-codes.pdf
app/
Domain/
Entities/
ValueObjects/
Application/
UseCases/
Controllers/
Infrastructure/
Persistence/
Logging/
Security/
public_html/ — Contains the public API entry point (api.php) and documentation.
app/Domain/ — Contains pure domain logic: entities, value objects, and domain rules.
app/Application/ — Contains use cases and controllers that orchestrate domain logic.
app/Infrastructure/ — Contains database repositories, logging, and security components.
This structure ensures clean separation of concerns and long-term maintainability.
MyOpsAgent uses environment variables to configure database access, admin keys, and other sensitive settings.
Create a .env file in the project root:
DB_HOST=localhost
DB_USER=myops
DB_PASS=yourpassword
DB_NAME=myopsagent
ADMIN_KEY=your_admin_key_here
| Variable | Description |
|---|---|
DB_HOST |
MySQL host address |
DB_USER |
MySQL username |
DB_PASS |
MySQL password |
DB_NAME |
Database name |
ADMIN_KEY |
Secret admin key for privileged operations |
.env to version control..env.example for developers.MyOpsAgent requires the following tables:
organisations — Stores organisation metadata.organisation_api_keys — Stores API keys, labels, and revocation timestamps.organisation_usage — Tracks daily usage, rate limits, and counters.decisions — Stores immutable decision records.audit_log — Stores request/response logs for compliance and debugging.migrations (optional) — Tracks schema changes.CREATE DATABASE myopsagent;
mysql -u myops -p myopsagent < schema.sql
SHOW TABLES;
Use the admin endpoint (e.g. /create_api_key) to create the first organisation and API key
after the schema is in place.
Below is the recommended deployment workflow for production environments.
Deploy the following directories:
public_html/app/.env (created on server)Ensure correct file permissions:
chmod -R 755 public_html
chmod -R 755 app
chmod 600 .env
<VirtualHost *:443>
DocumentRoot /var/www/myopsagent/public_html
ServerName myopsagent.com
<Directory /var/www/myopsagent/public_html>
AllowOverride All
Require all granted
</Directory>
SSLEngine on
SSLCertificateFile /etc/ssl/certs/myopsagent.crt
SSLCertificateKeyFile /etc/ssl/private/myopsagent.key
</VirtualHost>
server {
listen 443 ssl;
server_name myopsagent.com;
root /var/www/myopsagent/public_html;
ssl_certificate /etc/ssl/certs/myopsagent.crt;
ssl_certificate_key /etc/ssl/private/myopsagent.key;
index api.php;
}
Create .env on the server and populate it with production values.
Import the schema and verify database connectivity from the application.
Test the following endpoints:
/health/?route=create_api_key/?route=decide/?route=revoke_api_keyVerify:
Recommended monitoring tools:
Monitor:
MyOpsAgent logs every request with:
Logs are stored in the audit_log table and can be used for debugging, compliance, and
operational analytics.
fail2ban or equivalent.env file.env/health/decideMyOpsAgent scales horizontally due to:
To scale the platform:
This deployment guide provides everything required to install, configure, and maintain the MyOpsAgent backend in a secure and reproducible manner. By following these steps, your team can ensure consistent deployments, reliable performance, and long-term maintainability.
MyOpsAgent is designed to grow with your organisation — from initial deployment to enterprise-scale operations.