|
| 1 | +# Twenty Server - Quick Start Guide |
| 2 | + |
| 3 | +Get Twenty Server up and running in minutes! |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +- Node.js 24.5.0+ |
| 8 | +- PostgreSQL 15+ |
| 9 | +- Redis 7+ |
| 10 | +- Yarn 4+ |
| 11 | + |
| 12 | +## 5-Minute Setup |
| 13 | + |
| 14 | +### 1. Start Required Services |
| 15 | + |
| 16 | +```bash |
| 17 | +# PostgreSQL |
| 18 | +docker run -d --name twenty-postgres \ |
| 19 | + -p 5432:5432 \ |
| 20 | + -e POSTGRES_PASSWORD=postgres \ |
| 21 | + -e POSTGRES_DB=twenty \ |
| 22 | + postgres:15 |
| 23 | + |
| 24 | +# Redis |
| 25 | +docker run -d --name twenty-redis \ |
| 26 | + -p 6379:6379 \ |
| 27 | + redis:7-alpine |
| 28 | +``` |
| 29 | + |
| 30 | +### 2. Configure Environment |
| 31 | + |
| 32 | +```bash |
| 33 | +cd packages/twenty-server |
| 34 | +cp .env.example .env |
| 35 | +``` |
| 36 | + |
| 37 | +Edit `.env`: |
| 38 | +```bash |
| 39 | +PG_DATABASE_URL=postgres://postgres:postgres@localhost:5432/twenty |
| 40 | +REDIS_URL=redis://localhost:6379 |
| 41 | +APP_SECRET=change_this_to_a_random_string |
| 42 | +FRONTEND_URL=http://localhost:3001 |
| 43 | +``` |
| 44 | + |
| 45 | +### 3. Initialize Database |
| 46 | + |
| 47 | +```bash |
| 48 | +npx nx database:reset twenty-server |
| 49 | +``` |
| 50 | + |
| 51 | +### 4. Start Server |
| 52 | + |
| 53 | +```bash |
| 54 | +npx nx start twenty-server |
| 55 | +``` |
| 56 | + |
| 57 | +Server runs at: `http://localhost:3000` |
| 58 | + |
| 59 | +## Test Your Setup |
| 60 | + |
| 61 | +### Health Check |
| 62 | +```bash |
| 63 | +curl http://localhost:3000/healthz |
| 64 | +``` |
| 65 | + |
| 66 | +### GraphQL Playground |
| 67 | +Open in browser: `http://localhost:3000/graphql` |
| 68 | + |
| 69 | +### Sample Query |
| 70 | +```graphql |
| 71 | +query GetWorkspace { |
| 72 | + currentWorkspace { |
| 73 | + id |
| 74 | + name |
| 75 | + } |
| 76 | +} |
| 77 | +``` |
| 78 | + |
| 79 | +## Next Steps |
| 80 | + |
| 81 | +- 📖 Read [README.md](./README.md) for comprehensive overview |
| 82 | +- 🏗️ See [ARCHITECTURE.md](./ARCHITECTURE.md) for architecture details |
| 83 | +- 🔌 Check [API.md](./API.md) for API reference |
| 84 | +- 💻 Follow [DEVELOPMENT.md](./DEVELOPMENT.md) for development guide |
| 85 | +- 📊 View [DIAGRAMS.md](./DIAGRAMS.md) for visual architecture |
| 86 | + |
| 87 | +## Common Commands |
| 88 | + |
| 89 | +```bash |
| 90 | +# Development |
| 91 | +npx nx start twenty-server # Start server |
| 92 | +npx nx run twenty-server:worker # Start background worker |
| 93 | + |
| 94 | +# Database |
| 95 | +npx nx database:reset twenty-server # Reset database |
| 96 | +yarn database:migrate:prod # Run migrations |
| 97 | + |
| 98 | +# Testing |
| 99 | +npx nx test twenty-server # Unit tests |
| 100 | +npx nx run twenty-server:test:integration:with-db-reset # Integration tests |
| 101 | + |
| 102 | +# Code Quality |
| 103 | +npx nx lint twenty-server --fix # Lint and fix |
| 104 | +npx nx typecheck twenty-server # Type check |
| 105 | +``` |
| 106 | + |
| 107 | +## Troubleshooting |
| 108 | + |
| 109 | +**Port 3000 in use?** |
| 110 | +```bash |
| 111 | +lsof -ti:3000 | xargs kill -9 |
| 112 | +# Or change NODE_PORT in .env |
| 113 | +``` |
| 114 | + |
| 115 | +**Database connection failed?** |
| 116 | +```bash |
| 117 | +docker ps | grep postgres |
| 118 | +docker start twenty-postgres |
| 119 | +``` |
| 120 | + |
| 121 | +**Redis connection failed?** |
| 122 | +```bash |
| 123 | +docker ps | grep redis |
| 124 | +docker start twenty-redis |
| 125 | +``` |
| 126 | + |
| 127 | +## Documentation Index |
| 128 | + |
| 129 | +All documentation is in `/packages/twenty-server/`: |
| 130 | + |
| 131 | +- **[DOCS.md](./DOCS.md)** - Documentation index |
| 132 | +- **[README.md](./README.md)** - Main documentation (24KB) |
| 133 | +- **[ARCHITECTURE.md](./ARCHITECTURE.md)** - Architecture deep-dive (18KB) |
| 134 | +- **[API.md](./API.md)** - Complete API reference (20KB) |
| 135 | +- **[DEVELOPMENT.md](./DEVELOPMENT.md)** - Development guide (22KB) |
| 136 | +- **[DIAGRAMS.md](./DIAGRAMS.md)** - Visual diagrams (20KB) |
| 137 | + |
| 138 | +## Support |
| 139 | + |
| 140 | +- 💬 Discord: [discord.gg/twenty](https://discord.gg/twenty) |
| 141 | +- 📧 Email: felix@twenty.com |
| 142 | +- 🐛 Issues: [GitHub Issues](https://github.com/twentyhq/twenty/issues) |
| 143 | + |
| 144 | +--- |
| 145 | + |
| 146 | +**Happy Coding! 🚀** |
0 commit comments