You can view a demo of the project here.
P.D: All punishments in the demo are randomly added to the database with a list of random premium player names as punished players, and with a predefined list of reasons.
- Node.js v20.x or higher
- Litebans working on MySQL, MariaDB or PostgreSQL
- Clone the repository with
git clone https://github.com/YoSoyVillaa/next-litebans.git - Install the dependencies with
npm install - Copy the
.env.examplefile to.envand fill in the required fields. For help check this - If you are using PostgreSQL, check PostgresSQL Configuration
- Config the website (configuration)
- Run
npm run setup:db:generateto generate the Prisma client - Run
npm run buildto build the project - Run
npm run startto start the server
You will need to set the DATABASE_URL environment variable in the .env file. If you don't know the URL template, you can check the following examples for both MySQL and PostgreSQL:
DATABASE_URL="mysql://user:password@host:port/database"DATABASE_URL="postgresql://user:password@host:port/database?schema=public"If you are using PostgreSQL, you need to delete all the models in the prisma/schema.prisma file and change the provider to postgresql, or replace the file content with:
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}Update the URL in the .env file with the PostgreSQL connection string.
Then, run npm run setup:db:pull to pull the database schema.
You can configure any website option on config/site.ts, such as the page title, icon, and more.
You can place the images in the public/ folder, then you can use them in the website with the / path. But, if you want to use an external link images, you will need to add the following config to the next.config.js file:
const nextConfig = {
images: {
remotePatterns: [
// One object for each domain
{
protocol: 'https',
hostname: 'domain.example',
}
]
}
};To configure the available languages, you can edit the config/site.ts file, modifying the languages object, then, you can edit existing translations in the language/ folder, or create new ones copying the existing ones and changing the values.
If your server allow Bedrock players through Geyser and/or Floodgate, you can enable the Bedrock compatibility mode in the config/site.ts file, setting the bedrock property to true. Then, configure the name prefix for Bedrock players, to replace the skins with the default Steve skin.
bedrock: {
enabled: true,
prefix: "BP_", // Prefix for Bedrock players
},Warning
If you are using a special character for your Bedrock players, such as *.+?^${}()|[\]\\, etc., you will need to enter src/utils/bedrock.ts, and change the line 13 to const bedrockPrefixRegex = new RegExp(`^\\${siteConfig.bedrock.prefix}`);, escaping the special character with a double backslash.
All configuration is passed at runtime. The container builds the app on first start, then launches the server.
docker run -d \
-p 3000:3000 \
-e DATABASE_URL="mysql://user:password@host:3306/litebans" \
-e SITE_URL="https://bans.example.com" \
-e SITE_TITLE="My Server Bans" \
ghcr.io/buildersrefuge/next-litebans:latestlitebans:
image: ghcr.io/buildersrefuge/next-litebans:latest
container_name: litebans
ports:
- 3000:3000
environment:
- DATABASE_URL=mysql://user:password@host:3306/litebans
- SITE_URL=https://bans.example.com
- SITE_TITLE=LiteBans| Variable | Default | Description |
|---|---|---|
DATABASE_URL |
— | Required. Database connection string (see Database URL) |
SITE_URL |
— | Required. Public URL of your site, e.g. https://bans.example.com |
SITE_TITLE |
Next Litebans |
Page title |
SITE_LOGO |
/logo.webp |
Logo path or URL |
SITE_FAVICON |
/logo.webp |
Favicon path or URL |
SITE_DEFAULT_LANGUAGE |
en |
Default language code |
SITE_DEFAULT_PLAYER |
YoSoyVilla |
Default player for the lookup field |
SITE_CONSOLE_NAME |
Console |
Console display name |
SITE_CONSOLE_UUID |
[Console] |
UUID string used to identify console punishments |
SITE_CONSOLE_ICON |
/console.webp |
Console icon image |
SITE_CONSOLE_BODY |
/console-body.webp |
Console body image |
SITE_CONSOLE_BUST |
/console-bust.webp |
Console bust image |
SITE_BEDROCK_ENABLED |
false |
Set to true to enable Bedrock compatibility |
SITE_BEDROCK_PREFIX |
BP_ |
Name prefix used by Bedrock players |
SITE_OG_DATE_FORMAT |
yyyy-MM-dd hh:mm:ss |
Date format in OpenGraph descriptions |


