Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions .devcontainer/compose.dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
services:
clickhouse:
container_name: clickhouse
image: clickhouse/clickhouse-server:25.4.2
ports:
- "11500:8123"
- "11501:9000"
volumes:
- clickhouse-data:/var/lib/clickhouse
- ../clickhouse_config:/etc/clickhouse-server/config.d
environment:
- CLICKHOUSE_DB=${CLICKHOUSE_DB:-analytics}
- CLICKHOUSE_USER=${CLICKHOUSE_USER:-default}
- CLICKHOUSE_PASSWORD=${CLICKHOUSE_PASSWORD:-frog}
healthcheck:
test:
[
"CMD",
"wget",
"--no-verbose",
"--tries=1",
"--spider",
"http://localhost:8123/ping",
]
interval: 3s
timeout: 5s
retries: 5
start_period: 10s
restart: unless-stopped

postgres:
image: postgres:17.4
container_name: postgres
environment:
- POSTGRES_USER=${POSTGRES_USER:-frog}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-frog}
- POSTGRES_DB=${POSTGRES_DB:-analytics}
volumes:
- postgres-data:/var/lib/postgresql/data
restart: unless-stopped
ports:
- "11502:5432"

dev:
image: mcr.microsoft.com/devcontainers/javascript-node:1-20-bookworm
volumes:
- ../:/workspace:cached
command: sleep infinity
environment:

- DOMAIN_NAME=${DOMAIN_NAME:-localhost}
- BASE_URL=${BASE_URL:-http://localhost}
- CLICKHOUSE_HOST=http://clickhouse:8123
- CLICKHOUSE_DB=${CLICKHOUSE_DB:-analytics}
- CLICKHOUSE_PASSWORD=${CLICKHOUSE_PASSWORD:-frog}
- POSTGRES_HOST=postgres
- POSTGRES_PORT=5432
- POSTGRES_DB=${POSTGRES_DB:-analytics}
- POSTGRES_USER=${POSTGRES_USER:-frog}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-frog}
- BETTER_AUTH_SECRET=${BETTER_AUTH_SECRET}
- DISABLE_SIGNUP=${DISABLE_SIGNUP:-false}
# below is only for rybbit cloud
- CLOUD=${CLOUD}
- STRIPE_SECRET_KEY=${STRIPE_SECRET_KEY}
- STRIPE_WEBHOOK_SECRET=${STRIPE_WEBHOOK_SECRET}
- GOOGLE_CLIENT_ID=${GOOGLE_CLIENT_ID}
- GOOGLE_CLIENT_SECRET=${GOOGLE_CLIENT_SECRET}
- GITHUB_CLIENT_ID=${GITHUB_CLIENT_ID}
- GITHUB_CLIENT_SECRET=${GITHUB_CLIENT_SECRET}
- RESEND_API_KEY=${RESEND_API_KEY}

- NEXT_PUBLIC_BACKEND_URL=http://localhost:3001
- NEXT_PUBLIC_DISABLE_SIGNUP=${DISABLE_SIGNUP}
- NEXT_PUBLIC_CLOUD=${CLOUD}

volumes:
clickhouse-data:
postgres-data:
53 changes: 53 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/javascript-node
{
"name": "Rybbit",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"dockerComposeFile": ["compose.dev.yaml"],
"workspaceFolder": "/workspace",
"service": "dev",

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {
// "ghcr.io/robbert229/devcontainer-features/postgresql-client:1": "1.0.0"
// },

// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [3001,3002,3003],

"runServices": [
// "caddy",
"clickhouse",
"postgres"
],

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "./.devcontainer/postCreate.sh",

// uncomment to keep clickhouse/postgres running after closing vscode
//"shutdownAction": "none",

// Configure tool-specific properties.
"customizations": {
"vscode": {
"extensions": [
"dbaeumer.vscode-eslint",
"unifiedjs.vscode-mdx"
]
}
},
"portsAttributes": {
"3001": {
"label": "Backend"
},
"3002": {
"label": "Client"
},
"3003": {
"label": "Docs"
}
}

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
3 changes: 3 additions & 0 deletions .devcontainer/postCreate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

# nothing to do for now!
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ pnpm-debug.log*

# IDE specific files
.idea/
.vscode/
*.swp
*.swo
.DS_Store
Expand All @@ -43,4 +42,7 @@ coverage/
# Production
.env.production

.cursor/
.cursor/

# Drizzle
drizzle/
20 changes: 20 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Debug Backend",
"program": "${workspaceFolder}/server/src/index.ts",
"cwd": "${workspaceFolder}/server",
"outFiles": ["${workspaceFolder}/server/dist/**/*.js"],
"request": "launch",
"preLaunchTask": "Build Backend (Dev)",
"skipFiles": [
"<node_internals>/**"
],
"type": "node"
}
]
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"remote.localPortHost": "allInterfaces"
}
Loading