3.4 KiB
3.4 KiB
Implementation Plan for Enhancing Nugitea to be More Gitea-like
Overview
This document outlines the implementation plan for adding user management, authentication, web UI, issue tracking, and pull requests to nugitea, bringing it closer to Gitea's functionality.
Current State
- Basic repository management (clone, push, SSH, HTTP)
- Mock authentication system that allows access to all repositories
- In-memory user storage
- Simple web handlers for dashboard and users
- No proper password handling or session management
Implementation Steps
1. Password Hashing System (Priority: High)
- Implement secure password hashing using bcrypt or similar library
- Add password validation functions
- Update user model to securely store passwords
2. Authentication Enhancements (Priority: High)
- Replace mock authentication with real credential checking
- Implement login/logout endpoints with session management
- Create proper JWT token or cookie-based authentication
3. Database Schema Design (Priority: High)
- Design database schema for users, teams, repositories, issues, pull requests
- Create migration scripts for the schema
- Implement data persistence layer
4. Complete User Management System (Priority: High)
- Full CRUD operations for users
- Team management functionality
- User role and permission handling
- Admin panel for user management
5. Web UI Enhancement (Priority: Medium)
- Create comprehensive web interface with multiple pages
- Implement repository listing, browsing, and management
- Add issue tracking pages
- Add pull request management pages
6. Issue Tracking System (Priority: Medium)
- Implement issue creation, viewing, and management
- Add ability to assign issues to users
- Support for labels, comments, and status updates
7. Pull Request System (Priority: Medium)
- Implement pull request creation and review workflow
- Support for code commenting and merge functionality
Detailed Implementation Plan
Phase 1: Infrastructure & Authentication (Week 1)
- Setup proper database schema design
- Implement password hashing system
- Enhance authentication with real validation
- Add session management
Phase 2: User Management (Week 2)
- Complete CRUD functionality for users
- Implement team management
- Add role-based access control
- Create user and admin panels
Phase 3: Web UI Enhancement (Week 3)
- Build repository browsing interface
- Implement dashboard with stats
- Add issue tracking interface
- Build pull request interface
Phase 4: Core Features (Week 4)
- Complete issue tracking system
- Implement pull request workflow
- Add webhooks support
- Implement CI/CD features if time allows
Technology Stack
- Go for core backend
- PostgreSQL or SQLite for data persistence
- JWT tokens for authentication
- HTML/CSS/JS for web UI (possibly Bootstrap for styling)
Files to Create/Modify
/internal/db/schema.go- Database schema definition/internal/auth/password.go- Password hashing and validation/internal/user/store_db.go- Database user store implementation/internal/web/ui/- Web UI templates and assets/internal/issues/- Issue tracking system/internal/pullrequests/- Pull request system
Key Challenges
- Migrating from in-memory storage to persistent storage while maintaining compatibility
- Implementing proper session management
- Maintaining existing Git functionality during enhancements
- Ensuring data security and proper access controls