Skip to content

V0.5 PLAN

GitHub Actions Bot edited this page May 3, 2026 · 4 revisions

nself-admin v0.5.0 - Production-Ready Release Plan

Goal: Get nself-admin to 100% production-ready status Target: February 2026 Current State: v0.4.0 (192 pages, 222 API routes)


Executive Summary

v0.5.0 focuses on stability, polish, and production readiness rather than new features. The admin UI has grown to 192 pages and 222 API routes. Now it's time to:

  1. Fix technical debt (8 known issues)
  2. Add missing critical features (real-time updates, error handling, testing)
  3. Polish UX (loading states, error messages, mobile responsiveness)
  4. Harden security (session management, CSRF, rate limiting)
  5. Achieve production quality (testing, docs, monitoring)

Phase 1: Technical Debt & Code Quality (Week 1)

1.1 Fix Known Issues

Priority: Critical Files to fix: 8 known issues from v0.2 code review

Issue File Fix Required Impact
VariableRow remount env/page.tsx Move component outside parent Performance
Unused nav properties navigation.ts Remove or implement rendering Code clarity
Massive help page help/page.tsx Split into sections Maintainability
Interactive command nselfCLI.ts Remove or replace Broken feature
Loose error typing nselfCLI.ts Add proper Error types Type safety
Missing toast dismiss 3 config pages Add auto-dismiss UX consistency
CLI output parsing validate/route.ts Refactor into helper Maintainability
Raw HTML in Vault vault/page.tsx Convert to shadcn Consistency

Deliverables:

  • All 8 issues resolved
  • New lint rules to prevent regressions
  • Code review checklist updated

1.2 TypeScript Strict Mode

Priority: High Goal: Enable strict mode across entire codebase

  • Enable strict: true in tsconfig.json
  • Fix all type errors (estimate: ~50-100)
  • Add return types to all exported functions
  • Remove all any types (replace with proper types)
  • Add strict null checks

Deliverables:

  • Zero TypeScript errors with strict mode
  • Type coverage report >95%

1.3 ESLint & Prettier Rules

Priority: Medium Goal: Enforce consistent code style

  • Add stricter ESLint rules:
  • no-console (except error/warn)
  • no-unused-vars with underscore exception
  • consistent-return
  • prefer-const
  • no-var
  • Configure Prettier line length (80 or 100)
  • Add import sorting rules
  • Pre-commit hook for lint+format

Deliverables:

  • Updated ESLint config
  • All files pass new rules
  • Git hooks configured

Phase 2: Critical Missing Features (Week 2)

2.1 Real-Time Updates

Priority: Critical Goal: Live updates without page refresh

What needs real-time:

  • Docker container status (running/stopped/healthy)
  • Service health checks
  • Build/deploy progress
  • Log streaming
  • Database query execution

Implementation:

  • WebSocket server setup (Socket.io already installed)
  • Client-side connection manager
  • Reconnection logic with exponential backoff
  • Presence tracking (who's online)
  • Event batching for efficiency

Files to create:

  • src/lib/websocket-server.ts - Server setup
  • src/lib/websocket-client.ts - Client hook
  • src/hooks/useRealtime.ts - React hook for components
  • src/app/api/ws/route.ts - WebSocket endpoint

Files to update:

  • Dashboard: Add real-time container status
  • Logs page: Stream logs instead of polling
  • Build page: Real-time build output
  • Deploy pages: Live deploy progress

Deliverables:

  • WebSocket infrastructure working
  • 5+ pages using real-time updates
  • Automatic reconnection tested
  • Performance: <100ms latency

2.2 Error Handling & Recovery

Priority: Critical Goal: Graceful error handling everywhere

Current problems:

  • API errors show generic "Failed" messages
  • No retry logic for failed requests
  • No offline mode detection
  • Errors don't include actionable guidance

Implementation:

  • Global error boundary component
  • API error interceptor with retry logic
  • Offline detection with banner
  • Error codes mapped to user messages
  • Error reporting (optional Sentry integration)

Files to create:

  • src/components/ErrorBoundary.tsx
  • src/lib/api-client.ts - Fetch wrapper with retry
  • src/lib/error-messages.ts - Error code mapping
  • src/components/OfflineBanner.tsx

Files to update:

  • All API route handlers: Consistent error format
  • All client API calls: Use new fetch wrapper
  • Layout: Add error boundary

Error format standard:

{
  success: false,
  error: {
    code: "DB_CONNECTION_FAILED",
    message: "Unable to connect to database",
    userMessage: "Check if PostgreSQL is running",
    action: "Run 'nself doctor' to diagnose",
    details: { /* ... */ }
  }
}

Deliverables:

  • Error boundary catches all React errors
  • API client retries failed requests (max 3)
  • Offline banner appears when network down
  • All error messages actionable

2.3 Loading States & Skeletons

Priority: High Goal: No blank screens or loading spinners

Current problems:

  • Many pages show blank while loading
  • Inconsistent loading indicators
  • No skeleton screens

Implementation:

  • Create skeleton components for each layout type
  • Add Suspense boundaries with skeletons
  • Optimistic UI updates where possible
  • Progressive loading for large datasets

Files to create:

  • src/components/skeletons/DashboardSkeleton.tsx
  • src/components/skeletons/TableSkeleton.tsx
  • src/components/skeletons/FormSkeleton.tsx
  • src/components/skeletons/CardGridSkeleton.tsx

Files to update:

  • Dashboard: Skeleton while loading
  • Database pages: Table skeleton
  • Config pages: Form skeleton
  • All list pages: Card grid skeleton

Deliverables:

  • All pages have skeleton states
  • Zero blank loading screens
  • Perceived load time <500ms

2.4 Session Management & Security

Priority: Critical Goal: Secure, persistent sessions

Current state:

  • Sessions expire after 24h (good)
  • No session refresh mechanism
  • No "remember me" option
  • No active session list

Implementation:

  • Session refresh before expiry
  • "Remember me" checkbox (30-day sessions)
  • Active sessions page (device, IP, last active)
  • Revoke session capability
  • CSRF token on all mutations
  • Rate limiting on auth endpoints

Files to create:

  • src/app/settings/sessions/page.tsx - Active sessions
  • src/app/api/auth/sessions/route.ts - List sessions
  • src/app/api/auth/sessions/revoke/route.ts - Revoke
  • src/lib/csrf.ts - CSRF token generation

Files to update:

  • src/lib/auth-db.ts: Add session refresh logic
  • Login page: Add "remember me" checkbox
  • All mutation API routes: Check CSRF token

Deliverables:

  • Sessions auto-refresh at 20h mark
  • Remember me works (30-day sessions)
  • Active sessions page functional
  • CSRF protection on all mutations
  • Rate limiting: 5 login attempts per minute

Phase 3: Testing & Quality (Week 3)

3.1 Unit Testing

Priority: High Goal: >80% test coverage

What to test:

  • All utility functions (src/lib/*)
  • All API route handlers
  • All React hooks
  • Critical components (forms, tables)

Setup:

  • Jest configured for Next.js 15
  • React Testing Library setup
  • Mock Docker API
  • Mock LokiJS database
  • Test coverage reporting

Test files to create (estimate: ~50 test files):

  • src/lib/__tests__/auth-db.test.ts
  • src/lib/__tests__/database.test.ts
  • src/lib/__tests__/project-utils.test.ts
  • src/lib/__tests__/nselfCLI.test.ts
  • src/app/api/auth/__tests__/login.test.ts
  • ... (all API routes)
  • src/components/__tests__/ErrorBoundary.test.tsx
  • ... (critical components)

Deliverables:

  • 80%+ code coverage
  • All critical paths tested
  • CI runs tests on every PR
  • Test documentation

3.2 E2E Testing

Priority: Medium Goal: Critical user flows tested

Flows to test:

  1. Login → Dashboard → View Services
  2. Login → Config → Edit .env → Save → Build
  3. Login → Database → Run Query
  4. Login → Deploy → Deploy to Staging
  5. Login → Logs → View Container Logs

Setup:

  • Playwright configured
  • Test database setup/teardown
  • Mock nself CLI for tests
  • Headless browser CI

Test files to create (estimate: ~10 test files):

  • e2e/auth.spec.ts - Login/logout flow
  • e2e/config.spec.ts - Config editing
  • e2e/database.spec.ts - Database queries
  • e2e/deploy.spec.ts - Deploy flow
  • e2e/services.spec.ts - Service management

Deliverables:

  • 5 critical flows tested
  • E2E tests run in CI
  • Screenshots on failure

3.3 Performance Testing

Priority: Medium Goal: Fast page loads, no jank

Metrics to achieve:

  • First Contentful Paint: <1s
  • Time to Interactive: <2s
  • Lighthouse Score: >90
  • Bundle size: <500KB gzipped

Optimizations:

  • Code splitting on route level
  • Dynamic imports for heavy components
  • Image optimization (next/image)
  • Font optimization
  • Remove unused dependencies
  • Lazy load icons (lucide-react tree-shaking)

Tools:

  • Lighthouse CI
  • Bundle analyzer
  • React DevTools Profiler

Deliverables:

  • Lighthouse score >90
  • Bundle size <500KB
  • Zero performance warnings

Phase 4: UX Polish (Week 4)

4.1 Mobile Responsiveness

Priority: High Goal: Usable on tablets, readable on phones

Current state:

  • Desktop-first design
  • Some pages overflow on mobile
  • Touch targets too small

Implementation:

  • Tablet breakpoint (768px): Usable UI
  • Mobile breakpoint (640px): Readable content
  • Touch-friendly buttons (min 44x44px)
  • Responsive tables (horizontal scroll or cards)
  • Mobile navigation (hamburger menu)

Pages to fix (priority order):

  1. Dashboard (most used)
  2. Services list
  3. Logs viewer
  4. Database console
  5. Config editor
  6. All other pages

Deliverables:

  • All pages usable on tablet
  • Dashboard + critical pages readable on mobile
  • Mobile navigation working

4.2 Accessibility (a11y)

Priority: High Goal: WCAG 2.1 AA compliance

Implementation:

  • Semantic HTML everywhere
  • Keyboard navigation working
  • Focus visible on all interactive elements
  • ARIA labels on icon buttons
  • Color contrast meets AA standard
  • Screen reader testing

Tools:

  • axe DevTools
  • NVDA/JAWS screen reader testing
  • Keyboard-only navigation testing

Deliverables:

  • Zero critical a11y issues
  • Keyboard navigation works everywhere
  • Screen reader friendly

4.3 Dark Mode

Priority: Medium Goal: Proper dark theme support

Current state:

  • next-themes installed
  • Some color inconsistencies

Implementation:

  • Audit all color usage
  • Define dark mode color palette
  • Fix hard-coded colors
  • Test all pages in dark mode
  • Add theme toggle in header

Deliverables:

  • Dark mode works on all pages
  • No color contrast issues
  • Smooth theme switching

4.4 Empty States & Onboarding

Priority: Medium Goal: Guide users through empty states

Current problems:

  • Empty pages show blank or "No data"
  • No guidance on what to do next

Implementation:

  • Empty state components for each section
  • Clear CTAs on empty states
  • First-time user tooltips
  • Onboarding checklist on dashboard
  • "What's Next" suggestions

Files to create:

  • src/components/EmptyState.tsx
  • src/components/OnboardingChecklist.tsx
  • src/components/Tooltip.tsx

Empty states needed:

  • No services running
  • No database backups
  • No plugins installed
  • No deployments
  • No logs available

Deliverables:

  • All empty states have CTAs
  • Onboarding checklist working
  • Tooltips on first visit

Phase 5: Documentation & Deployment (Week 5)

5.1 In-App Documentation

Priority: High Goal: Users can find help without leaving the app

Implementation:

  • Contextual help panels (? icon)
  • Command reference (already exists at /help)
  • Troubleshooting guide
  • FAQ section
  • Video tutorial links

Files to create:

  • src/app/help/troubleshooting/page.tsx
  • src/app/help/faq/page.tsx
  • src/app/help/videos/page.tsx
  • src/components/HelpPanel.tsx

Deliverables:

  • Help accessible from all pages
  • Troubleshooting guide covers 20+ issues
  • FAQ answers 30+ questions

5.2 README & Deployment Guide

Priority: High Goal: Clear setup instructions

Files to update:

  • README.md: Complete rewrite
  • docs/DEPLOYMENT.md: Production deployment guide
  • docs/DEVELOPMENT.md: Local dev setup
  • docs/ARCHITECTURE.md: Code structure guide

README sections:

  1. What is nself-admin
  2. Features
  3. Quick start (3 commands)
  4. Screenshots
  5. Documentation links
  6. Contributing guide

Deliverables:

  • README clear and complete
  • Deployment guide tested
  • Development guide tested

5.3 Docker Production Build

Priority: Critical Goal: Production-optimized Docker image

Current Dockerfile review:

  • Multi-stage build ✅
  • Alpine base ✅
  • Non-root user ✅

Optimizations needed:

  • Layer caching optimization
  • Smaller base image if possible
  • Health check endpoint
  • Graceful shutdown
  • Environment variable documentation

Files to update:

  • Dockerfile: Optimize
  • docker-compose.yml: Production example
  • .dockerignore: Exclude more files

Deliverables:

  • Docker image <600MB
  • Startup time <10s
  • Health check working
  • Graceful shutdown

5.4 CI/CD Pipeline

Priority: High Goal: Automated testing and deployment

GitHub Actions workflows:

  • Lint + Type Check (on PR)
  • Unit Tests (on PR)
  • E2E Tests (on PR)
  • Build (on PR)
  • Deploy to staging (on merge to main)
  • Release to Docker Hub (on tag)
  • GitHub Release creation (on tag)

Files to create:

  • .github/workflows/test.yml
  • .github/workflows/deploy.yml
  • .github/workflows/release.yml

Deliverables:

  • CI runs on every PR
  • Auto-deploy to staging
  • Auto-release on tag

Phase 6: Final Polish & Release (Week 6)

6.1 Performance Optimization

Priority: High Goal: Fast, smooth workflow

Optimizations:

  • Database query optimization
  • API response caching
  • Static asset caching
  • Bundle splitting
  • Lazy loading
  • Prefetching critical data

Deliverables:

  • All pages load <1s
  • Zero layout shift
  • Smooth animations

6.2 Security Audit

Priority: Critical Goal: Production-ready security

Checklist:

  • No secrets in code
  • CSRF protection enabled
  • Rate limiting on all auth endpoints
  • SQL injection prevention (parameterized queries)
  • XSS prevention (React escaping + CSP headers)
  • Command injection prevention (execFile only)
  • Session fixation prevention
  • Clickjacking prevention (X-Frame-Options)
  • HTTPS enforcement (production)
  • Security headers (Helmet.js)

Tools:

  • npm audit
  • OWASP ZAP
  • Snyk
  • Manual penetration testing

Deliverables:

  • Zero critical vulnerabilities
  • Security headers configured
  • Penetration test report

6.3 Monitoring & Logging

Priority: Medium Goal: Observable in production

Implementation:

  • Structured logging (Winston or Pino)
  • Error tracking (optional Sentry)
  • Performance monitoring (optional)
  • Health check endpoint improvements
  • Metrics endpoint (Prometheus format)

Files to create:

  • src/lib/logger.ts
  • src/app/api/metrics/route.ts
  • src/app/api/health/detailed/route.ts

Deliverables:

  • All errors logged with context
  • Health check reports all services
  • Metrics endpoint working

6.4 Release Preparation

Priority: Critical Goal: v0.5.0 ready to ship

Checklist:

  • All tech debt fixed
  • All tests passing
  • Documentation complete
  • CHANGELOG.md updated
  • Migration guide (v0.4 → v0.5)
  • Version bumped to 0.5.0
  • Docker build tested
  • Staging deployment tested

Files to update:

  • package.json: version 0.5.0
  • src/lib/constants.ts: VERSION = '0.5.0'
  • CHANGELOG.md: v0.5.0 release notes
  • docs/MIGRATION.md: v0.4 → v0.5 guide

Deliverables:

  • Release notes written
  • Migration guide tested
  • All blockers resolved

Success Metrics

Quantitative

  • Test Coverage: >80%
  • Lighthouse Score: >90
  • Bundle Size: <500KB gzipped
  • Page Load Time: <1s (FCP)
  • Type Coverage: >95%
  • Zero Critical Bugs: No P0/P1 issues
  • Docker Image: <600MB
  • API Response Time: <200ms (p95)

Qualitative

  • Mobile Usable: Can view dashboard on tablet
  • Error Messages: All actionable and clear
  • Documentation: User can self-serve
  • Accessibility: Keyboard navigation works
  • Security: Passes OWASP top 10 checklist

Version Bump Strategy

After v0.5.0 is released, future versions:

  • v0.5.x: Bug fixes, security patches
  • v0.6.0: New features (multi-user, RBAC)
  • v0.7.0: Environment switching (local/staging/prod)
  • v0.8.0: Advanced features (CI/CD gen, SDK gen)
  • v0.9.0: Final polish before 1.0
  • v1.0.0: Production-stable release

Timeline (6 Weeks)

Week Phase Deliverables Risk
1 Tech Debt & Code Quality 8 issues fixed, strict mode enabled Low
2 Critical Missing Features Real-time updates, error handling, loading states, sessions Medium
3 Testing & Quality 80% coverage, E2E tests, performance testing High
4 UX Polish Mobile responsive, a11y, dark mode, empty states Medium
5 Documentation & Deployment Docs complete, Docker optimized, CI/CD Low
6 Final Polish & Release Security audit, monitoring, release prep Medium

High Risk: Testing phase - may uncover bugs requiring fixes Medium Risk: Real-time updates - new infrastructure Low Risk: Documentation and polish - straightforward work


Post-Release (v0.5.1+)

Immediate Fixes (v0.5.1)

  • Any critical bugs discovered in v0.5.0
  • Security patches
  • Performance hotfixes

Near-Term Features (v0.6.0)

  • Multi-user support
  • Role-based access control (RBAC)
  • Team management
  • Invite system

Mid-Term Features (v0.7.0)

  • Environment switching UI (local/staging/prod)
  • Remote server management
  • SSH key management
  • Cross-environment sync

Conclusion

v0.5.0 is about completing the foundation and making nself-admin production-ready. After this release:

✅ Users can rely on it in production ✅ Codebase is maintainable and tested ✅ UX is polished and professional ✅ Security is hardened ✅ Documentation is complete

This sets up a solid foundation for adding advanced features in v0.6+ without constantly fixing tech debt.

Clone this wiki locally