Skip to content
Merged
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
20 changes: 18 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,25 @@ You can run it without production configuration locally, but it is generally not

You will need a `.env` file. This file should contain all of the variables in the `.env.example` file at the root of the project correctly filled out.

## Environment Variables

Required environment variables:
- `GITHUB_TOKEN` - GitHub personal access token for accessing the GitHub API
- `DATABASE_URL` - PostgreSQL connection string (automatically set in Docker Compose)
- `REDIS_URL` - Redis connection string (defaults to `redis://localhost:6379`, automatically set in Docker Compose)
- `GITHUB_ORG` - GitHub organization name (defaults to `hacksu`, optional)

The `REDIS_URL` is automatically configured in Docker Compose to connect to the Redis service. For local development outside Docker, you may need to set it manually.


To make changes on the admin side, go to the `/admin` route, and login with discord. If you have acceptable roles, this will authenticate you.


Run the containers with `docker compose -d --build`
This should setup persistent postgres volume and expose `localhost:3000` with the site
Run the containers with `docker compose up -d --build`
This should setup persistent postgres and redis volumes and expose `localhost:3002` with the site.

The setup includes:
- **PostgreSQL** - Main database (port 5434)
- **Redis** - Cache for lesson repositories (port 6379)
- **Lessons Service** - Python service that fetches and caches GitHub lesson repos
- **SvelteKit App** - Main web application (port 3002)
15 changes: 15 additions & 0 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 37 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,62 @@ services:
networks:
- app-network

redis:
image: redis:7-alpine
restart: on-failure:5
ports:
- 6379:6379
volumes:
- redisdata:/data
command: redis-server --appendonly yes
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
networks:
- app-network

lessons-service:
build:
context: ./lessons-service
dockerfile: Dockerfile
restart: on-failure:5
env_file:
- .env
environment:
REDIS_URL: redis://redis:6379
GITHUB_TOKEN: ${GITHUB_TOKEN}
GITHUB_ORG: ${GITHUB_ORG:-hacksu}
depends_on:
redis:
condition: service_healthy
networks:
- app-network

app:
build: .
restart: on-failure:5
env_file:
- .env
environment:
DATABASE_URL: postgresql://postgres:postgres@db:5432/hacksu
REDIS_URL: redis://redis:6379
NODE_ENV: production
volumes:
- uploads:/app/static/uploads
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
networks:
- app-network

volumes:
pgdata:
uploads:
redisdata:

networks:
app-network:
6 changes: 6 additions & 0 deletions drizzle/0014_spotty_misty_knight.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CREATE TABLE "lesson_icons" (
"category_name" text PRIMARY KEY NOT NULL,
"iconify_id" text NOT NULL,
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
);
Loading