A production-ready, multi-tenant trucking collaboration platform built with Elixir Phoenix, Next.js, and Azure services.
- Real-time Chat: Phoenix Channels with typing indicators, presence tracking, and file sharing
- Geofencing: Location-based check-ins and facility entry/exit alerts
- Document Collaboration: Real-time document editing with Yjs CRDT and e-signatures
- Multi-tenant Architecture: Organization-scoped data with RBAC
- Azure Integration: Blob Storage, Cosmos DB, Azure AD B2C authentication
- Mobile Support: PWA with offline capabilities
- Language: Elixir
- Framework: Phoenix 1.7
- Database: Azure Cosmos DB
- Storage: Azure Blob Storage
- Auth: Azure AD B2C JWT verification
- Real-time: WebSockets via Phoenix Channels
- Framework: Next.js 14 with TypeScript
- Styling: Tailwind CSS + shadcn/ui components
- Auth: NextAuth.js with Azure AD B2C
- Real-time: Phoenix.js client for WebSocket connections
- Documents: CKEditor 5 with Yjs for collaborative editing
- Hosting: Azure Container Apps
- CDN: Azure Front Door
- Secrets: Azure Key Vault
- Monitoring: Azure Log Analytics + OpenTelemetry
- IaC: Bicep templates
- CI/CD: GitHub Actions
monorepo/
├── apps/
│ ├── api/ # Phoenix backend
│ ├── web/ # Next.js frontend
│ └── yjs-server/ # Node.js Yjs WebSocket server
├── infra/ # Bicep infrastructure templates
├── .github/ # CI/CD workflows
└── docs/ # Documentation and runbooks
- Elixir 1.15+ with Phoenix
- Node.js 18+ with npm
- Docker (for local development)
-
Clone and install dependencies:
git clone https://github.com/yourusername/ChatAzure.git cd ChatAzure
-
Backend setup:
cd monorepo/apps/api mix deps.get mix phx.server
-
Frontend setup:
cd monorepo/apps/web npm install npm run dev
-
Access the application:
- Frontend: http://localhost:3000
- Backend API: http://localhost:4000
- Demo chat: http://localhost:3000/app?demo=1
Copy .env.sample
files and configure:
- Azure AD B2C tenant settings
- Cosmos DB connection strings
- Blob Storage account keys
# Backend tests
cd monorepo/apps/api
mix test
# Frontend tests
cd monorepo/apps/web
npm test
-
Set up Azure resources:
cd infra az deployment group create --resource-group rg-chatazure --template-file main.bicep
-
Deploy with Azure Container Apps:
cd monorepo azd up
See docs/deployment.md
for detailed deployment instructions.
- Phoenix Channels for WebSocket communication
- Typing indicators and presence tracking
- File upload to Azure Blob Storage
- Message history with pagination
- Turf.js for client-side geofence validation
- Server-side location processing with hysteresis
- Check-in/check-out events with webhook publishing
- Real-time location updates
- Yjs CRDT for conflict-free collaborative editing
- CKEditor 5 integration
- PDF generation and e-signature workflow
- Version history and change tracking
- Organization-scoped data access
- Role-based permissions (owner, dispatcher, driver, clerk)
- JWT-based authentication with Azure AD B2C
- Row-level security patterns
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
For support, email support@chatazure.com or join our Discord community.