8.1 KiB
XMRChat
A Complete SaaS for Online Tipping Solution on Monero Cryptocurrency Network (XMR).
Overview
XMRChat is a tip-for-chat application. Users can set up a page and have others send chat messages in exchange for XMR. The application is built with a focus on privacy and security.
Table of Contents 🤸
-
Business Strategy
Technology Stack 🚀
-
Client Side:
- Framework: Nuxt Js - Vue Js
- Language: TypeScript
-
Server Side:
- Framework: Nest Js
- Language: TypeScript
- Cache: Redis
- ORM: TypeORM
- Database: PostgreSQL
- Queues: BullMQ
-
Infrastructure:
-
Payment Providers:
- Monero:
- Monero Project
- Wallet Server : monero-lws
- Monero:
Business Strategy: Payment
The service uses a one-time payment strategy. During the deployment setup process, you will need to provide your Monero wallet address and set the service price. After clients register, they will configure their page by specifying details such as name and unique URL path. Once the service price is paid, their page is now public, and they can share their page links with their audience to receive tips.
Requirements 📝
- Docker 🐳
- Monero-lws Instance
- A Monero Wallet
Project Structure 📍
- Server: Contains the backend code ( Nest JS ).
- Client: Contains the frontend code ( Nuxt JS ).
- Traefik: Contains Traefik setups
Install & Build 🛠️
1. Traefik
First of all you must create network that containers communicate over it.
docker network create traefik
then setup the env
cd traefik
cp .env.example .env
Now change the .env with yours and run the container.
Warning
The password must be Hashed in the env and also if you add that in compose file the "$" characters must be doubled to not recognized as variable by docker engine.
docker compose up -d
2.1. Monero
Create and run a monero node. If you already have a synced node with zmq enabled skip to next step.
In monero directory clone the monero github repo to a folder called monero-node:
cd monero
git clone https://github.com/monero-project/monero.git monero-node
The cloned repo has a Dockerfile in the root directory. In last line of Dockerfile comment out CMD command.
# CMD ["--p2p-bind ...
2.2 Monero-LWS
In monero directory clone monero-lws repository on branch release-v0.3_0.18:
git clone -b release-v0.3_0.18 https://github.com/vtnerd/monero-lws
From last line of Dockerfile remove ENTRYPOINT and CMD and replace it with only ENTRYPOINT ["monero-lws-daemon"]
Final Dockerfile will be ending like this:
...
EXPOSE 8443
ENTRYPOINT ["monero-lws-daemon"]
2.3. Run Monero and Monero-LWS
The directories after following the steps would look like this.
└── xmrchat/
├── client
├── monero/
│ ├── monero-node/
│ ├── monero-lws/
│ └── docker-compose.yml
├── server
└── traefik
In /xmrchat/monero directory run the containers:
docker compose up -d
Because the Monero daemon must sync with the network, it may take a long time. You can monitor this process by checking the logs:
docker compose logs -f
You should make sure it is synced and ready, in the meantime you can go to next steps.
3. Server
Go to /xmrchat/server directory and create your .env file from .env.example.
cp .env.example .env
Open the .env file and change the values with yours. the variables have descriptions on how to set them.
Then run the containers:
docker compose up -d
Then we need to run the migrations:
docker compose exec -it nest npm run migration:run
Notifications and integrations
In order to use notifications like SimpleX or Signal you need to set up the integrations. If you don't need them skip to next step.
- Email: Email notifications already uses the env variables for sending emails.
- SimpleX:
Simplex is automatically set up when running the server docker compose. The data from container will be in
/server/simplexdirectory. - Signal:
In order to use Signal notifications you need to have a Signal account. Open server url in a browser or send a get request to
/signal/qrcode( Example:https://server.xmrchat.com/signal/qrcode). It will give you a qr code if there is not a signal account already added. Open Signal app on your phone and navigate to settings -> Linked devices and add new device. Scan then qr code you got from the server.
4. Client
Go to /xmrchat/client directory and create your .env file from .env.example.
cp .env.example .env
Change .env file with yours.
Run the container
docker compose up -d
The website should be up on the value set on /client/.env -> DOMAIN_NAME.
BullMQ is used for background tasks. BullBoard is used for monitoring the queues and can be accessed on server domain ${DOMAIN_NAME}/queues with credencials set on server envs BULLBOARD_USERNAME and BULLBOARD_PASSWORD.
Development
For development you might not need monero or monero-lws if you don't make tips or create new pages ( any payments related to monero ). If you need lws instance access or can't run yours please contact us.
Server
Add your .env file based on .env.example.
Run backend locally with docker-compose.dev.yml file
docker compose -f docker-compose.dev.yml up -d
Then run the Nest project itself use node version more than 20.x.x
npm i
npm run start:dev
Client
Add your .env based on .env.example, then run the project:
npm i
npm run dev
Testing 🔬
For detailed testing instructions, see TESTING.md.
Client tests live in client/ and can be run with:
cd client
npx playwright test
We also provide a GitHub Actions workflow to SSH into your server, spin up containers, run migrations, and execute Playwright tests. See TESTING.md for more information.
Troubleshooting
For detailed troubleshooting instructions, see TROUBLESHOOTING.md.
License
This project is licensed under the Apache License 2.0. For the full license text, please see the LICENSE file in the root of this repository.
Notice
A NOTICE file has been included in the root of this repository. This file contains acknowledgments and notices required by the Apache License 2.0.
Pursuant to the terms of the Apache License 2.0, the NOTICE file must be included in redistributions of this software.