- Cloud-friendly Architecture: Designed to easily deploy on cloud environments with scalability and flexibility in mind.
- High Performance: Built with C++ for efficient processing and rapid response times.
- Object Storage: MinIO is used to manage and serve large media files efficiently, providing S3-compatible storage.
- Scalable Database: Powered by ScyllaDB, offering low-latency and high-throughput database operations, ensuring optimal performance even under heavy loads.
- Vector Database: Integrated with Qdrant for efficient vector-based similarity search on embeddings.
- Fast Text Embeddings: Leverages C++ ONNX runtime and C++ bindings for a Rust-based Tokenizer to extract embeddings at high speed, with similarity search endpoints available out of the box.
- Dockerized Setup: Deploy all components including the CMS API, Admin Panel, Object Storage (MinIO), and ScyllaDB with a single
docker compose
command. - Admin Panel: Manage content easily through a React-powered admin interface.
- Backend: C++ for high-performance API handling.
- Database: ScyllaDB for low-latency, high-throughput database operations.
- Vector Search: Qdrant for similarity search using embeddings.
- Object Storage: MinIO for scalable object storage.
- Frontend: Admin panel built with React
Ensure that you have the following installed:
- Docker: Install Docker
- Docker Compose: Install Docker Compose
-
Clone the Repository:
git clone https://github.com/AtlasYang/sonicms.git cd sonicms
-
Create the
.env
File:You can use the provided
.env.template
as a base by modifying the placeholders according to your setup (e.g., database credentials, API ports, MinIO access keys). After making the necessary changes, rename it to.env
.For example:
cp .env.template .env
Then, update the values in
.env
:ADMIN_PANEL_PORT=3000 CMS_API_PORT=8080 MINIO_URL=http://yourdomain.com/storage/ MINIO_ACCESS_KEY=your-access-key MINIO_SECRET_KEY=your-secret-key ...
-
Run Docker Compose:
Once the
.env
file is ready, navigate to the project root directory and start the CMS by running:docker compose up --build
This will build and start all the necessary services, including:
- SonicMS API Server: The core CMS API server.
- Admin Panel: The React-powered admin interface.
- ScyllaDB: The high-performance database.
- MinIO: The object storage service for managing large media files.
- Qdrant: The vector search engine.
-
Claim MinIO Access Key and Secret Key:
Open your browser and navigate to
http://localhost:[MINIO_WEB_ADMIN_PORT]
to access the MinIO admin console. In the admin console, go to Access Keys and click Create Access Key.Once generated, update the
.env
file with the new credentials:STORAGE_ACCESS_KEY
= [your new access key]STORAGE_SECRET_KEY
= [your new secret key]
-
Access the Application:
You can customize exposed ports in
.env
file.- Admin Panel: Navigate to
http://localhost:[ADMIN_PANEL_PORT]
to access the admin panel. - CMS API: The API will be available at
http://localhost:[CMS_API_PORT]
.
- Admin Panel: Navigate to
This section will guide you through deploying SonicMS using Nginx as a reverse proxy and setting up domain registration, SSL certificates, and exposing MinIO storage.
To deploy SonicMS behind an Nginx reverse proxy, follow these steps:
-
Install Nginx: On your server, install Nginx using the package manager appropriate for your operating system.
sudo apt update sudo apt install nginx
-
Configure Nginx: Create a new Nginx configuration file for SonicMS under
/etc/nginx/sites-available/sonicms.conf
:sudo nano /etc/nginx/sites-available/sonicms.conf
Add the following configuration to reverse proxy requests to the CMS API, Admin Panel, and MinIO storage:
server { listen 80; server_name yourdomain.com; # Replace with your actual domain name # Redirect all HTTP traffic to HTTPS return 301 https://$host$request_uri; } server { listen 443 ssl; server_name yourdomain.com; # Replace with your actual domain name # SSL Configuration ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem; # Generated by Certbot ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem; # Generated by Certbot # Proxy for CMS API location / { proxy_pass http://127.0.0.1:[CMS_API_PORT]; # Replace with the CMS API port from .env proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } # Proxy for Admin Panel location /admin/ { proxy_pass http://127.0.0.1:[ADMIN_PANEL_PORT]; # Replace with the Admin Panel port from .env proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } # Proxy for MinIO Storage upstream sonicms_storage { server 127.0.0.1:[MINIO_PORT]; # Replace with the Minio port from .env } location /storage/ { proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_connect_timeout 300; # Default is HTTP/1, keepalive is only enabled in HTTP/1.1 proxy_http_version 1.1; proxy_set_header Connection ""; chunked_transfer_encoding off; proxy_pass http://sonicms_storage; } }
-
Enable the Nginx Configuration: After configuring Nginx, enable the configuration by creating a symlink to the
sites-enabled
directory and restart Nginx:sudo ln -s /etc/nginx/sites-available/sonicms.conf /etc/nginx/sites-enabled/ sudo systemctl restart nginx
To link your server with a domain:
- Register a domain with any registrar (e.g. Cloudflare, Namecheap, GoDaddy, etc.).
- Update DNS settings to point to your server's IP address.
Once the DNS changes propagate, the domain will point to your server where SonicMS is running.
To secure your domain with SSL, use Let's Encrypt to install and manage SSL certificates:
-
Install Certbot:
sudo apt install certbot python3-certbot-nginx
-
Generate and Install SSL Certificates:
sudo certbot --nginx -d yourdomain.com
Certbot will automatically update your Nginx configuration to serve SonicMS securely via HTTPS. Make sure to stop nginx before using certbot.
MinIO handles object storage, and you’ll need to expose it via Nginx for media files. Assuming you have already set MinIO up in the docker-compose.yaml
, make sure MinIO is bound to the correct port (9000 by default).
-
MinIO URL Configuration: You can access MinIO via the URL
http://yourdomain.com/storage/
or set up a subdomain likestorage.yourdomain.com
for easier access. -
Customize the
.env
File to include the MinIO URL: Add this line to your.env
file:
MINIO_URL=http://yourdomain.com/storage/
Ensure you expose and customize the ports in the .env
file as needed for SonicMS components:
ADMIN_PANEL_PORT=3000
CMS_API_PORT=8080
MINIO_PORT=9000
Make sure these ports are available and not in conflict with other services on your server. For production, running everything behind Nginx with ports 80 (HTTP) and 443 (HTTPS) is recommended.
sonicms/
├── admin-panel/ # React Admin Panel
├── cms-api/ # CMS API Backend
├── database/ # ScyllaDB Setup
├── compose.yaml # Docker Compose File
├── .env # Environment Variables
├── .env.template # Template for Environment Variables
├── LICENSE # MIT LICENSE File
└── README.md # Project Documentation
We welcome contributions to SonicMS! Please feel free to submit pull requests, create issues, or suggest improvements.
This project is licensed under the MIT License - see the LICENSE file for details.