/prisma/schema.prisma
contains database schema. It's used by Prisma to generate database client./prisma/migrations
contains database migrations. They are used to update database. Do not edit them manually./src/client.js
contains database client. It's used by Majo.exe to interact with database. It also includes edge client for Prisma Data Proxy./src/redis.js
contains Redis client. It's used by Majo.exe to cache queries and data. It supports Redis and memory cache depending on configuration. It also includes functions to add, remove and get data from cache./src/seed.js
contains database seed. It's used to populate database with initial data like bot slash commands. It's executed bypnpm prisma:seed
orpnpm prisma:generate
command.
Important
Never share your .env
file with anyone. It contains sensitive data like database credentials, tokens and secrets. Leakage of this data can cause serious security issues.
Note
Before you start, make sure that you ran pnpm install
command in root directory of the project.
- Create new Neon account and create new PostgreSQL database.
- Create new file or edit existing
.env
file in root directory of the project - In
.env
file set these values:DATABASE_URL
- pooling database connection stringDATABASE_URL_UNPOOLED
- non-pooling database connection string
- Run
pnpm install
to install dependencies. - Run
pnpm prisma:migrate
to generate & apply initial migration. - Run
pnpm prisma:generate
to generate database client.
- Install Docker by following the instructions at https://docs.docker.com/get-docker/.
- Pull the PostgreSQL Docker image for version 15 (
docker pull postgres:15
) or use existing one. - Create a new container using the PostgreSQL image (
docker run --name majoexe -e POSTGRES_PASSWORD=postgres -p 5432:5432 -d postgres:15
) - Create new file or edit existing
.env
file in root directory of the project - In
.env
file set this values:DATABASE_URL=postgresql://postgres:postgres@localhost:5432/majoexe
DATABASE_URL_UNPOOLED=postgresql://postgres:postgres@localhost:5432/majoexe
- Run
pnpm install
to install dependencies. - Run
pnpm prisma:migrate
to generate & apply initial migration. - Run
pnpm prisma:generate
to generate database client.
Note
Majo.exe can also work with other databases like MongoDB and MySQL. You can find more information about it in Prisma documentation. If you want to use other database you have to change DATABASE_URL
in .env
file and change schema in /prisma/schema.prisma
file.
- Create new Redis Cloud account and create new Redis database.
- Create new file or edit existing
.env
file in root directory of the project - In
.env
file set this values:REDIS_URL
-ioredis
connection string (redis://[...]
) from Redis Cloud
- That's it! Majo.exe will automatically cache data in Redis Cloud.
- Install Docker by following the instructions at https://docs.docker.com/get-docker/.
- Pull the Redis Docker image (
docker pull redis
) or use existing one. - Create a new container using the Redis image (
docker run --name redis -p 6379:6379 -d redis
) - Create new file or edit existing
.env
file in root directory of the project - In
.env
file set these values:REDIS_URL
-ioredis
connection string (redis://localhost:6379
)
- That's it! Majo.exe will automatically cache data in Redis.
Note
If you do not set REDIS_URL
in .env
file Majo.exe will use memory cache instead of Redis. Memory cache is not persistent and will be cleared after restarting Majo.exe. Memory cache will consume more resources than Redis cache.
DATABASE_URL=DATABASE_URL
DATABASE_URL_UNPOOLED=DIRECT_DATABASE_URL
REDIS_URL=REDIS_URL
Warning
This file should be in root directory of the project. This file is super secret, better to not share it!
- @binary-blazer - Hosting support
- @TsukiyoDevs - Bug fixes, New features, Testing
- @r-kjha - Emoji config support, Bug fixes, New features, Testing
- @Joao-Victor-Liporini - Bug fixes, Command handler improvements, Testing, New features
- @evandev - Bug fixes, Testing
- @krzesl0 - New Features, Bug fixes, Testing
- @_index1337 - Readme tutorials
- @Wafelowski - Translation improvements
- @Sakshyam6966 - New Features, Bug fixes, Testing
These wonderful people and services have helped develop Majo.exe, without them this project would not exist. Thanks goes to these wonderful people!
Sponsor | Description | |
---|---|---|
TrestHost | TrestHost is a good and powerful hosting provider providing servers from the USA and Germany. Try us out today! |
If you have any issues with the bot please create new issue here. When creating a new issue please provide as much information as possible. If you can, please provide logs from console.
When submitting a pull request:
- Clone the repo.
- Create a branch off of
master
and give it a meaningful name (e.g.my-awesome-new-feature
). - Open a pull request on GitHub and describe the feature or fix.
We will review your pull request as soon as possible. We might suggest some changes or improvements.
This project is licensed under the MIT. See the LICENSE file for details