Testing & Implementation Plan
This document outlines a clear plan for testing the full request flow of HASSAR.AI — from the user's browser, through Cloudflare and the firewall/VPN, to the Agentic Controller (AGIM), and back to the customer with a response.
The goal is to confirm that every layer of the chain is connected, secured, and performing correctly before handoff.
Each layer must be verified independently, then verified as a complete end-to-end chain.
Before testing begins, confirm the following are in place:
| Item | Who Provides | Status |
|---|---|---|
| HASSAR.AI app accessible at production URL | Vlass Studio | Done — live at hassar.ai |
| Backend installed and running on ACAIEAC's server | ACAIEAC | See Backend Installation below |
| Firewall rules configured for AGIM access | ACAIEAC / Network team | |
| VPN credentials / access for testing (if needed) | ACAIEAC | |
| AGIM endpoint URL and API key active | ACAIEAC | |
| Admin account for HASSAR.AI | Vlass Studio | |
| Test user account for HASSAR.AI | Tester |
The backend (FastAPI + PostgreSQL) needs to be installed and running on your own server before Layers 2–4 below can be tested. Full step-by-step instructions are in DEPLOYMENT.html ("Part 2 — Backend: Client Server") — this is the condensed version.
- Get repo access — you're added as a collaborator on the private repo
VlassStudio/HassarAI. Clone with a Personal Access Token as the password (or over SSH, or viagh repo clone VlassStudio/HassarAIif using the GitHub CLI):git clone https://github.com/VlassStudio/HassarAI.git cd HassarAI/backend - Set up the Python environment and PostgreSQL database — see DEPLOYMENT.html Steps 05–06.
- Create
.envwithDATABASE_URL, a generatedJWT_SECRET_KEY, andAPP_ENV=production— see DEPLOYMENT.html Step 07. - Test run directly (
uvicorn app.main:app --host 127.0.0.1 --port 8000), confirmhttp://localhost:8000returns{"ok": true}before wiring up systemd. - Set up systemd + Nginx + Certbot so the backend runs as a service at
https://api.hassar.ai— see DEPLOYMENT.html Steps 08–10. - Verify with
curl https://api.hassar.ai/— expect{"ok": true}.
Once this is done, NEXT_PUBLIC_API_URL on the frontend can be pointed at https://api.hassar.ai instead of the current Railway testing backend — that's a one-line config change on Vlass Studio's side, no redeploy of the backend needed on your end.
- Open a browser and navigate to the production HASSAR.AI URL.
- Check the padlock icon in the browser address bar.
- Click the padlock → verify the certificate is valid, issued by Cloudflare or a trusted CA.
- Run a DNS lookup on the production domain:
nslookup yourdomain.com(Windows) ordig yourdomain.com(Mac/Linux) - Check the returned IP address.
104.x.x.x or 172.x.x.x), not the origin server IP directly. This confirms Cloudflare is proxying traffic.
- Navigate to the HASSAR.AI login page.
- Log in with a valid test account.
- Obtain the origin server IP (provided by Vlass Studio separately — do not publish).
- Attempt to reach the backend API directly via IP:
http://<origin-ip>:8000/
- In a browser or via curl, access the root endpoint through the production API domain:
GET https://api.hassar.ai/
{"ok": true}
HTTP 200. This confirms Cloudflare → Firewall → Backend is connected.
If AGIM is behind a VPN:
- Connect to the VPN using the provided credentials.
- Confirm VPN connection is active (VPN client shows connected).
- Ping or reach the AGIM internal endpoint from inside the VPN.
Can be run from anywhere that can reach the AGIM endpoint (SSH into the production server, or your own machine if AGIM is already publicly reachable via Cloudflare Tunnel):
curl -X POST <AGIM_URL> \
-H "Content-Type: application/json" \
-d '{"message": "Hello, this is a connectivity test.", "blueprint": ""}'
Only add -H "Authorization: Bearer <AGIM_API_KEY>" if AGIM requires a key — the current setup does not.
{"response": "..."} or {"content": "..."}). HTTP 200. If this fails, the firewall, VPN, or Cloudflare Tunnel is blocking the connection.
- Log in to HASSAR.AI as admin.
- Navigate to System Admin → AI Config.
- Verify the AGIM URL and API Key fields are populated correctly.
- Click Save Configuration.
- Log in to HASSAR.AI as a test user.
- Navigate to Talk to Jim.
- Type: What is the best smart home protocol for a large property?
- Press Send.
- Observe the chat — Jim should show a loading indicator, then display a response.
Verifies AGIM receives and reasons over structured data, not just a plain question.
- In the Talk to Jim page, upload an encrypted blueprint file (a
.hassarfile created via My IoT Blueprint). - Enter the blueprint passphrase when prompted.
- Confirm Jim acknowledges the blueprint is loaded.
- Ask: Based on my setup, what security improvements would you recommend?
Verifies the system degrades gracefully if AGIM is unreachable.
- In System Admin → AI Config, temporarily set the AGIM URL to an invalid address (e.g.
http://invalid-agim-test). - Click Save.
- Go to Talk to Jim and send a message.
- Restore the correct AGIM URL and save.
| # | Test | Layer | Result |
|---|---|---|---|
| 1.1 | HTTPS & SSL certificate valid | App → Cloudflare | |
| 1.2 | Cloudflare proxy active (IP check) | App → Cloudflare | |
| 1.3 | Login works through Cloudflare | App → Cloudflare | |
| 2.1 | Direct origin access blocked | Cloudflare → Firewall | |
| 2.2 | Backend health check via Cloudflare | Cloudflare → Firewall → Backend | |
| 2.3 | VPN connectivity (if applicable) | Firewall → VPN | |
| 3.1 | AGIM reachable from backend (curl test) | Firewall → AGIM | |
| 3.2 | AGIM config set correctly in admin panel | Backend → AGIM | |
| 4.1 | AI response round-trip (basic question) | Full chain | |
| 4.2 | Blueprint-contextual AI response | Full chain | |
| 4.3 | Graceful fallback to Ollama if AGIM fails | Full chain |
For any test that does not pass, please provide:
- Which test failed (e.g. "Test 2.2 — Health Check")
- What happened (e.g. "Got HTTP 502", "No response", "Error message in chat")
- Screenshot or error message if available
- Network / environment details (on VPN or not, which browser, location)