We value your privacy

We use cookies and analytics tools to improve your experience.

Privacy Policy · GDPR

Quick Start Guide

Get up to speed with the InsightPro codebase

Getting Started
How to work with the refactored system

1. Understanding the State Flow

The most important concept is the Single Source of Truth (SSOT) pattern:

RequestInsights (SSOT) → QuickFeedbackPath → Individual Steps → useProjectFormSteps → Backend

2. Adding a New Step

To add a new step to the creation flow:

  1. Create step component in components/request/quick/ or prototype/
  2. Add case to saveProjectStep.js validation function
  3. Import and render in QuickFeedbackPath or InDepthReviewPath
  4. Update TOTAL_STEPS constant
  5. Test with browser back/forward and refresh

3. Modifying Backend Functions

All backend functions follow this pattern:

// 1. Authenticate user

const base44 = createClientFromRequest(req);

const user = await base44.auth.me();

// 2. Validate input

const validation = validateInput(body);

// 3. Check permissions

const canAccess = checkPermissions(user, resource);

// 4. Perform operation

const result = await base44.entities.X.update(...);

// 5. Return success

return Response.json({ success: true, ... });

Common Patterns

Pattern 1: Controlled Components

All form steps use controlled components with local state:

const [title, setTitle] = useState(projectData?.title || "");

const [errors, setErrors] = useState({});

const handleContinue = () => {

if (!validate()) return;

onNext({ title, ... });

};

Pattern 2: No Page Reloads

Expert workflow uses state re-evaluation instead of reloads:

const onSuccess = async () => {

await initializeWorkflow(); // Re-evaluate state

};

// NOT: window.location.reload();

Pattern 3: Permission Checking

Always verify permissions in backend functions:

const canEdit = (

project.requester_id === user.id ||

user.role === 'admin' ||

(project.organization_id === user.organization_id &&

['admin', 'project_creator'].includes(user.organization_role))

);

Do's and Don'ts

DO

  • ✓Use the useProjectFormSteps hook for multi-step forms
  • ✓Validate data on both frontend and backend
  • ✓Update state through callbacks, not direct mutations
  • ✓Handle loading and error states properly
  • ✓Use initializeWorkflow() to re-evaluate expert state
  • ✓Check permissions in every backend function

DON'T

  • ✗Use window.location.reload() - breaks state
  • ✗Create projects directly in step components
  • ✗Bypass the saveProjectStep function
  • ✗Store sensitive data in URL parameters
  • ✗Skip validation "just this once"
  • ✗Assume user is authenticated without checking
Debugging Tips
Common Issues & Solutions:

Project created multiple times

→ Check that handleStepComplete is only called once per submission

State not updating after save

→ Verify setProjectData() is called with backend response

Expert stuck in workflow state

→ Check database directly - may be missing NDA signature or acceptance

File upload fails silently

→ Check browser console for CORS errors or file size limits

Next Steps
  • 1
    Read the full System Architecture documentation
  • 2
    Test the creator flow end-to-end
  • 3
    Test the expert flow with different scenarios
  • 4
    Review backend function error handling
  • 5
    Set up monitoring and logging for production