Update README.md, add .env.template

This commit is contained in:
Hri7566 2024-03-11 11:25:00 -04:00
parent 6f201680d3
commit dcd3930be5
3 changed files with 40 additions and 6 deletions

8
.env.template Normal file
View File

@ -0,0 +1,8 @@
DATABASE_URL="postgresql://"
MPP_TOKEN_NET=""
MPP_FISHING_TOKEN=
DISCORD_TOKEN=
DISCORD_FISHING_TOKEN=
CLI_FISHING_TOKEN=

View File

@ -8,10 +8,35 @@ This project was created using `bun init` in bun v1.0.25. [Bun](https://bun.sh)
## Deployment ## Deployment
Setup the `.env` file like other projects, then: Firstly, a PostgreSQL database must be ready beforehand to connect to with a URI. This shoud be self-explanatory to setup.
Copy the default `.env` file:
```bash ```bash
bunx prisma db push cp .env.template .env
bun install ```
bun run src/index.ts
Edit that file to match your environment, then install packages:
```bash
bun install
bunx prisma db push
```
Run both the http server and the clients for various services separately with these commands:
```bash
bun . # Main http server
```
```bash
bun src/mpp/index.ts # MPP bot
```
```bash
bun src/discord/index.ts # Discord bot
```
```bash
bun src/cli/index.ts # Command-line client (for debugging)
``` ```

View File

@ -1,5 +1,3 @@
import "./api/server";
import "./cli/readline";
import { startFisherTick } from "./fish/fishers"; import { startFisherTick } from "./fish/fishers";
import { startObjectTimers } from "./fish/locations"; import { startObjectTimers } from "./fish/locations";
import { initTree } from "./fish/tree"; import { initTree } from "./fish/tree";
@ -9,3 +7,6 @@ startObjectTimers();
await startFisherTick(); await startFisherTick();
await initTree(); await initTree();
loadDefaultBehaviors(); loadDefaultBehaviors();
require("./api/server");
require("./cli/readline");