A web-based reactive document platform with real-time computation and collaboration features.
- Reactive Documents: Real-time document editing with live computation
- Kanban Boards: Interactive project management with drag-and-drop
- Variable System: Dynamic variables with formula support
- Real-time Collaboration: WebSocket-based real-time updates
- Responsive Design: Mobile-friendly interface with touch support
- Offline Support: Service worker for offline functionality
- Type Safety: Full TypeScript support across the stack
- Testing: Comprehensive test coverage with Vitest and Jest
- Production Ready: Docker containerization with security best practices
dataflow/
├── apps/
│ ├── api/ # NestJS backend API (Node.js 22 + TypeScript)
│ └── web/ # React frontend application (Vite + TypeScript)
├── packages/
│ ├── shared/ # Shared utilities and constants
│ └── types/ # TypeScript type definitions
├── docker/
│ └── postgres/ # Database initialization scripts
├── nginx/ # Nginx configuration for SSL (optional)
├── docker-compose.yml # Development environment
├── docker-compose.prod.yml # Production environment
├── Makefile
└── package.json
- Node.js 22+ and npm 10+
- Docker and Docker Compose (v2.0+)
- Make (optional, for using Makefile commands)
- Git for version control
- Clone the repository:
git clone <repository-url>
cd dataflow- Install dependencies:
# Using npm workspaces
npm install --legacy-peer-deps
# Or using Make
make install- Start the development environment:
# Start all services (recommended)
make dev
# Or manually
docker-compose up -d postgres redis
npm run dev- Access the applications:
- Web app: http://localhost:3001
- API: http://localhost:3000
- API docs: http://localhost:3000/api
- Adminer (DB UI): http://localhost:8080
For production deployment, see the Docker Production Deployment Guide.
Quick production setup:
# Copy environment template
cp .env.production.template .env.production
# Edit environment variables
nano .env.production
# Deploy to production
docker-compose -f docker-compose.prod.yml --env-file .env.production up -d# Show all available commands
make help
# Development
make dev # Start all services in dev mode
make dev-api # Start only API in dev mode
make dev-web # Start only web app in dev mode
# Building
make build # Build all packages
make build-api # Build only API
make build-web # Build only web app
# Docker Development
make docker-up # Start all Docker services
make docker-down # Stop all Docker services
make docker-logs # View Docker logs
make docker-logs-api # View API logs only
# Production
make prod-build # Build production Docker images
make prod-up # Start production services
make prod-down # Stop production services
make prod-logs # View production logs
# Database
make db-migrate # Run migrations
make db-migrate-generate # Generate new migration
make shell-db # Open PostgreSQL shell
# Testing & Quality
make test # Run all tests
make test-coverage # Run tests with coverage
make lint # Run linter
make typecheck # Run type checking
make clean # Clean build artifacts# Development
npm run dev # Start all services
npm run api:dev # Start API only
npm run web:dev # Start web only
# Building
npm run build # Build all packages
# Testing & Quality
npm run test # Run tests
npm run test:e2e # Run end-to-end tests
npm run lint # Run linter
npm run typecheck # Type check- NestJS - Node.js framework
- TypeScript - Type-safe JavaScript
- PostgreSQL - Primary database
- Redis - Caching and real-time features
- TypeORM - Database ORM
- WebSocket - Real-time communication
- JWT - Authentication
- Jest - Testing framework
- React 18 - UI framework
- TypeScript - Type-safe JavaScript
- Vite - Build tool and dev server
- TanStack Query - Data fetching
- Zustand - State management
- React Router - Client-side routing
- CodeMirror - Code editor
- Tailwind CSS - Styling
- Vitest - Testing framework
- Playwright - E2E testing
- Docker - Containerization
- Docker Compose - Multi-container orchestration
- Nginx - Reverse proxy and static file serving
- Alpine Linux - Minimal container base
The development environment uses docker-compose.yml with default settings that work out of the box.
For production, copy the environment template:
cp .env.production.template .env.productionEdit the production environment variables:
# Database Configuration
POSTGRES_USER=dataflow
POSTGRES_PASSWORD=your_secure_database_password_here
POSTGRES_DB=dataflow_db
# Redis Configuration
REDIS_PASSWORD=your_secure_redis_password_here
# JWT Configuration
JWT_SECRET=your_jwt_secret_key_at_least_32_characters_long
JWT_EXPIRES_IN=24h
# CORS Configuration
CORS_ORIGIN=https://yourdomain.com
# Port Configuration
WEB_PORT=80Important: Never use default passwords in production!
The project includes a complete Docker setup with:
- PostgreSQL database
- Redis for caching and real-time features
- Adminer for database management
- API container with health checks
To run everything in Docker:
make docker-up
# or
docker-compose up -dProduction deployment uses docker-compose.prod.yml with:
- Security hardening (non-root users, health checks)
- Environment variable configuration
- Nginx for static file serving
- SSL support (optional)
See the Docker Production Deployment Guide for detailed instructions.
# Run all tests
npm run test
# Run tests with coverage
npm run test:coverage
# Run specific package tests
npm run test --workspace=@dataflow/api
npm run test --workspace=@dataflow/web
# Run e2e tests
npm run test:e2e --workspace=@dataflow/web- Unit Tests: Jest/Vitest for component and service testing
- Integration Tests: API endpoint testing
- E2E Tests: Playwright for full application testing
- Performance Tests: Load testing for critical paths
The project enforces code quality through:
- ESLint: Code linting with TypeScript support
- Prettier: Code formatting
- TypeScript: Type checking
- Husky: Git hooks for pre-commit checks
# Development
npm run dev # Start all services
npm run api:dev # Start API only
npm run web:dev # Start web only
# Building
npm run build # Build all packages
npm run clean # Clean build artifacts
# Code Quality
npm run lint # Run linter
npm run typecheck # Run TypeScript checks
npm run test # Run testsIf you get port conflict errors, make sure no other services are running on ports:
- 3000 (API)
- 3001 (Web dev server)
- 5432 (PostgreSQL)
- 6379 (Redis)
- 8080 (Adminer)
If you encounter build errors:
- Clean the project:
make clean - Reinstall dependencies:
npm install --legacy-peer-deps - Rebuild:
npm run build
Ensure PostgreSQL is running:
docker-compose psCheck logs:
make docker-logsTest database connection:
docker exec -it dataflow-postgres psql -U dataflow -d dataflow_dbEnsure you're using Node.js 22+:
node --version # Should be 22.x.xUse nvm to switch versions:
nvm use 22- Check query performance in adminer
- Review API logs for slow queries
- Consider adding database indexes
- Monitor container memory usage:
docker stats - Adjust container memory limits if needed
- Check for memory leaks in application logs
- Check the logs:
make docker-logs - Review the Docker Production Deployment Guide
- Verify environment configuration
- Check GitHub issues for similar problems
- 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
- Follow TypeScript best practices
- Write tests for new features
- Update documentation as needed
- Follow the existing code style
- Run linting and tests before committing
Nobody cares