## Summary Completely rewrites the development environment setup script to be more robust, idempotent, and flexible. The new implementation auto-detects available services (local PostgreSQL/Redis vs Docker), provides multiple operational modes, and includes comprehensive health checks and error handling. ## Key Changes - **Enhanced setup script** (`packages/twenty-utils/setup-dev-env.sh`): - Added auto-detection logic to prefer local services (PostgreSQL 16, Redis) over Docker - Implemented service health checks with retry logic (30s timeout) - Added command-line flags: `--docker` (force Docker), `--down` (stop services), `--reset` (wipe data) - Improved error handling with `set -euo pipefail` and descriptive failure messages - Added helper functions for service detection, startup, and status checking - Fallback to manual `.env` file copying if Nx is unavailable - Enhanced output with clear status messages and usage instructions - **New Docker Compose file** (`packages/twenty-docker/docker-compose.dev.yml`): - Dedicated development infrastructure file (PostgreSQL 16 + Redis 7) - Includes health checks for both services - Configured with appropriate restart policies and volume management - Separate from production compose configuration - **Updated documentation** (`CLAUDE.md`): - Clarified that all environments (CI, local, Claude Code, Cursor) use the same setup script - Documented new command-line flags and their purposes - Noted that CI workflows manage services independently via GitHub Actions - **Updated Cursor environment config** (`.cursor/environment.json`): - Simplified to use the new unified setup script instead of complex inline commands ## Implementation Details The script now follows a clear three-phase approach: 1. **Service startup** — Auto-detects and starts PostgreSQL and Redis (local or Docker) 2. **Database creation** — Creates 'default' and 'test' databases 3. **Environment configuration** — Sets up `.env` files via Nx or direct file copy The auto-detection logic prioritizes local services for better performance while gracefully falling back to Docker if local services aren't available. All operations are idempotent and safe to run multiple times. https://claude.ai/code/session_01UDxa2Kp1ub9tTL3pnpBVFs --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|---|---|---|
| .cursor | ||
| .github | ||
| .vscode | ||
| .yarn | ||
| packages | ||
| .dockerignore | ||
| .gitattributes | ||
| .gitignore | ||
| .mcp.json | ||
| .nvmrc | ||
| .yarnrc.yml | ||
| CLAUDE.md | ||
| jest.preset.js | ||
| LICENSE | ||
| nx.json | ||
| package.json | ||
| README.md | ||
| tsconfig.base.json | ||
| yarn.config.cjs | ||
| yarn.lock | ||
The #1 Open-Source CRM
🌐 Website · 📚 Documentation · Roadmap ·
Discord ·
Figma
Installation
See: 🚀 Self-hosting 🖥️ Local Setup
Why Twenty
We built Twenty for three reasons:
CRMs are too expensive, and users are trapped. Companies use locked-in customer data to hike prices. It shouldn't be that way.
A fresh start is required to build a better experience. We can learn from past mistakes and craft a cohesive experience inspired by new UX patterns from tools like Notion, Airtable or Linear.
We believe in Open-source and community. Hundreds of developers are already building Twenty together. Once we have plugin capabilities, a whole ecosystem will grow around it.
What You Can Do With Twenty
Please feel free to flag any specific needs you have by creating an issue.
Below are a few features we have implemented to date:
- Personalize layouts with filters, sort, group by, kanban and table views
- Customize your objects and fields
- Create and manage permissions with custom roles
- Automate workflow with triggers and actions
- Emails, calendar events, files, and more
Personalize layouts with filters, sort, group by, kanban and table views
Customize your objects and fields
Create and manage permissions with custom roles
Automate workflow with triggers and actions
Emails, calendar events, files, and more
Stack
- TypeScript
- Nx
- NestJS, with BullMQ, PostgreSQL, Redis
- React, with Jotai, Linaria and Lingui
Thanks
Thanks to these amazing services that we use and recommend for UI testing (Chromatic), code review (Greptile), catching bugs (Sentry) and translating (Crowdin).
Join the Community
- Star the repo
- Subscribe to releases (watch -> custom -> releases)
- Follow us on Twitter or LinkedIn
- Join our Discord
- Improve translations on Crowdin
- Contributions are, of course, most welcome!