Files
Trackeep/backend/models/file.go
T
Tomas Dvorak 18aa702174 🎉 Initial commit: Trackeep - Complete Productivity Platform
🚀 Features Implemented:
 Full-stack application with SolidJS frontend + Go backend
 User authentication with JWT tokens
 Bookmark management with tags and search
 Task management with status and priority tracking
 File upload and management system
 Notes with rich text editing and organization
 Advanced search and filtering across all content types
 Export/import functionality for data portability

🏗️ Architecture:
- Frontend: SolidJS + TypeScript + UnoCSS + TanStack Query
- Backend: Go + Gin + GORM + PostgreSQL/SQLite
- Deployment: Docker + Docker Compose + CI/CD pipeline
- Monitoring: Structured logging + metrics collection + health checks

📦 Production Ready:
 Multi-stage Docker builds for frontend and backend
 Production docker-compose with Redis and backup services
 GitHub Actions CI/CD pipeline with security scanning
 Comprehensive logging and monitoring system
 Automated backup and recovery strategies
 Complete API documentation and user guide

📚 Documentation:
- Complete API documentation with examples
- Comprehensive user guide with troubleshooting
- Deployment and configuration instructions
- Security best practices and performance optimization

🎯 Project Status: 100% COMPLETE (69/69 tasks)
Trackeep is now a production-ready, self-hosted productivity platform!
2026-01-26 12:36:49 +01:00

52 lines
1.4 KiB
Go

package models
import (
"time"
"gorm.io/gorm"
)
// FileType represents the type of file
type FileType string
const (
FileTypeDocument FileType = "document"
FileTypeImage FileType = "image"
FileTypeVideo FileType = "video"
FileTypeAudio FileType = "audio"
FileTypeArchive FileType = "archive"
FileTypeOther FileType = "other"
)
// File represents a stored file
type File struct {
ID uint `json:"id" gorm:"primaryKey"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt gorm.DeletedAt `json:"-" gorm:"index"`
UserID uint `json:"user_id" gorm:"not null;index"`
User User `json:"user,omitempty" gorm:"foreignKey:UserID"`
OriginalName string `json:"original_name" gorm:"not null"`
FileName string `json:"file_name" gorm:"not null;uniqueIndex"`
FilePath string `json:"file_path" gorm:"not null"`
FileSize int64 `json:"file_size" gorm:"not null"`
MimeType string `json:"mime_type" gorm:"not null"`
FileType FileType `json:"file_type" gorm:"not null"`
// Organization
Tags []Tag `json:"tags,omitempty" gorm:"many2many:file_tags;"`
// Metadata
Description string `json:"description"`
IsPublic bool `json:"is_public" gorm:"default:false"`
// Preview/Thumbnail
ThumbnailPath string `json:"thumbnail_path"`
PreviewPath string `json:"preview_path"`
// Content extraction (for documents)
Content string `json:"content"`
}