Skip to content

Commit dd8cf24

Browse files
feat: Add Railway deployment configuration and database setup
1 parent 8779f97 commit dd8cf24

File tree

3 files changed

+52
-2
lines changed

3 files changed

+52
-2
lines changed

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@
33
"version": "0.1.0",
44
"private": true,
55
"scripts": {
6-
"dev": "next dev --turbopack",
6+
"dev": "next dev -p 3001",
77
"build": "next build",
88
"start": "next start",
99
"lint": "next lint",
10-
"db:seed": "tsx prisma/seed.ts"
10+
"db:generate": "prisma generate",
11+
"db:push": "prisma db push",
12+
"db:migrate": "prisma migrate deploy",
13+
"db:seed": "tsx prisma/seed.ts",
14+
"postinstall": "prisma generate && prisma migrate deploy"
1115
},
1216
"dependencies": {
1317
"@auth/prisma-adapter": "^2.10.0",

railway-env.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Railway Environment Variables Setup
2+
3+
## Required Environment Variables for Railway:
4+
5+
### Database (Auto-configured by Railway)
6+
- `DATABASE_URL` - Automatically set by Railway PostgreSQL service
7+
8+
### NextAuth Configuration
9+
- `NEXTAUTH_URL` - Your Railway app URL (e.g., https://your-app.railway.app)
10+
- `NEXTAUTH_SECRET` - Generate with: `openssl rand -base64 32`
11+
12+
### OAuth Providers (Optional for now)
13+
- `GOOGLE_CLIENT_ID` - Your Google OAuth client ID
14+
- `GOOGLE_CLIENT_SECRET` - Your Google OAuth client secret
15+
- `GITHUB_CLIENT_ID` - Your GitHub OAuth client ID
16+
- `GITHUB_CLIENT_SECRET` - Your GitHub OAuth client secret
17+
18+
## Setup Steps:
19+
20+
1. **In Railway Dashboard:**
21+
- Go to your project
22+
- Click on your app service
23+
- Go to "Variables" tab
24+
- Add the environment variables above
25+
26+
2. **Generate NEXTAUTH_SECRET:**
27+
```bash
28+
openssl rand -base64 32
29+
```
30+
31+
3. **Set NEXTAUTH_URL:**
32+
- Use your Railway app URL
33+
- Format: https://your-app-name.railway.app
34+
35+
## Database Connection:
36+
- Railway automatically provides `DATABASE_URL`
37+
- No additional setup needed for database

railway.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[build]
2+
builder = "nixpacks"
3+
4+
[deploy]
5+
startCommand = "npm start"
6+
healthcheckPath = "/"
7+
healthcheckTimeout = 300
8+
restartPolicyType = "on_failure"
9+
restartPolicyMaxRetries = 10

0 commit comments

Comments
 (0)