nyxcore-systems
6 min read

From Zero to Onboard: Conquering 18 Project Onboarding Features in One Epic Sprint

A deep dive into our recent sprint where we implemented 18 comprehensive project onboarding features, from robust data models and security to intelligent LLM integrations and a seamless user experience. We'll share the triumphs, the unexpected challenges, and the critical lessons learned, especially when working with LLM-generated development plans.

fullstackdevelopmentprismatrpcllmgithubonboardingtypescriptnextjsengineering

It’s always a great feeling to hit a significant milestone, and this past sprint delivered exactly that! We set out with an ambitious goal: to implement all 18 project-onboarding plans from workflow 20919e29-32ec-42f2-a67e-cab79081de5c. And I'm thrilled to report: mission accomplished!

In a concentrated burst of development, we've successfully brought to life a robust and intelligent new project onboarding system. This wasn't just about adding a few fields; it involved a complete overhaul of how users bring their projects into our platform, integrating everything from secure data models to AI-driven insights.

The Mission: A Seamless Onboarding Experience

Our primary objective was to create a smooth, guided experience for users to integrate their projects. This meant building out several key areas:

  • Data Foundation: New Prisma models and robust Row Level Security (RLS).
  • Intuitive UI: A multi-step onboarding wizard and a detailed file explorer.
  • Core Services: GitHub integration, file scanning, and advanced tech detection.
  • Intelligent Automation: LLM-powered project summaries and README generation.
  • Real-time Feedback: Server-Sent Events (SSE) for live onboarding progress.

We tackled this beast in three distinct batches, each building on the last, culminating in a comprehensive Pull Request ready for review.

The Building Blocks: What We Shipped

Here’s a breakdown of the major components we implemented, showcasing the breadth of work involved:

Batch 1: Laying the Secure Foundation (Commit 2277151)

The initial phase focused on establishing the core data structures and foundational UI elements. We introduced:

  • A brand new "Letters" tab on the project detail page, setting the stage for rich content.
  • Crucial ProjectOnboarding and ProjectFile Prisma models, complete with Row Level Security (RLS) to ensure data privacy and integrity.
  • A demo applications catalog (DEMO_PROJECTS) to give users a quick start.
  • A robust RAG sanitizer (src/lib/security/rag-sanitizer.ts) with 9 dedicated tests, enhancing the security of our Retrieval-Augmented Generation processes.

Batch 2: The Core Onboarding Flow & Intelligence (Commit 23b6680)

This batch brought the heart of the onboarding system to life, focusing on the user journey and backend services:

  • A slick, three-step Onboarding Wizard (/dashboard/projects/new) guiding users through Source, Configure, and Analyze stages.
  • Seamless GitHub repository creation and branch listing mutations, connecting directly to users' codebases.
  • A dedicated file scanner service (project-scanner-service.ts) to parse project structures.
  • An intelligent tech detector (tech-detector.ts) with 18 tests, capable of identifying technologies used within a project.
  • A real-time SSE endpoint (/api/v1/events/onboarding/[projectId]) to provide live updates on the onboarding process.
  • The analysis pipeline orchestrator and a critical analysis watchdog (with a 15-minute timeout) to manage the complex analysis workflow.

Batch 3: LLM Magic & UI Polish (Commit e44f5d7)

The final push added intelligence, polish, and essential UI components:

  • A fully functional file explorer (getFileTree + FilesTab), allowing users to browse their project's structure directly.
  • LLM-powered project summary generation to instantly grasp the essence of a project.
  • LLM-driven README skeleton generation, helping users kickstart their documentation.
  • A versatile markdown editor component with templates for rich content creation.
  • A user-friendly branch picker component for easy branch selection.
  • A setDefaultBranch mutation for project configuration.
  • A new summary field on the Project model to store the LLM-generated project overview.

All 27 new tests (9 RAG sanitizer + 18 tech detector) are passing, and TypeScript compiles clean, affirming the quality of our work. The entire feature now resides on the feat/project-onboarding branch, ready for review in PR #134.

Lessons Learned: Navigating the Treacherous Waters

No ambitious sprint is without its challenges, and this one offered some valuable lessons, especially at the intersection of AI assistance and real-world codebases.

1. LLM-Generated Plans: Powerful, but Validate Relentlessly!

We experimented with using LLM-generated development plans for some features. While incredibly useful for brainstorming and initial structure, a critical lesson emerged: always validate LLM-generated plans against your actual codebase and architectural patterns.

  • The Problem: The LLM, despite its intelligence, often made assumptions based on generic best practices or slightly outdated patterns. For instance, it suggested paths like src/server/api/routers/ when our actual structure uses src/server/trpc/routers/. It also defaulted to ctx.session.user.id for authentication, while our system uses ctx.user.id. Even more critically, it sometimes suggested recreating existing infrastructure like auth middleware, SSE hooks, or rate limiting that we already had in place.
  • The Workaround & Lesson: We learned to treat LLM plans as excellent starting points, but every suggestion required a thorough "codebase-first" review. We adapted plans to extend existing patterns, leveraging our protectedProcedure/mutationProcedure/llmMutationProcedure chains and resolveGitHubToken() for BYOK tokens, and integrating with our existing tabs-based InPageSidebar rather than creating new route-based pages.
  • Key Takeaway: LLMs are phenomenal assistants, but they are not infallible architects. Human oversight, deep understanding of the existing system, and a critical eye are indispensable for integrating their suggestions effectively.

2. tRPC v11 & React Query v5 Nuances

Keeping up with framework updates is a constant in web development. We hit a small snag trying to use keepPreviousData in useQuery options.

  • The Problem: keepPreviousData is a valid option in older versions of React Query (v4), but not in React Query v5 (which tRPC v11 leverages).
  • The Workaround & Lesson: Simply removing the option resolved the issue. It's a good reminder to always check the documentation for the specific versions of libraries you're using, as options and behaviors can evolve.

3. Local Database Environment Setup

A classic developer headache!

  • The Problem: While implementing new Prisma models, running npx prisma db push locally failed because the database wasn't running. (P1001: Can't reach database server).
  • The Workaround & Lesson: This was a simple fix: ensure the local Docker environment is up (npm run docker:up) before attempting database operations. For now, the schema changes are committed, and db push will be handled during deployment.

Current State & What's Next

The feat/project-onboarding branch is now 3 commits ahead of main, with PR #134 open and ready for review. Our Prisma schema includes the new ProjectOnboarding, ProjectFile models, and the summary field on Project. Additionally, prisma/rls.sql has been updated with policies for the new tables.

Once merged, the immediate next steps involve:

  1. Deployment & Database Migrations: Running npx prisma db push, npx prisma generate, and applying prisma/rls.sql on production.
  2. Pipeline Orchestration: Wiring up the analysis pipeline TODO stubs to connect our scanner, tech detector, and summary generation services.
  3. End-to-End Testing: Adding robust E2E tests for the entire onboarding wizard flow to ensure stability.
  4. UI Integration: Connecting the MarkdownEditor and BranchPicker components to the project settings UI for full configurability.
  5. Personalized Keys: Wiring userId through resolveProvider() calls in summary/readme services to support personal BYOK (Bring Your Own Key) access.

This sprint was a testament to focused effort and collaborative problem-solving. We've laid a fantastic foundation for a more intelligent and user-friendly project onboarding experience. I'm excited to see this feature go live and empower our users even further!