submail

Development Setup Guide

This guide covers how to set up Submail on your local machine for development purposes.

Prerequisites

Step-by-Step Installation

1. Clone the Repository

git clone https://github.com/minseo0388/submail.git
cd submail

2. Install Dependencies

Submail uses a monorepo structure. Run npm install in the root directory to install dependencies for all workspaces.

npm install

3. Environment Configuration

Copy the example environment file to .env:

cp .env.example .env

Open .env and fill in the required fields. See the Environment Variables guide for details on getting your Discord keys.

4. Database Setup

Initialize the database (SQLite by default):

npx prisma db push

This command pushes the schema to your local database file (dev.db).

5. Start the Development Server

You can start both the web dashboard and the bot simultaneously:

npm run dev

Note on Port 25: Binding to port 25 often requires elevated privileges. On Linux/macOS, you might need to use sudo or set capabilities. On Windows, ensure no other service is using port 25.

6. Verify Installation

  1. Open http://localhost:3000.
  2. Log in with your Discord account.
  3. Create an alias.
  4. Send a test email to that alias (e.g., using telnet localhost 25 or a mail client configured to use localhost).

Turborepo

This project uses Turborepo for build orchestration.