-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 1266965
Showing
31 changed files
with
3,030 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
node_modules | ||
dist | ||
|
||
.idea | ||
|
||
.env | ||
.env.example | ||
|
||
.git | ||
.gitignore | ||
|
||
.github | ||
.husky | ||
|
||
.eslintrc.cjs | ||
.eslintignore | ||
prettier.config.js | ||
|
||
.dockerignore | ||
Dockerfile | ||
compose.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
DISCORD_BOT_TOKEN= | ||
DISCORD_CLIENT_ID= | ||
TEST_GUILD_ID= | ||
DATABASE_URL= | ||
|
||
# Use only for Docker deployment. | ||
POSTGRES_USER= | ||
POSTGRES_PASSWORD= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module.exports = { | ||
parser: '@typescript-eslint/parser', | ||
plugins: ['@typescript-eslint'], | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:prettier/recommended', | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
version: 2 | ||
|
||
updates: | ||
- package-ecosystem: 'npm' | ||
directory: '/' | ||
schedule: | ||
interval: 'daily' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
node_modules | ||
dist | ||
|
||
.idea | ||
|
||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
pnpm prettier --write . | ||
pnpm eslint --fix . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
FROM node:20.5.0-bookworm-slim as builder | ||
|
||
WORKDIR /usr/src/app | ||
|
||
COPY . . | ||
|
||
# It's necessary for '@prisma/client' to work properly. | ||
RUN apt-get update --yes && apt-get install --yes openssl | ||
|
||
RUN npm install --global pnpm | ||
|
||
RUN pnpm install --frozen-lockfile | ||
RUN pnpm run build | ||
RUN pnpm prune --config.production --config.ignore-scripts=true | ||
|
||
RUN rm -R ./src ./tsconfig.json | ||
|
||
FROM node:20.5.0-bookworm-slim | ||
|
||
WORKDIR /usr/src/app | ||
|
||
# It's necessary for '@prisma/client' to work properly. | ||
RUN apt-get update --yes && apt-get install --yes openssl | ||
|
||
RUN npm install --global pnpm | ||
|
||
COPY --from=builder /usr/src/app . | ||
|
||
ENTRYPOINT ["pnpm", "run", "start:migrate"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: template | ||
|
||
services: | ||
database: | ||
image: postgres:15.4-alpine | ||
container_name: database | ||
restart: unless-stopped | ||
volumes: | ||
- postgresql-data:/var/lib/postgresql/data | ||
environment: | ||
POSTGRES_USER: ${POSTGRES_USER} | ||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} | ||
|
||
bot: | ||
build: . | ||
container_name: bot | ||
restart: unless-stopped | ||
depends_on: | ||
- database | ||
environment: | ||
DISCORD_BOT_TOKEN: ${DISCORD_BOT_TOKEN} | ||
DISCORD_CLIENT_ID: ${DISCORD_CLIENT_ID} | ||
TEST_GUILD_ID: ${TEST_GUILD_ID} | ||
DATABASE_URL: ${DATABASE_URL} | ||
|
||
volumes: | ||
postgresql-data: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{ | ||
"name": "d.js-template", | ||
"description": "A simple and easy to use template for Discord bots using the discord.js library.", | ||
"version": "0.1.0", | ||
"main": "dist/index.js", | ||
"scripts": { | ||
"start": "node dist/index.js", | ||
"start:migrate": "pnpm dlx prisma migrate deploy && pnpm run start", | ||
"watch": "concurrently \"tsc --watch\" \"node --require dotenv/config --watch dist/index.js | pnpm run prettify-logs\"", | ||
"build": "tsc", | ||
"prettify-logs": "pino-pretty --translateTime \"SYS:dd-mm-yyyy|HH:MM:ss\" --customLevels debug:10,information:20,error:30 --customColors debug:gray,information:blue,error:red", | ||
"register-application-commands": "node --require dotenv/config dist/register-application-commands.js", | ||
"prepare": "husky install" | ||
}, | ||
"author": "Jakub Bukała", | ||
"license": "MIT", | ||
"dependencies": { | ||
"@prisma/client": "5.2.0", | ||
"croner": "^7.0.1", | ||
"discord-api-types": "^0.37.56", | ||
"discord.js": "^14.12.1", | ||
"inquirer": "^9.2.10", | ||
"pino": "^8.15.0", | ||
"zod": "^3.22.1" | ||
}, | ||
"devDependencies": { | ||
"@types/inquirer": "^9.0.3", | ||
"@types/node": "20.5.9", | ||
"@typescript-eslint/eslint-plugin": "^6.5.0", | ||
"@typescript-eslint/parser": "^6.5.0", | ||
"concurrently": "^8.2.1", | ||
"dotenv": "^16.3.1", | ||
"eslint": "^8.48.0", | ||
"eslint-config-prettier": "^9.0.0", | ||
"eslint-plugin-prettier": "^5.0.0", | ||
"husky": "^8.0.3", | ||
"pino-pretty": "^10.2.0", | ||
"prettier": "^3.0.3", | ||
"prisma": "^5.2.0", | ||
"typescript": "^5.2.2" | ||
}, | ||
"type": "module", | ||
"packageManager": "[email protected]", | ||
"engines": { | ||
"node": ">=20.5.0" | ||
} | ||
} |
Oops, something went wrong.