https://github.com/lucamazzza/proxy
Client-Server middleware for distributed architectures using Appwrite as proxy
https://github.com/lucamazzza/proxy
appwrite appwrite-database baas backend-as-a-service client-server cpp middleware proxy qt
Last synced: 26 days ago
JSON representation
Client-Server middleware for distributed architectures using Appwrite as proxy
- Host: GitHub
- URL: https://github.com/lucamazzza/proxy
- Owner: lucamazzza
- Created: 2026-02-17T20:26:36.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2026-05-06T09:07:07.000Z (about 2 months ago)
- Last Synced: 2026-05-06T11:10:38.202Z (about 2 months ago)
- Topics: appwrite, appwrite-database, baas, backend-as-a-service, client-server, cpp, middleware, proxy, qt
- Language: C++
- Homepage:
- Size: 7.72 MB
- Stars: 0
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README

`proxy` is a Qt/C++ project centered on **appcomm**, a communication layer that lets clients exchange messages through Appwrite when direct network connectivity is restricted.
## What is appcomm
`appcomm` is the shared library in `appcomm/` used by both frontend and backend.
Its purpose is to provide a clean, Qt-native abstraction over Appwrite REST + Realtime for:
- authentication (guest and email session flows)
- topic/membership-based messaging
- real-time message delivery
- message querying, recovery, and basic delivery protections (rate limiting / state handling)
It is designed so UI or service code can consume high-level signals and methods instead of dealing with raw Appwrite request/event plumbing.
## How does it work
Clients authenticate against Appwrite and resolve their membership/topic context. Messages are stored as Appwrite documents, while realtime subscriptions notify connected clients of new events.
When events are received, appcomm extracts payloads, maps them to internal models, and emits Qt signals for application code. Recovery/query components are used to backfill missed data and keep message flow coherent after reconnects or transient issues.
On the server side, the backend app uses appcomm + bootstrap helpers to configure or reuse the Appwrite database/collections and expose operational commands for users, topics, sessions, members, and messages.
## How do i use it
### Build
Requirements: Qt 6 (Core, Network, WebSockets, Quick, QuickControls2, Qml), CMake >= 3.16, C++17 compiler.
```bash
git clone https://github.com/lucamazzza/proxy.git
cd proxy
cmake -B build -S . -DBUILD_TESTING=ON
cmake --build build --parallel
```
### Configure backend and run it
Backend writes config to `~/.proxy-backend-config.json` (or `PROXY_BACKEND_CONFIG_PATH` if set).
```bash
./build/backend/backend configure \
https:///v1 \
\
\
\
messages members topics sessions pendingmessages \
--guest-access false
```
```bash
./build/backend/backend start
```
### Run the frontend demo
Create the frontend config on the machine that runs the frontend.
You can set `PROXY_FRONTEND_CONFIG_PATH` to choose a different file, which is useful when running multiple frontend instances against different Appwrite projects.
```bash
./build/frontend/appfrontend configure \
https:///v1 \
\
\
messages members pendingmessages
```
By default this writes `~/.proxy-frontend-config.json`.
```json
{
"endpoint": "https://fra.cloud.appwrite.io/v1",
"projectId": "",
"databaseId": "",
"messagesCollectionId": "messages",
"membersCollectionId": "members",
"incomingMessagesCollectionId": "pendingmessages"
}
```
Then run:
```bash
./build/frontend/appfrontend
```
### Run tests
```bash
ctest --test-dir build/test --output-on-failure
```
`tst_appwritesdk` needs `APPWRITE_ENDPOINT`, `APPWRITE_PROJECT_ID`, and `APPWRITE_API_KEY`; if missing, that integration suite is skipped.
## What if something does not work
- **Build errors (Qt not found):** provide `-DCMAKE_PREFIX_PATH=/path/to/Qt/...` when configuring CMake.
- **Backend config issues:** verify `~/.proxy-backend-config.json` exists and has valid values, or set `PROXY_BACKEND_CONFIG_PATH`.
- **Auth/permission failures:** check Appwrite project ID, API key scopes, and collection/document permissions.
- **No realtime messages:** verify WebSocket connectivity and that topic/membership documents are correctly set for the user.
- **Frontend cannot connect:** verify `~/.proxy-frontend-config.json` exists and points to the intended endpoint/project/database/collection IDs, or set `PROXY_FRONTEND_CONFIG_PATH`.
## Credits
Developed as a SUPSI project by Luca Mazza and Manuela Mondini.
## License
Copyright (c) 2026 Luca Mazza, Manuela Mondini