Skip to content

Commit 399251f

Browse files
authored
Merge pull request #41 from applirank/feat/simplify-self-host
feat: simplify setup process and enhance environment configuration
2 parents c73a571 + a4c1494 commit 399251f

9 files changed

Lines changed: 529 additions & 286 deletions

File tree

.dockerignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Dependencies (reinstalled during build)
2+
node_modules/
3+
4+
# Build artifacts (generated during build)
5+
.nuxt/
6+
.output/
7+
8+
# Git history
9+
.git/
10+
.gitignore
11+
12+
# Local env — never bake secrets into the image
13+
.env
14+
.env.*
15+
!.env.example
16+
17+
# Editor and OS artifacts
18+
.DS_Store
19+
*.log
20+
.vscode/
21+
.idea/

.env.example

Lines changed: 41 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,68 @@
1-
# ─────────────────────────────────────────────
2-
# Applirank — Environment Variables
3-
# ─────────────────────────────────────────────
4-
# Copy this file to .env and fill in the values.
5-
# Railway auto-detects this file and suggests variables during setup.
1+
# ─────────────────────────────────────────────────────────────────────────────
2+
# Applirank — Environment Variable Reference
3+
# ─────────────────────────────────────────────────────────────────────────────
4+
# Local development: run ./setup.sh — it generates .env automatically.
5+
# Production / manual setup: copy this file to .env and fill in the values.
6+
# Railway: auto-detects this file and suggests variables during setup.
67

7-
# ─── Database (Docker Compose) ──────────────
8-
# Used by docker-compose.yml to configure the local Postgres container
9-
DB_USER=admin
10-
DB_PASSWORD=changeme
8+
# ─── Database ────────────────────────────────────────────────────────────────
9+
# Used by docker-compose.yml to configure the Postgres container
10+
DB_USER=applirank
11+
DB_PASSWORD=change-me
1112
DB_NAME=applirank
1213

13-
# ─── Database (App) ─────────────────────────
14-
# PostgreSQL connection string (must match Docker Compose values above for local dev)
15-
# Railway: provided automatically via ${{Postgres.DATABASE_URL}}
16-
DATABASE_URL=postgresql://admin:changeme@localhost:5432/applirank
14+
# PostgreSQL connection string (used by host tools: drizzle-kit, drizzle studio)
15+
# docker-compose overrides this with the internal Docker hostname for the app.
16+
# Railway: ${{Postgres.DATABASE_URL}}
17+
DATABASE_URL=postgresql://applirank:change-me@localhost:5432/applirank
1718

18-
# ─── Authentication ──────────────────────────
19-
# Random string, minimum 32 characters. Generate with: openssl rand -base64 32
20-
BETTER_AUTH_SECRET=generate-a-random-string-at-least-32-chars-long
19+
# ─── Authentication ──────────────────────────────────────────────────────────
20+
# Min 32-character random string. Generate with: openssl rand -base64 32
21+
BETTER_AUTH_SECRET=replace-with-openssl-rand-base64-32-output
2122

22-
# The public URL of the app (used for session cookies and OAuth callbacks)
23-
# Local: http://localhost:3000 | Production: https://applirank.com
24-
# Railway PR/preview: optional when RAILWAY_ENVIRONMENT_NAME is a preview env.
25-
# In preview, Applirank resolves URL automatically in this order:
26-
# 1) https://applirank-applirank-pr-${RAILWAY_GIT_PR_NUMBER}.up.railway.app
27-
# 2) https://${RAILWAY_PUBLIC_DOMAIN}
28-
# 3) BETTER_AUTH_URL (fallback)
23+
# Public URL of the app (used for session cookies and OAuth callbacks)
24+
# Local: http://localhost:3000 | Production: https://yourdomain.com
25+
# Railway PR/preview: auto-resolved from RAILWAY_PUBLIC_DOMAIN
2926
BETTER_AUTH_URL=http://localhost:3000
3027

31-
# Comma-separated allowed origins for auth requests.
32-
# Railway recommendation:
33-
# BETTER_AUTH_TRUSTED_ORIGINS=https://${{RAILWAY_PUBLIC_DOMAIN}}
34-
# Multiple origins example:
35-
# BETTER_AUTH_TRUSTED_ORIGINS=https://applirank.com,https://staging.applirank.com
36-
# BETTER_AUTH_TRUSTED_ORIGINS=
28+
# Comma-separated allowed origins (optional, for multi-domain setups)
29+
# BETTER_AUTH_TRUSTED_ORIGINS=https://yourdomain.com
3730

38-
# ─── Object Storage (Docker Compose) ────────
39-
# Used by docker-compose.yml to configure the local MinIO container
40-
STORAGE_USER=admin
41-
STORAGE_PASSWORD=changeme
31+
# ─── Object Storage (S3-compatible) ──────────────────────────────────────────
32+
# Used by docker-compose.yml to configure the MinIO container
33+
STORAGE_USER=applirank
34+
STORAGE_PASSWORD=change-me
4235

43-
# ─── Object Storage (App — S3-compatible) ───
44-
# Local (MinIO via Docker Compose):
45-
# S3_ENDPOINT=http://localhost:9000
46-
# S3_FORCE_PATH_STYLE=true
47-
#
48-
# Railway (Storage Bucket):
49-
# S3_ENDPOINT=${{Bucket.ENDPOINT}}
50-
# S3_FORCE_PATH_STYLE=false
36+
# App-level S3 config (used by host tools)
37+
# docker-compose overrides S3_ENDPOINT with http://minio:9000 for the app container
38+
# Local (MinIO): S3_ENDPOINT=http://localhost:9000, S3_FORCE_PATH_STYLE=true
39+
# Railway Bucket: S3_ENDPOINT=${{Bucket.ENDPOINT}}, S3_FORCE_PATH_STYLE=false
5140
S3_ENDPOINT=http://localhost:9000
52-
S3_ACCESS_KEY=admin
53-
S3_SECRET_KEY=changeme
41+
S3_ACCESS_KEY=applirank
42+
S3_SECRET_KEY=change-me
5443
S3_BUCKET=applirank
5544
S3_REGION=us-east-1
56-
57-
# Path-style URLs: true for MinIO (local dev), false for Railway Buckets / AWS S3
5845
S3_FORCE_PATH_STYLE=true
5946

60-
# ─── Site URL (SSR + SEO) ───────────────────
61-
# Used by @nuxtjs/seo for sitemap, canonical URLs, and OG tags
62-
# Production: https://applirank.com
47+
# ─── SEO ─────────────────────────────────────────────────────────────────────
48+
# Used by @nuxtjs/seo for sitemaps, canonical URLs, and OG tags
6349
NUXT_PUBLIC_SITE_URL=http://localhost:3000
6450

65-
# Public URL used by preview upsell modal "Upgrade to hosted plan" button
51+
# Public URL for the "Upgrade to hosted plan" button in the preview upsell modal
6652
# NUXT_PUBLIC_HOSTED_PLAN_URL=https://applirank.com
6753

68-
# ─── Optional: Demo Mode ────────────────────
69-
# Set to an org slug to make that org read-only (blocks mutations)
54+
# ─── Optional: Demo Mode ─────────────────────────────────────────────────────
55+
# Set to an org slug to make that org read-only (blocks all mutations)
7056
# Default seeded slug: applirank-demo
7157
# DEMO_ORG_SLUG=applirank-demo
7258

73-
# ─── Optional: Trusted Proxy ────────────────
74-
# IP address of the reverse proxy (Railway/Cloudflare). When set,
75-
# X-Forwarded-For is trusted for rate limiting IP extraction.
59+
# ─── Optional: Trusted Proxy ─────────────────────────────────────────────────
60+
# IP of the reverse proxy (Cloudflare, Railway, nginx). Enables accurate
61+
# IP extraction from X-Forwarded-For for rate limiting.
7662
# TRUSTED_PROXY_IP=
7763

78-
# ─── Optional: In-App Feedback ──────────────
64+
# ─── Optional: In-App Feedback ───────────────────────────────────────────────
7965
# Fine-grained GitHub PAT with Issues:write scope
8066
# GITHUB_FEEDBACK_TOKEN=ghp_...
8167
# GitHub repo in "owner/repo" format
8268
# GITHUB_FEEDBACK_REPO=applirank/applirank
83-

0 commit comments

Comments
 (0)