Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
cf0c27e
refactor(gitignore): simpilified files affected by git
m0lc14kk Apr 16, 2026
ababefd
refactor(tsconfig): refactored rules of TypeScript
m0lc14kk Apr 16, 2026
3d56d60
refactor(package.json): refactored data inside `package.json`
m0lc14kk Apr 16, 2026
f46e81e
chore(prettier): added Prettier to repository
m0lc14kk Apr 16, 2026
fba4be1
chore(eslint): added ESLint to repository
m0lc14kk Apr 16, 2026
634dc08
chore(pre-commit): added Husky & lint-staged to repository
m0lc14kk Apr 16, 2026
19f4d4b
chore(husky): added more rulesets
m0lc14kk Apr 16, 2026
a458a22
style(prettier): formatted whole repository
m0lc14kk Apr 16, 2026
2b43a5f
feat(funding): added funding information
m0lc14kk Apr 16, 2026
5db57ff
chore(docker): Dockerised app
m0lc14kk Apr 16, 2026
ffb83ec
feat(hadolint): added configuration for Dockerfile's linter (Hadolint)
m0lc14kk Apr 16, 2026
b218802
feat(dependabot): added Dependabot to repository
m0lc14kk Apr 16, 2026
270a902
feat(services->docker): added PostgreSQL to Docker's services
m0lc14kk Apr 24, 2026
271dcf3
feat(services->redis): added Redis to Docker's services
m0lc14kk Apr 24, 2026
2e7a79b
feat(ci): added CI workflow
m0lc14kk Apr 24, 2026
19d4d95
feat(tests): added an example test
m0lc14kk Apr 24, 2026
f1c899a
feat(src): clean up
m0lc14kk Apr 24, 2026
04b918c
feat(app): added sample app entrypoint
m0lc14kk Apr 24, 2026
489d8fb
fix(tsconfig): adjusted paths
m0lc14kk Apr 24, 2026
cd988c1
fix(tsconfig): removed an option that's covered already by ESLint
m0lc14kk Apr 24, 2026
cf5fa3b
feat(clients->redis): added Redis client
m0lc14kk Apr 24, 2026
1a228d7
feat(database->orm): added DrizzleORM
m0lc14kk Apr 24, 2026
66daea4
feat(clients->db): added client for database connection
m0lc14kk Apr 24, 2026
e6e3919
feat(schema): added schema related to plugins
m0lc14kk Apr 24, 2026
fb2ac15
feat(models): added base database service & plugins
m0lc14kk Apr 24, 2026
7cbbc1c
feat(services->db): implemented a service to manage plugins in a data…
m0lc14kk Apr 24, 2026
67897d2
feat(scripts->db): added scripts for DrizzleORM
m0lc14kk Apr 24, 2026
e6f16a9
fix(package.json): fixed URL to match a real one
m0lc14kk Apr 24, 2026
d3709a4
feat(clients->discord): added Discord client
m0lc14kk Apr 24, 2026
8c64284
fix(ci): fixed script casing
m0lc14kk Apr 24, 2026
3b0c72e
feat(routes): added plugin routes
m0lc14kk Apr 29, 2026
32d07ab
Fix typo in pluginsTable name
AnyBananaGAME Apr 29, 2026
6fb5599
chore(gitignore): removed temp directory
m0lc14kk Apr 29, 2026
af6aac5
fix(ci): fixed CI test step
m0lc14kk Apr 29, 2026
344ea3b
feat(tests): extended an example test
m0lc14kk Apr 29, 2026
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
34 changes: 34 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Options related to the application.
# Port of the application.
APP_PORT=3000

# Options related to the Discord bot.
# Token of the Discord bot.
DISCORD_TOKEN=
# Optional. Channel ID for plugin approval messages (defaults to the Serenity server channel used before).
# DISCORD_PLUGIN_APPROVAL_CHANNEL_ID=

# Options related to the database engine.
# URL end-point of the database engine.
# Format: postgresql://<user>:<password>@<host>:<port>/<database>
DATABASE_URL=postgresql://serenityjs:serenityjs@localhost:5432/serenityjs
# Variables below are used by the database engine in Docker compose file.
# User of the database engine.
DATABASE_ENGINE_USER=serenityjs
# Password of the database engine.
DATABASE_ENGINE_PASSWORD=serenityjs
# Name of the database engine.
DATABASE_ENGINE_NAME=serenityjs
# Port of the database engine.
DATABASE_ENGINE_PORT=5432

# Options related to the cache engine.
# Whether the cache engine is enabled.
CACHE_ENGINE_ENABLED=true
# This end-point is only required if the cache engine is enabled.
# URL end-point of the cache engine.
# Format: redis://<host>:<port>
CACHE_ENGINE_URL=redis://localhost:6379
# Variables below are used by the cache engine in Docker compose file.
# Port of the cache engine.
CACHE_ENGINE_PORT=6379
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
github: SerenityJS
34 changes: 34 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
version: 2
updates:
- package-ecosystem: "bun"
directory: "/"
target-branch: "development"
schedule:
# Libraries do not have to be updated as often as the code itself.
timezone: "Europe/Warsaw"
interval: "semiannually"
commit-message:
prefix: "chore(deps->root):"
# It disables all labels except the dedicated "dependencies" label.
labels: ["🔄 dependencies"]

- package-ecosystem: "github-actions"
directory: "./github/workflows"
target-branch: "development"
schedule:
timezone: "Europe/Warsaw"
interval: "semiannually"
commit-message:
prefix: "chore(actions->github):"
labels: ["🔄 dependencies"]

- package-ecosystem: "docker"
directory: "/"
target-branch: "development"
schedule:
timezone: "Europe/Warsaw"
interval: "semiannually"
commit-message:
prefix: "chore(backend->docker):"
labels: ["🔄 dependencies"]
51 changes: 51 additions & 0 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Validate REST API service's codebase.

on:
push:
pull_request:

permissions:
contents: read

defaults:
run:
shell: bash

jobs:
validate-code:
name: Validate codebase.
runs-on: ubuntu-latest
env:
NODE_ENV: CI

steps:
- name: Checkout repository.
uses: actions/checkout@v6

- name: Set up Bun.
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Install dependencies.
run: bun install --frozen-lockfile

- name: Lint codebase using ESLint.
run: bun run lint

- name: Lint Dockerfile using Hadolint.
uses: hadolint/hadolint-action@v3.3.0
with:
dockerfile: Dockerfile

- name: Check types using TypeScript.
run: bunx tsc --noEmit

- name: Check formatting of all files using Prettier.
run: bun run format:check

- name: Run tests.
run: bun test

- name: Build a production-ready application.
run: bun run build
168 changes: 27 additions & 141 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,141 +1,27 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

plugins.db

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.*
!.env.example

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Sveltekit cache directory
.svelte-kit/

# vitepress build output
**/.vitepress/dist

# vitepress cache directory
**/.vitepress/cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# Firebase cache directory
.firebase/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v3
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# Vite logs files
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
# IDE files.
/.idea/
/.vscode/
/.vscode-test/
/.vs/
/.cursor/

# Dependency directories.
/node_modules/
/jspm_packages/
/web_modules/
# And NPM's cache directory.
/npm-cache/
/.npm/

# Distribution files & directories.
/dist/
/build/
/**/*.tsbuildinfo

# Environment variables.
/**/*.env*
!/.env.example

# Operating system files.
/**/.DS_Store
/**/*.ini
17 changes: 17 additions & 0 deletions .hadolint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# It enforces the use of labels in every single Dockerfile.
strict-labels: true
# Labels that must be provided in every single Dockerfile.
label-schema:
org.opencontainers.image.title: text
org.opencontainers.image.description: text
org.opencontainers.image.version: semver
org.opencontainers.image.authors: text
org.opencontainers.image.licenses: spdx
org.opencontainers.image.url: url
org.opencontainers.image.documentation: url
org.opencontainers.image.source: url
# Overrides the default severity of the rules.
override:
info:
# This error is a warning related to pinning the version of a package.
- DL3008
13 changes: 13 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
# This script validates commits' message to make sure that they're
# correct with Conventional Commits standard.

message="$(sed -n '1p' "$1")"

if printf "%s" "$message" | grep -Eq '^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\(.+\))?!?: .+'; then
exit 0
fi

echo "Invalid commit message format."
echo "Use Conventional Commits, for example: feat(pages): improved login page's design"
exit 1
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
# This file is being executed every single time before you commit via git.

bunx lint-staged
6 changes: 6 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
# This file is being executed every single time before you push
# via git to GitHub repository.

bun run format:check
bun run lint:fix
26 changes: 26 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# IDE files.
/.idea/
/.vscode/
/.vscode-test/
/.vs/
/.cursor/

# Dependency directories.
/node_modules/
/jspm_packages/
/web_modules/
# And NPM's cache directory.
/npm-cache/
/.npm/

# Distribution files & directories.
/dist/
/build/
/**/*.tsbuildinfo

# Migration files.
/drizzle/

# Environment variables.
/**/*.env*
!/.env.example
26 changes: 26 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"useTabs": false,
"tabWidth": 4,
"printWidth": 120,
"singleQuote": false,
"trailingComma": "all",
"arrowParens": "always",
"semi": false,
"bracketSpacing": true,
"endOfLine": "auto",
"overrides": [
{
"files": "**/*.{json,jsonc}",
"options": {
"printWidth": 80,
"trailingComma": "none"
}
},
{
"files": "**/*.{yaml,yml}",
"options": {
"printWidth": 80
}
}
]
}
Loading