Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
176 changes: 141 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,19 @@ XMRChat is a tip-for-chat application. Users can set up a page and have others s
- [Server](#server)
- [Client](#client)

- [Development](#development)

## <a name="tech-stack">Technology Stack 🚀</a>

- **Client Side:**
- **Framework:** [Nuxt Js](https://nuxt.com/) - [Vue Js](https://vuejs.org/)
- **Language:** [TypeScript](https://www.typescriptlang.org/)
- **Server Side:**

- **Framework:** [Elysia Js](https://elysiajs.com/)
- **Framework:** [Nest Js](https://nestjs.com/)
- **Language:** [TypeScript](https://www.typescriptlang.org/)
- **Runtime:** [Bun](https://bun.sh)
- **Cache:** [Redis](https://redis.io/)
- **ORM:** [Kysely](https://kysely.dev/)
- **ORM:** [TypeORM](https://typeorm.io/)
- **Database:** [PostgreSQL](https://www.postgresql.org/)

- **Infrastructure:**
Expand All @@ -50,7 +51,7 @@ XMRChat is a tip-for-chat application. Users can set up a page and have others s

- **Payment Providers:**
- **Monero:**
- [Monero Project](https://www.docker.com/)
- [Monero Project](https://www.getmonero.com/)
- wallet Server : [monero-lws](https://github.com/vtnerd/monero-lws)

## Business Strategy: <a name="payment-strategy">Payment</a>
Expand All @@ -60,24 +61,13 @@ The service uses a one-time payment strategy. During the deployment setup proces
## <a name="requirements">Requirements 📝</a>

- [Docker 🐳](https://docs.docker.com/engine/install/)
- [git](https://git-scm.com/downloads)
- [Monero wallet](https://www.getmonero.org/downloads/#gui)
- [Monero-lws Instance](https://github.com/vtnerd/monero-lws)
- A Monero Wallet

## <a name="structure">Project Structure 📍</a>

- [Server](./server/): Contains the backend code.

- [db](./server/src/db/): Contains the database connection and migration files.
- [routes](./server/src/routes/): Contains the route handlers.
- [schemas](./server/src/schemas/): Contains the route schemas definitions for validation.
- [services](./server/src/services/): Contains the service classes.
- [types](./server/src/types/): Contains type definitions.
- [utils](./server/src/utils/): Contains utility functions.
- [env.ts](./server/src/env.ts): Contains the environment variables and their default values.
- [index.ts](./server/src/index.ts): The entrypoint file for the backend.

- [Client](./client/): Contains the frontend code.
- [Monero](./monero/): Contains Monero network services (Monero Project & Monero-LWS).
- [Server](./server/): Contains the backend code ( Nest JS ).
- [Client](./client/): Contains the frontend code ( Nuxt JS ).
- [Traefik](./traefik/): Contains Traefik setups

## <a name="install-and-build">Install & Build 🛠️</a>
Expand All @@ -103,26 +93,116 @@ Now change the .env with yours and run the container.
> 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.

```console
docker compose up
docker compose up -d
```

### <a name="monero">2. Monero</a>
### <a name="monero">2.1. Monero</a>

You can use Make file by below command in Monero directory to get and config Monero related repositories.
Create and run a monero node. If you already have a synced node with zmq enabled skip to next step.

```console
cp monero
make monero-setup
mkdir monero && cd monero
git clone https://github.com/monero-project/monero.git
```

or:
In last line of Dockerfile comment out CMD Command.

```
# CMD ["--p2p-bind ...
```

### <a name="monero-lws">2.2 Monero-LWS</a>

Clone Monero-lws repository on branch `release-v0.3_0.18`:

```console
cp monero
git clone https://github.com/monero-project/monero.git
git clone https://github.com/vtnerd/monero-lws/tree/release-v0.3_0.18
cp Dockerfile.monero ./monero/Dockerfile
cp Dockerfile.lws ./monero-lws/Dockerfile
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:

```console
...
EXPOSE 8443

ENTRYPOINT ["monero-lws-daemon"]
```

### <a name="monero-lws">2.3. Run Monero and Monero-LWS</a>

Add following `docker-compose.yml` to /monero directory we created on step 2.1 considering monero project ( step 2.1 ) is inside `./monero/monero` folder and monero lws ( step 2.2 ) is on `./monero/monero-lws` directory

```yml
services:
monero:
container_name: monero
build:
context: ./monero
restart: always
user: root
ports:
# - :80
- :18080
- :18081
- :18082
- :18083
- :18084
command:
- --p2p-bind-ip=0.0.0.0
- --p2p-bind-port=18080
- --rpc-bind-ip=0.0.0.0
- --rpc-bind-port=18081
- --non-interactive
- --rpc-ssl=disabled
- --rpc-access-control-origins=monero
- --disable-rpc-ban
- --confirm-external-bind
- --zmq-pub=tcp://0.0.0.0:18084
- --zmq-rpc-bind-port=1882
- --zmq-rpc-bind-ip=0.0.0.0

volumes:
- bitmonero:/root/.bitmonero
networks:
- traefik

lws:
depends_on:
- monero
container_name: lws
user: root
build:
context: ./monero-lws
restart: always
ports:
# - :80
- :8443
command:
- --db-path=/home/monero-lws/.bitmonero/light_wallet_server
- --daemon=tcp://monero:1882
- --sub=tcp://monero:18084
- --log-level=4
- --webhook-ssl-verification=none
- --disable-admin-auth
- --admin-rest-server=http://0.0.0.0:8443/admin
- --rest-server=http://0.0.0.0:8443/basic
- --access-control-origin=lws:8443
- --confirm-external-bind
volumes:
- monerolws:/home/monero-lws
networks:
- traefik

volumes:
bitmonero: {}
monerolws: {}

networks:
traefik:
name: traefik
external: true
```

Run the container :
Expand All @@ -143,7 +223,7 @@ After it is synced and ready, go next.

```console
cd server
cp .env.example
cp .env.example .env
```

Change .env file with yours.
Expand All @@ -156,18 +236,44 @@ docker compose up -d

```console
cd client
cp .env.example
cp .env.example .env
```

Change .env file with yours. and also change the env at the end of "Dockerfile" file.
Change .env file with yours.

```console
docker compose up -d
```

## Notes
## <a name="development">Development</a>

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

```console
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
```

See [NOTES.md](./NOTES.md) for additional notes and information about the technical details of the project.
### Client

Add your .env based on .env.example, then run the project:

```
npm i
npm run dev
```

## License

Expand Down
3 changes: 2 additions & 1 deletion client/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ DOMAIN_NAME=xmrchat.com
NUXT_PUBLIC_API_BASE_URL=https://api.xmrchat.com/api
NUXT_PUBLIC_API_SERVER_SIDE_BASE_URL=http://backend:3000/api
NUXT_PUBLIC_DEVTOOLS_ENABLED=false
PORT=3000
NUXT_PUBLIC_IMAGE_BASE_URL= # base url from minio
PORT=3001
HOST=127.0.0.1
5 changes: 0 additions & 5 deletions client/.vscode/settings.json

This file was deleted.

30 changes: 11 additions & 19 deletions client/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,18 @@
# Dockerfile
FROM node:lts-alpine3.19 AS builder

# create destination directory
RUN mkdir -p /usr/src/nuxt-app
WORKDIR /usr/src/nuxt-app

# update and install dependency
RUN apk update && apk upgrade
RUN apk add git

# copy the app, note .dockerignore
COPY . /usr/src/nuxt-app/
COPY .env.example /usr/src/nuxt-app/.env
RUN npm install --No
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build

EXPOSE 3000

ENV DOMAIN_NAME=xmrchat.com
ENV NUXT_PUBLIC_API_BASE_URL=https://api.xmrchat.com/api
ENV NUXT_PUBLIC_API_SERVER_SIDE_BASE_URL=http://backend:3000/api
ENV PORT=3000
ENV HOST=0.0.0.0
CMD [ "node", "/usr/src/nuxt-app/.output/server/index.mjs" ]
FROM node:lts-alpine3.19
WORKDIR /app
COPY --from=builder /app/.output /app/.output
COPY package*.json ./
RUN npm install

EXPOSE 3000
CMD ["node", ".output/server/index.mjs"]
5 changes: 3 additions & 2 deletions client/app.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<script setup lang="ts">
useHead(() => {
return {
titleTemplate: (title) => (title ? `${title} | XMRChat` : "XMRChat"),
titleTemplate: (title) =>
title ? `${title} | XMRChat` : "Monero Superchats : XMRChat",
};
});

Expand All @@ -19,6 +20,6 @@ useAppSeoMeta();

<style>
.app {
@apply text-text bg-background;
@apply text-text;
}
</style>
16 changes: 12 additions & 4 deletions client/components/Home/HomeFAQ.vue
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,15 @@ const linkProps = { padded: false, target: "_blank", variant: "link" } as any; /
<ul class="list">
<li>
<p>
If you already have crypto, trade for Monero (XMR) at
Buy or trade other crypto for Monero in
<UButton to="https://cakewallet.com" v-bind="linkProps">
Cake Wallet</UButton
>.
</p>
</li>
<li>
<p>
Trade other crypto for Monero (XMR) at
<UButton to="https://stealthex.io" v-bind="linkProps">
stealthex.io</UButton
>
Expand Down Expand Up @@ -224,9 +232,9 @@ const linkProps = { padded: false, target: "_blank", variant: "link" } as any; /
</li>
<li>
<p>
Buy Monero with fiat, without KYC as an Executor at
<UButton to="https://monezon.com" v-bind="linkProps">
monezon.com </UButton
Create a Monero Fundraiser at
<UButton to="https://kuno.anne.media/" v-bind="linkProps">
kuno.anne.media </UButton
>.
</p>
</li>
Expand Down
4 changes: 2 additions & 2 deletions client/components/Home/HomeHero.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ const { toStreamerDisplay } = useRouteLocation();
<div class="home-hero">
<div class="image-side">
<img
class="w-full rounded-md overflow-hidden"
src="/images/home-hero-2.jpg"
class="w-full rounded-md overflow-hidden border-border border-2"
src="/images/home-hero-3.png"
alt=""
/>
</div>
Expand Down
Loading