Skip to content

Conversation

seb-lewis
Copy link

@seb-lewis seb-lewis commented Aug 10, 2025

This PR modernizes the stack and repo structure:

  • Replaces legacy auth with Better Auth (incl. Google SSO)
  • Migrates from Prisma to Drizzle ORM/Drizzle Kit
  • Targets Cloudflare Workers/Pages with Wrangler-based env management
  • Converts the repo to a pnpm/turbo monorepo
  • Adopts TypeScript across web and API
  • Centralizes options/dropdown values and visual classes for consistent UI rendering
  • Updates docs and scripts accordingly

Highlights

  • Auth
    • Better Auth integration; Google OAuth via env.
    • Shared auth client/server utilities in apps/web/src/lib.
  • Database
    • Drizzle ORM + Drizzle Kit migrations in shared/database.
    • Removes Prisma and legacy migrations.
    • Seed scripts: shared/database/scripts/*.
  • Runtime
    • Cloudflare Workers/Pages ready.
    • Env via wrangler.jsonc and .dev.vars for local dev.
  • Monorepo
    • pnpm workspaces + Turborepo.
    • Structure: apps/web, apps/api, shared/database, shared/constants.
    • Root scripts to run apps via filters.
  • TypeScript
    • Web/API converted to TS.
    • SvelteKit Svelte 5 runes syntax retained (base branch).
  • UI data model
    • Centralized lookups and options with standardized { value, label }.
    • Visual maps for statuses/ratings/priorities (icons + colors) used directly in Svelte.
    • Removes scattered inline arrays and per-page helpers.
  • Docs
    • README.md and DEV.md updated for monorepo, Drizzle, and env management.

Breaking changes

  • Prisma removed; use Drizzle for schema/migrations.
  • Environment variables now managed via Wrangler (wrangler.jsonc / .dev.vars).
  • Scripts relocated to root; per-app scripts run via pnpm filters.
  • API/web paths moved under apps/.

Migration steps

# Install workspace deps
pnpm install

# Configure local environment
cp shared/database/.env.example shared/database/.env
# Add DATABASE_URL, JWT_SECRET, GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET to apps/web/.dev.vars

# Generate and run migrations
pnpm db:generate
pnpm db:migrate:local

# Run apps
pnpm web:dev
pnpm api:dev

Env configuration

  • Local: add secrets to apps/web/.dev.vars.
  • Production: use Cloudflare Secrets Store and Hyperdrive.

Verification checklist

  • Auth: Google SSO flow works end-to-end.
  • DB: Drizzle migrations run; schema accessible; seed scripts succeed.
  • Web: Options/visual maps render correctly across Leads, Opportunities, Tasks, Cases.
  • API: Endpoints run under apps/api.
  • Build/Run: pnpm web:dev and pnpm api:dev work locally.

Follow-ups

  • If any remaining inline option arrays exist, convert them to the centralized options APIs for full consistency.

ashwin31 and others added 30 commits April 10, 2025 19:01
- Created pages for viewing account activities, contacts, files, notes, and opportunities.
- Implemented account deletion logic with checks for related records.
- Added user interface for confirming account deletion, including warnings about related data.
- Enhanced error handling for account deletion process.
…ment forms

- Added a new banner image to the assets.
- Updated the layout to utilize props for children rendering and state management.
- Enhanced the sidebar with dynamic classes for active links and improved item structure.
- Modified lead edit and new pages to include organization handling and additional lead fields.
- Improved form validation and user feedback with toast notifications on successful lead creation.
- Updated open leads page to display lead titles and improved layout for better readability.
- Removed dark mode toggle functionality from site layout for a cleaner interface.
- Adjusted site landing page to include a banner image and refined call-to-action sections.
…n, filtering, and UI updates

- Added form validation for required fields and email/phone formats in lead creation.
- Implemented dynamic error messages for form fields.
- Improved UI with transitions and better layout for lead creation form.
- Added search and status filter functionality in the open leads page.
- Introduced sorting options for leads based on various fields.
- Updated lead listing to show relative time for creation date.
- Enhanced mobile view for lead details with better information display.
- Adjust header styles for better visibility and spacing
- Update button styles for consistent hover effects
- Revamp lead summary card with new gradient background and layout
- Improve contact information display with better spacing and icons
- Refine lead details section with enhanced styling for clarity
- Update timeline section with visual indicators for events
- Enhance comments and tasks sections with improved layouts and empty states
- Add new event button and styling for events section
…and user retrieval

- Implemented GET endpoint to fetch task details and comments for a specific task.
- Added PATCH endpoint to assign or unassign users to tasks.
- Created POST endpoint for adding comments to tasks.
- Introduced PATCH endpoint for updating task due dates.
- Added GET endpoint to retrieve users associated with a board's organization.
- Developed server-side logic for a task calendar view, fetching both CRM and Kanban tasks.
- Created a Svelte component for displaying tasks in a calendar format.
- Established a placeholder for classic task list view and server logic.
- Removed outdated product, sidebar, and user data JSON files.
… handling with user authentication, and improve sidebar navigation
refactor: update input elements to include 'for' attributes in edit forms
fix: adjust kanban task card styles for better interaction
- Create layout for admin site with navigation
- Implement admin dashboard with blog management card
- Add server-side logic to load blog posts and handle deletions
- Create blog post listing page with delete confirmation modal
- Implement edit functionality for existing blog posts
- Add new blog post creation page with form validation and slug generation
ashwin31 and others added 29 commits June 18, 2025 12:06
…entation, including technology stack, development commands, and architecture overview
- Implemented `/dashboard` endpoint to retrieve dashboard metrics and recent data.
- Added `/dashboard/metrics` endpoint for lightweight metrics retrieval.
- Created Swagger documentation for both endpoints.

feat: add leads metadata endpoint

- Introduced `/leads/metadata` endpoint to provide lead statuses, sources, ratings, and industries.
- Updated Swagger documentation for leads metadata.

feat: create tasks API with CRUD operations and comments

- Added `/tasks` endpoint for retrieving and creating tasks with filtering options.
- Implemented task detail retrieval, updating, and deletion endpoints.
- Introduced comments functionality for tasks with associated endpoints.
- Updated Swagger documentation for tasks API.

feat: add JwtToken model to Prisma schema

- Created `JwtToken` model to store JWT tokens with relevant fields.
- Added necessary migrations for the new model.

chore: update server to include new routes

- Integrated dashboard and tasks routes into the main server file.
- Set trust proxy for rate limiting.
…ion; improve error handling for organization name submission
…omponents

- Added type annotations for `data` and `form` in multiple Svelte components to enhance type safety.
- Improved handling of optional chaining and default values for various properties in forms and data structures.
- Refactored date formatting functions to ensure consistent handling of date inputs.
- Enhanced validation logic for form submissions, ensuring required fields are checked and valid enum values are enforced.
- Updated opportunity closing logic to handle potential null values and ensure correct data types are used.
- Improved user role management in the users page, simplifying role handling and ensuring only relevant roles are displayed.
- General code cleanup and organization for better readability and maintainability.
… create functionalities

- Added server-side logic for loading and displaying individual invoices.
- Enhanced invoice view page with detailed information and improved styling.
- Created edit functionality for invoices with form validation and data handling.
- Developed new invoice creation page with dynamic line item management and validation.
- Integrated account selection and status management in invoice forms.
…workers; convert to pnpm/turbo monorepo; standardize TypeScript, shared options/lookups, and visual maps across app; update docs and root scripts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants