Estado Actual: v1.0.0-dev.17 - Desarrollo activo con la mayorΓa de features implementadas
/api/media - Media CRUD operations/api/files - File operations and health analysis/api/stats - Dashboard statistics/api/config - Settings management/api/sync - Media library synchronization/api/{service}/system - Service system info for all integrations/health - Application health checkgit clone https://github.com/carcheky/keepercheky.git
cd keepercheky
make init
make dev
The development environment uses Air for automatic hot-reload:
# Start with hot-reload
make dev
# The server will automatically restart when you edit:
# - Go files (*.go)
# - Templates (*.html)
# - Config files (*.yaml)
Docker 28+ includes a watch feature that syncs file changes:
# Start with compose watch
make dev-watch
What gets synced:
./cmd β Real-time sync./internal β Real-time sync./pkg β Real-time sync./web β Real-time syncgo.mod/go.sum β Triggers rebuild# View logs
make logs
# Open shell in container
make shell
# Run tests
make test
# Format code
make fmt
# Stop server
make stop
# Clean everything
make clean
keepercheky/
βββ cmd/
β βββ server/
β βββ main.go # Application entry point
βββ internal/ # Private application code
β βββ config/ # Configuration management
β β βββ config.go
β βββ models/ # Database models (GORM)
β β βββ models.go
β βββ repository/ # Data access layer
β β βββ repository.go
β βββ service/ # Business logic
β β βββ clients/ # External service clients
β β βββ cleanup/ # Cleanup strategies
β β βββ scheduler/ # Job scheduling
β βββ handler/ # HTTP handlers (Fiber)
β β βββ handler.go
β β βββ dashboard.go
β β βββ media.go
β β βββ ...
β βββ middleware/ # HTTP middleware
β βββ middleware.go
βββ web/
β βββ templates/ # Go html/template files
β β βββ layouts/
β β β βββ main.html
β β βββ pages/
β β βββ dashboard.html
β β βββ ...
β βββ static/ # CSS, JS, images
β βββ css/
β βββ js/
β βββ images/
βββ pkg/ # Public/shared packages
β βββ logger/
β β βββ logger.go
β βββ utils/
βββ data/ # Runtime data (gitignored)
β βββ dev.db # SQLite database
βββ config/ # Configuration files
β βββ config.example.yaml
βββ .air.toml # Air configuration
βββ docker-compose.yml # Development compose file
βββ Dockerfile.dev # Development Dockerfile
βββ Makefile # Development commands
βββ README.md
The application uses environment variables with the prefix KEEPERCHEKY_:
# App
KEEPERCHEKY_APP_ENVIRONMENT=development
KEEPERCHEKY_APP_LOG_LEVEL=debug
KEEPERCHEKY_APP_DRY_RUN=true
KEEPERCHEKY_APP_LEAVING_SOON_DAYS=7
# Server
KEEPERCHEKY_SERVER_PORT=8000
KEEPERCHEKY_SERVER_HOST=0.0.0.0
# Database
KEEPERCHEKY_DATABASE_TYPE=sqlite
KEEPERCHEKY_DATABASE_PATH=./data/dev.db
Alternatively, create config/config.yaml:
app:
environment: development
log_level: debug
dry_run: true
leaving_soon_days: 7
scheduler_enabled: false
server:
port: "8000"
host: "0.0.0.0"
database:
type: sqlite
path: ./data/dev.db
clients:
radarr:
enabled: false
url: "http://radarr:7878"
api_key: ""
sonarr:
enabled: false
url: "http://sonarr:8989"
api_key: ""
jellyfin:
enabled: false
url: "http://jellyfin:8096"
api_key: ""
username: ""
password: ""
# All tests
make test
# With coverage
make test-coverage
# Specific package
go test -v ./internal/service/...
Follow the standard Go testing conventions:
// internal/repository/repository_test.go
package repository
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestMediaRepository_GetAll(t *testing.T) {
// Setup
db := setupTestDB(t)
defer db.Close()
repo := NewMediaRepository(db)
// Test
media, err := repo.GetAll()
// Assert
assert.NoError(t, err)
assert.NotNil(t, media)
}
Create reactive components in templates:
<div x-data="mediaList()" x-init="init()">
<template x-for="item in media" :key="item.id">
<div x-text="item.title"></div>
</template>
</div>
<script>
function mediaList() {
return {
media: [],
async init() {
this.media = await this.fetchMedia();
},
async fetchMedia() {
const response = await fetch('/api/media');
return await response.json();
}
}
}
</script>
Use Tailwind utility classes directly in templates:
<div class="bg-white shadow rounded-lg p-6">
<h2 class="text-2xl font-bold text-gray-900">Title</h2>
</div>
F5 to start debugging# View container logs
make logs
# Open shell in container
make shell
# Inside container, you can:
go run ./cmd/server
Port already in use:
# Find and kill process using port 8000
lsof -ti:8000 | xargs kill -9
# Or use a different port
KEEPERCHEKY_SERVER_PORT=8001 make dev
Database locked:
# Stop all containers and clean
make clean
make init
make dev
git checkout -b feature/my-featuremake testmake fmtgit commit -m "feat: add my feature"git push origin feature/my-featureSee .github/copilot-instructions.md for detailed coding standards.
Key principles:
Happy coding! π
If you encounter any issues, check the main documentation or open an issue on GitHub.