5.1 KiB
5.1 KiB
Geek-Life v2.0 - Multi-Tenant CLI Task Manager
🚀 What's New in v2.0
- Multi-Tenant Support: Multiple organizations can use the same instance
- User Management: Multiple users per tenant with secure authentication
- PostgreSQL Backend: Centralized database with better performance and reliability
- Session Management: Secure login/logout with session tokens
- Database Migrations: Automated schema management
- Row-Level Security: Data isolation between tenants
🏗️ Architecture
Multi-Tenant Design
- Tenants: Organizations or teams
- Users: Individual users within a tenant
- Projects & Tasks: Scoped to specific users within tenants
- Sessions: Secure authentication tokens
Database Schema
- PostgreSQL with Row-Level Security (RLS)
- Automated migrations
- Optimized indexes for performance
- UUID support for external integrations
🛠️ Installation & Setup
Prerequisites
- Go 1.19 or later
- PostgreSQL 12 or later
Database Setup
- Create a PostgreSQL database:
CREATE DATABASE geeklife;
- Copy the environment configuration:
cp .env.example .env
- Update
.envwith your database credentials:
DB_HOST=localhost
DB_PORT=5432
DB_USER=postgres
DB_PASSWORD=your_password
DB_NAME=geeklife
DB_SSLMODE=disable
Build & Run
# Install dependencies
go mod tidy
# Run database migrations
go run app/*.go --migrate
# Start the application
go run app/*.go
🔐 Authentication
First Time Setup
- Register Tenant: Create a new organization/tenant with an admin user
- Register User: Add additional users to an existing tenant
- Login: Access with existing credentials
Session Management
- Sessions are automatically saved locally
- Use
Ctrl+Lto logout - Sessions expire after 24 hours (configurable)
🎮 Usage
Keyboard Shortcuts
Tab/Shift+Tab: Navigate between panesEnter: Select/Edit itemCtrl+C: Quit applicationCtrl+L: LogoutEsc: Cancel/Go back
Multi-User Workflow
- Tenant Admin: Registers the tenant and becomes the first user
- Team Members: Register as users within the existing tenant
- Data Isolation: Each user sees only their own projects and tasks
- Collaboration: Future versions will support shared projects
🔧 Configuration
Environment Variables
# Database Configuration
DB_HOST=localhost
DB_PORT=5432
DB_USER=postgres
DB_PASSWORD=your_password
DB_NAME=geeklife
DB_SSLMODE=disable
# Authentication Configuration
JWT_SECRET=your-super-secret-jwt-key
SESSION_DURATION=24
# Application Configuration
ENVIRONMENT=development
LOG_LEVEL=info
Command Line Options
# Run database migrations
./geek-life --migrate
# Help
./geek-life --help
🗄️ Database Migrations
The application includes an automated migration system:
# Run all pending migrations
go run app/*.go --migrate
Migrations are located in the migrations/ directory and are automatically applied in order.
🔒 Security Features
- Password Hashing: bcrypt with salt
- Session Tokens: Cryptographically secure random tokens
- Row-Level Security: Database-level tenant isolation
- SQL Injection Protection: Parameterized queries
- Session Expiration: Configurable session timeouts
🏢 Multi-Tenant Benefits
- Cost Effective: Single instance serves multiple organizations
- Data Isolation: Complete separation between tenants
- Scalable: Supports unlimited tenants and users
- Secure: Row-level security ensures data privacy
- Maintainable: Single codebase for all tenants
🔄 Migration from v1.0
The new version maintains backward compatibility with the Storm database format. You can:
- Continue using Storm (single-user mode)
- Migrate to PostgreSQL for multi-tenant features
- Run both versions side by side
🚧 Development
Project Structure
├── app/ # Main application and UI components
├── auth/ # Authentication service
├── config/ # Configuration management
├── migration/ # Database migration system
├── model/ # Data models
├── repository/ # Data access layer
│ ├── postgres/ # PostgreSQL implementations
│ └── storm/ # Storm implementations (legacy)
├── util/ # Utility functions
├── migrations/ # SQL migration files
└── docs/ # Documentation
Adding New Features
- Update models if needed
- Add repository methods
- Update UI components
- Create migrations for schema changes
📝 License
MIT License - see LICENSE file for details.
🤝 Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
📞 Support
- Create an issue for bug reports
- Use discussions for feature requests
- Check the wiki for detailed documentation
Geek-Life v2.0 - Now with multi-tenant support for teams and organizations! 🚀
