Skip to content

🚀 Getting Started

This guide walks you through setting up the LIPAIX project on your local machine. It's written for developers joining the project for the first time.

What you're setting up

The LIPAIX repository is a monorepo — a single repository containing multiple related applications:

  • apps/web — The public website + MyLipaix + backend API (all in one Next.js application)
  • apps/discord-bot — The Discord bot service
  • shared/common — Shared TypeScript code used by both apps
  • docs/vitepress — This documentation

In practice, you'll usually run just apps/web locally unless you're working on the bot.

Prerequisites

Before you start, install the following tools:

ToolMinimum versionWhat it's for
Node.js22+JavaScript runtime
pnpm9+Package manager (do not use npm or yarn)
GitAny recent versionVersion control
VS CodeRecommended editor

To verify your installations:

bash
node --version   # should print v22.x.x or higher
pnpm --version   # should print 9.x.x or higher
git --version

Getting the code

bash
git clone https://github.com/lipaix/lipaix-web-v3.git
cd lipaix-web-v3
pnpm install

pnpm install downloads all dependencies for all apps in the monorepo at once.

Environment variables

The apps need configuration values (database connection, API keys, etc.) that are stored in a .env.local file and never committed to git.

Get the .env.local file from a team administrator — don't try to create it from scratch. The file is shared privately within the team.

Place the file at apps/web/.env.local.

Key variables (web app)

VariableWhat it does
DATABASE_URIPostgreSQL connection string
PAYLOAD_SECRETSecret key for PayloadCMS session encryption
DISCORD_BOT_TOKENToken for the Discord bot (used by the web app for Discord login)
DISCORD_CLIENT_IDDiscord OAuth application ID
DISCORD_CLIENT_SECRETDiscord OAuth application secret
LIPAIX_API_TOKENInternal API token used by the Discord bot to call the web API
BASE_URLThe URL where the app runs (e.g., http://localhost:3000 locally)

Key variables (Discord bot)

For the Discord bot, create apps/discord-bot/.env.local (also get this from a team admin):

VariableWhat it does
DISCORD_BOT_TOKENThe bot's secret token
DISCORD_BOT_APP_IDThe bot's application ID
DISCORD_GUILD_IDThe Discord server (guild) ID where the bot operates
MYLIPAIX_BASE_URLThe URL of the web app (for API calls)
LIPAIX_DISCORD_ACTIONInternal action token
BILLETWEB_API_KEYBilletweb API key for the /tickets command
BILLETWEB_USERBilletweb user identifier

Running the web app

From the root of the repository:

bash
pnpm web:dev

This starts the Next.js development server. Once running:

  • Public website: http://localhost:3000
  • MyLipaix: http://localhost:3000/admin

The first time you run it, PayloadCMS will prompt you to create an initial admin user. Follow the on-screen instructions.

Running the Discord bot

In a separate terminal:

bash
pnpm discord:dev

The bot connects to Discord and starts listening for slash commands.

Registering slash commands

Slash commands (/dispos, /selecs, /tickets) need to be registered with Discord once before they appear in the server. Run:

bash
pnpm discord:commands:register

You only need to do this when commands are added or changed.

Running the documentation

bash
pnpm docs:dev

The documentation site runs at http://localhost:3001.

Database migrations

When the database schema changes (PayloadCMS collections are added or modified), you need to run migrations:

bash
pnpm web:db:migrate

Common issues

"Cannot find module" errors after pnpm install

Run pnpm build in shared/common first — the shared package must be built before the apps can use it:

bash
pnpm common:build

Database connection errors

Check that your DATABASE_URI in .env.local is correct and that the PostgreSQL database is reachable.

Discord bot doesn't respond to commands

Make sure commands are registered (pnpm discord:commands:register) and that the DISCORD_GUILD_ID matches the server you're testing in.

Released under the MIT License.