No description
  • TypeScript 79.4%
  • CSS 20%
  • Dockerfile 0.4%
  • JavaScript 0.2%
Find a file
2026-06-01 11:51:35 +02:00
docs fix: standardize dash usage in documentation and code comments 2026-03-20 22:34:49 +01:00
public feat: rewrite entire stack in Next.js + TypeScript + discord.js 2026-02-16 00:35:11 +01:00
src Revert "feat: add /api/me/gpa endpoint" 2026-06-01 11:51:35 +02:00
.dockerignore chore: allow .env in docker build and suppress build-time warnings 2026-02-16 11:58:16 +01:00
.env.example fix: derive cookie Secure flag from URL scheme instead of NODE_ENV 2026-02-16 08:47:29 +01:00
.gitignore feat: rewrite entire stack in Next.js + TypeScript + discord.js 2026-02-16 00:35:11 +01:00
bun.lock fix: build better-sqlite3 in Node stage to fix glibc mismatch 2026-02-16 01:44:28 +01:00
docker-compose.yml fix: ensure environment variables from Portainer are passed to containers 2026-02-16 11:42:25 +01:00
Dockerfile feat: simplify dockerfile 2026-02-16 10:45:26 +01:00
Dockerfile.bot fix: restore build tools to Dockerfile.bot 2026-02-16 10:54:29 +01:00
drizzle.config.ts feat: rewrite entire stack in Next.js + TypeScript + discord.js 2026-02-16 00:35:11 +01:00
eslint.config.mjs feat: rewrite entire stack in Next.js + TypeScript + discord.js 2026-02-16 00:35:11 +01:00
LICENSE chore: add LICENSE 2026-02-15 19:17:24 +01:00
next.config.ts feat: rewrite entire stack in Next.js + TypeScript + discord.js 2026-02-16 00:35:11 +01:00
package.json fix: load environment variables in dev:web to respect PORT configuration 2026-02-16 10:43:53 +01:00
postcss.config.mjs feat: rewrite entire stack in Next.js + TypeScript + discord.js 2026-02-16 00:35:11 +01:00
README.md fix: standardize dash usage in documentation and code comments 2026-03-20 22:34:49 +01:00
tsconfig.json feat: rewrite entire stack in Next.js + TypeScript + discord.js 2026-02-16 00:35:11 +01:00

Moulinette Logo

Epitech Moulinette Discord Notifier

A powerful Discord bot and web dashboard to monitor Epitech's Moulinette (automated test system) for new results. Built with Next.js 16 (Turbopack) and Bun, it provides a modern, fast, and secure way to track your project results.

Features

  • Automated Notifications: Sends rich embeds to Discord whenever a new result is published.
  • Modern Dashboard: Manage your Microsoft cookies and server-wide settings with a beautiful Discord-style UI.
  • Server Icon Status: Visual indicators (green/red rings) on the dashboard show at a glance which servers have cookies configured.
  • Personal & Server Modes: Use it personally or for your entire guild.
  • Slash Commands: /latest, /list, and /select to interact with results directly from Discord.
  • High Performance: Powered by Bun and SQLite for near-instant responses.

Documentation

Detailed documentation is available in the docs/ folder:


🛠 Setup Guide

1. Discord Developer Portal Configuration

  1. Go to the Discord Developer Portal.
  2. Create a New Application.
  3. Bot Settings:
    • Enable Public Bot (if you want others to add it).
    • Privileged Gateway Intents: Ensure GUILD_MEMBERS is ON if you want the bot to detect admin permissions correctly.
  4. OAuth2 Settings:
    • Add a Redirect URI: https://your-domain.com/auth/discord/callback (or http://localhost:3342/auth/discord/callback for local testing).
    • Note your Client ID and Client Secret.

2. Environment Configuration

Copy .env.example to .env and fill in the values:

cp .env.example .env
Variable Description
DISCORD_BOT_TOKEN Your bot's token from the "Bot" tab.
DISCORD_CLIENT_ID Your application's Client ID.
DISCORD_CLIENT_SECRET Your application's Client Secret.
ADMIN_DISCORD_ID Your personal Discord User ID.
URL Crucial: Your public base URL (e.g., https://moulify.com).
PORT Port for the web panel (default: 3342).
EPITEST_YEAR The academic year to monitor (e.g., 2025).
POLL_INTERVAL How often to check for results (seconds, default: 60).
SESSION_SECRET A random string for session encryption (auto-generated if empty).

🔑 The Redirect URI

The application uses the URL variable to construct the redirect URI.

  1. In the Discord Developer Portal, add the redirect URI: ${URL}/auth/discord/callback.
  2. Local Testing: Use http://localhost:3342/auth/discord/callback.
  3. Production: Use your public URL, e.g., https://mouli.example.com/auth/discord/callback.
docker compose up -d --build

The web panel will be available on the port you specified (default: 3342).

4. Local Development

Ensure you have Bun installed:

# Install dependencies
bun install

# Run both web and bot in dev mode
bun run dev

📘 Usage

Web Panel

  1. Login via Discord at your hosted URL.
  2. Servers where you have Administrator or Manage Server permissions will appear on the dashboard.
  3. A green ring around a server icon means it is configured; a red ring means it needs cookies.
  4. Paste your Microsoft SSO cookies (Netscape format) in the settings for each guild.

Discord Commands

  • /latest: Shows the most recent test result.
  • /list: Displays a summary of all recent projects.
  • /select: Provides a dropdown to view detailed results for any project.
  • /status: Checks your cookie status and guild configuration.
  • /panel: Gets the link to your web dashboard.

🔒 Security & Cookies

The bot requires Microsoft SSO cookies (ESTSAUTH, etc.) to fetch results. These are stored in a local SQLite database (mouli.db). Never share your mouli.db or .env file.

To get your cookies:

  1. Log in to myresults.epitest.eu.
  2. Use a browser extension (like "Get cookies.txt LOCALLY") to export cookies for login.microsoftonline.com in Netscape format.
  3. Paste the content into the guild or personal settings in the web panel.

🤝 Tech Stack

  • Next.js 16: Frontend and API routes.
  • Bun: Runtime, bot execution, and fast dependency management.
  • Discord.js: Interface with the Discord API.
  • Drizzle ORM: Type-safe database interactions.
  • SQLite: Local data persistence.