Skip to content

Commit 650f1fd

Browse files
committed
update starter repo
1 parent 910252e commit 650f1fd

File tree

5 files changed

+105
-4
lines changed

5 files changed

+105
-4
lines changed

‎.env.example‎

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Run mix phx.gen.secret
2+
# Test value, generate your own for production
3+
SECRET_KEY_BASE=l/tTJZ4KUNjIfiUsNQDQLWOTgFlyiOz8RQ2EgSRa7mopMzPLJuu7/8s5pA7iiSgO
4+
5+
# Logging Configuration
6+
# Set the log level for the application
7+
# Valid values: debug, info, warning, error
8+
# Default: info (in prod), debug (in dev)
9+
# LOG_LEVEL=info
10+
11+
# Sentry Error Monitoring
12+
# SENTRY_DSN=https://your-sentry-dsn-here
13+
# Set which log levels to send to Sentry (default: error only)
14+
# Valid values: info, warning, error
15+
# SENTRY_LOG_LEVEL=error
16+
17+
# Discord OAuth Configuration
18+
# DISCORD_CLIENT_ID=your_discord_client_id_here
19+
# DISCORD_CLIENT_SECRET=your_discord_client_secret_here
20+
21+
# Google OAuth Configuration
22+
# GOOGLE_CLIENT_ID=google_client_id
23+
# GOOGLE_CLIENT_SECRET=google_secret
24+
25+
# Facebook OAuth Configuration
26+
# FACEBOOK_CLIENT_ID=facebook_client_id
27+
# FACEBOOK_CLIENT_SECRET=facebook_secret
28+
29+
# Apple OAuth Configuration
30+
# APPLE_CLIENT_ID=client_id
31+
# APPLE_TEAM_ID=team_id
32+
# APPLE_KEY_ID=key_id
33+
# APPLE_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----
34+
# ...
35+
# -----END PRIVATE KEY-----"
36+
37+
# PostgreSQL Database Configuration (optional)
38+
# If not set, the app will use SQLite for development
39+
# POSTGRES_HOST=localhost
40+
# POSTGRES_PORT=5432
41+
# POSTGRES_USER=postgres
42+
# POSTGRES_PASSWORD=postgres
43+
# POSTGRES_DB=game_server_dev
44+
45+
# Or use a single DATABASE_URL (takes precedence over individual POSTGRES_* vars)
46+
# DATABASE_URL=ecto://postgres:postgres@localhost:5432/game_server_dev
47+
48+
# Steam OpenID Configuration
49+
# STEAM_API_KEY=your_steam_api_key_here
50+
# STEAM_APP_ID=your_steam_app_id_here
51+
# When using SQLite in production (or on platforms with a mounted volume),
52+
# set the path where the app should store the SQLite database file.
53+
# Example: SQLITE_DATABASE_PATH=/data/game_server_prod.db
54+
# If not set, the app uses db/game_server_prod.db by default.
55+
# SQLITE_DATABASE_PATH=/data/game_server_prod.db
56+
57+
# When deploying also set
58+
# This secret is staged, but not deployed.
59+
# Run fly deploy from a terminal.
60+
# PHX_HOST=yourdomain.com
61+
62+
# Path to server hooks file
63+
HOOKS_FILE_PATH=modules/starter_hook.ex
64+
# Enable device authentication
65+
# Easy to get started locally
66+
DEVICE_AUTH_ENABLED=true
67+
# Set theme
68+
# THEME_CONFIG=priv/static/theme/default_config.json
69+
# Set email
70+
# SMTP_USERNAME="resend"
71+
# SMTP_PASSWORD="your_resend_api_key"
72+
# SMTP_RELAY="smtp.resend.com"
73+
# SMTP_PORT=465
74+
# SMTP_SSL=false
75+
# SMTP_TLS=false
76+
# Recommended: configure the sender name and email so providers accept mail
77+
# (make sure the domain is verified with your provider to avoid errors)
78+
# SMTP_FROM_NAME="Game Server"
79+
# SMTP_FROM_EMAIL="no-reply@example.com"
80+
# If secrets don't deploy to fly, do:
81+
# fly secrets sync
82+
# fly secrets deploy

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.env

‎README.md‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Gamend Starter
22

3+
## Run locally
4+
5+
1. Configure `.env` file (rename `.env.example` to `.env`).
6+
2. Run the following:
7+
8+
```sh
9+
docker compose up
10+
```
11+
12+
## Deploy
13+
314
1. Fork this repo.
415
2. Go to fly.io (or another docker provider).
516
3. Connect the app with the repo you forked.

‎docker-compose.yml‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
services:
2+
app:
3+
build: .
4+
ports:
5+
- "4000:4000"
6+
env_file:
7+
- .env
8+
volumes:
9+
- ./modules:/app/modules

‎modules/polyglot_hook.ex‎ renamed to ‎modules/starter_hook.ex‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,13 @@ defmodule GameServer.Modules.StarterHook do
66

77
@behaviour GameServer.Hooks
88

9-
alias GameServer.Repo
10-
119
@impl true
12-
def after_user_register(user) do
10+
def after_user_register(_user) do
1311
:ok
1412
end
1513

1614
@impl true
17-
def after_user_login(user) do
15+
def after_user_login(_user) do
1816
:ok
1917
end
2018

0 commit comments

Comments
 (0)