Getting Started
This guide will get Momo running on your machine in under 10 minutes using Docker Compose.
Prerequisites
- Docker Engine 24+ and Docker Compose v2 โ Install Docker
- At least one OAuth app โ you need GitHub, Discord, Google, or an OIDC provider configured so you can log in. See the OAuth Setup guide.
- A terminal on Linux, macOS, or WSL on Windows.
Option 1: Docker Compose (Recommended)
This is the fastest way to run Momo. Docker Compose starts the app and a PostgreSQL database together.
Step 1 โ Clone the repository
git clone https://github.com/jp1337/momo.git
cd momo
Step 2 โ Configure environment variables
cp .env.example .env.local
Open .env.local in your editor and fill in the required values:
# Required
DATABASE_URL=postgresql://momo:password@db:5432/momo
AUTH_SECRET=your-secret-here # openssl rand -base64 32
# At least one OAuth provider
GITHUB_CLIENT_ID=your-client-id
GITHUB_CLIENT_SECRET=your-client-secret
# Public URL
NEXT_PUBLIC_APP_URL=http://localhost:3000
NEXTAUTH_URL=http://localhost:3000
Production / reverse proxy: If you deploy behind nginx, Caddy, or any Kubernetes ingress, also set
AUTH_TRUST_HOST=true. Auth.js v5 requires this to accept proxied requests.
See the Environment Variables reference for all available options.
Step 3 โ Generate a secret
openssl rand -base64 32
Paste the output as the value for AUTH_SECRET in .env.local.
Step 4 โ Start all services
docker compose up -d
This starts:
- app โ the Momo Next.js application on port 3000
- db โ PostgreSQL 18 on port 5432
Step 5 โ Open Momo
Visit http://localhost:3000 in your browser and sign in with your OAuth provider.
Migrations run automatically. The container applies all pending database migrations before the server starts โ no manual step needed.
Option 2: Local Development
Use this if you want to edit the code and see changes live.
Prerequisites
- Node.js 20+ โ Install Node.js
- npm (included with Node.js)
- Docker (for the PostgreSQL database)
Step 1 โ Clone and install dependencies
git clone https://github.com/jp1337/momo.git
cd momo
npm install
Step 2 โ Configure environment variables
cp .env.example .env.local
# Edit .env.local with your values
For local development, use:
DATABASE_URL=postgresql://momo:password@localhost:5432/momo
NEXT_PUBLIC_APP_URL=http://localhost:3000
NEXTAUTH_URL=http://localhost:3000
Step 3 โ Start the database
docker compose up db -d
Step 4 โ Run migrations
npx drizzle-kit migrate
Step 5 โ Start the development server
npm run dev
The app is available at http://localhost:3000 with hot reload enabled.
First Login
- Open http://localhost:3000
- Click Sign in and choose your OAuth provider
- Youโll be redirected to your dashboard
On first login, a user account is created automatically in the database.
Creating Your First Task
- From the dashboard, click New Task
- Enter a title and optionally assign it to a Topic
- Save โ your task appears in the list
- Click the task to mark it complete and earn your first coins
Enabling Push Notifications (Optional)
- Go to Settings in the navigation
- Click Enable Notifications
- Allow the browser notification permission prompt
- Choose your preferred notification time
Youโll need to configure VAPID keys first โ see the Environment Variables page.
Stopping Momo
docker compose down
To also remove the database volume (all data):
docker compose down -v
Next Steps
- Full Deployment Guide โ production setup with TLS and reverse proxy
- Environment Variables โ all configuration options
- OAuth Setup โ register OAuth apps for your domain
- Kubernetes โ deploy to a Kubernetes cluster