Skip to content

nedlir/gokusan

Repository files navigation

Gokusan

Gokusan

Secure, event-driven file sharing platform built with Go microservices, React, and Kafka.


Overview

Gokusan is a self-hosted file sharing platform where every uploaded file is automatically sanitized via Dangerzone before it becomes available for download or sharing. The system is fully event-driven: services communicate through Kafka and never call each other directly for write operations.

Stack

LayerTechnology
FrontendReact, TypeScript, Vite
GatewayKong
ServicesGo 1.23+, Gin
AuthKeycloak, JWT, HttpOnly cookies
StorageMinIO (S3-compatible)
DatabasePostgreSQL 15
MessagingApache Kafka
CacheRedis 7
ContainersDocker, Docker Compose

Getting Started

Prerequisites: Docker and Docker Compose

docker compose up --build

Services

ServiceURLAccess
Clienthttp://localhost:5173public
Gatewayhttp://localhost:8000public
Kong Adminhttp://localhost:8001public
MinIO APIhttp://localhost:9000public
MinIO Consolehttp://localhost:9001public
Keycloakhttp://localhost:8080public
Auth Servicehttp://auth:8080internal
Upload Servicehttp://upload:6565internal
Download Servicehttp://download:8012internal
Metadata Servicehttp://metadata:8013internal
Share Servicehttp://share:8014internal
PostgreSQLpostgres:5432internal
Redisredis:6379internal
Kafkakafka:9092internal

Architecture

architecture

For the full system design, service breakdown, request flow diagrams, database schema, and API reference see ARCHITECTURE.md.

Project Structure

.
├── client/                  # React SPA (Vite)
├── gateway/                 # Kong configuration
├── services/
│   ├── auth/                # Auth service (Gin): login, register, validate
│   ├── upload/              # Upload service (Gin): multipart to MinIO + Kafka
│   ├── download/            # Download service (Gin): stream from MinIO
│   ├── metadata/            # Metadata service (Gin): owns PostgreSQL files table
│   ├── share/               # Share service (Gin): time-limited share links via Redis
│   ├── sanitization/        # Sanitization worker: Kafka consumer, runs Dangerzone
│   └── cleanup/             # Cleanup worker: cron job, purges deleted/quarantined files
├── infrastructure/
│   └── keycloak/            # Keycloak Docker Compose and realm config
└── docker-compose.yaml

License

MIT

About

secure sanitized file sharing system

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages