Full-stack microscopy automation platform with Vue.js frontend, NestJS backend, and Python camera service.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Vue 3 Frontend โ
โ (Vite + TypeScript + Tailwind) โ
โ Port: 5173 โ
โโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ HTTP/WebSocket
โโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ NestJS Backend โ
โ (TypeScript + TypeORM + JWT) โ
โ Port: 3000 โ
โโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโ
โ โ
โ PostgreSQL โ HTTP
โผ โผ
โโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ PostgreSQL DB โ โ Python Camera Service โ
โ (User data, jobs, โ โ (FastAPI + Pixelink SDK) โ
โ images metadata) โ โ Port: 8001 โ
โโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโ
โ USB/SDK
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Pixelink Camera โ
โ (Hardware Control) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
CompuCyto/
โโโ frontend-vue/ # Vue 3 + Vite frontend
โ โโโ src/
โ โ โโโ components/ # UI components
โ โ โโโ composables/ # Vue composables
โ โ โโโ stores/ # Pinia state management
โ โ โโโ views/ # Page views
โ โ โโโ api/ # API client
โ โโโ package.json
โ
โโโ Nest/ # NestJS backend
โ โโโ src/
โ โ โโโ auth/ # Authentication module
โ โ โโโ camera/ # Camera proxy service
โ โ โโโ stage/ # Stage control
โ โ โโโ images/ # Image management
โ โ โโโ users/ # User management
โ โ โโโ config/ # Configuration
โ โโโ package.json
โ
โโโ backend-python/ # Python camera service
โ โโโ main.py # FastAPI application
โ โโโ pixelink_camera.py # Camera SDK wrapper
โ โโโ config.py # Configuration
โ โโโ requirements.txt
โ
โโโ Documentation/ # Project documentation
โโโ package.json # Root workspace config
- Node.js 18+ and npm
- Python 3.9+
- PostgreSQL 14+
- Pixelink SDK (for camera control)
- Git
# Clone the repository
git clone <your-repo-url>
cd CompuCyto
# Install all dependencies (Node.js workspaces)
npm install
# Setup Python environment
npm run setup:python
# Configure environment variables (see Configuration section below)
# Edit Nest/.env and backend-python/.env
# Run all services in development mode
npm run devThis will start:
- ๐จ Frontend at http://localhost:5173
- ๐ง Backend at http://localhost:3000
- ๐ท Camera service at http://localhost:8001
npm installThis installs dependencies for both frontend and backend using npm workspaces.
cd backend-python
# Create virtual environment
python -m venv venv
# Activate virtual environment
# Windows:
venv\Scripts\activate
# Linux/Mac:
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt# Install PostgreSQL if not already installed
# Create database
createdb compucyto
# Or using psql:
psql -U postgres
CREATE DATABASE compucyto;
\q# Database
DATABASE_HOST=localhost
DATABASE_PORT=5432
DATABASE_USER=postgres
DATABASE_PASSWORD=your_password
DATABASE_NAME=compucyto
# JWT
JWT_SECRET=your-super-secret-jwt-key-change-this
JWT_EXPIRATION=24h
# Server
PORT=3000
NODE_ENV=development
# Python Camera Service
PYTHON_CAMERA_URL=http://localhost:8001
SERVICE_TIMEOUT=30000# Server
HOST=0.0.0.0
PORT=8001
DEBUG=True
# Camera
CAMERA_SERIAL_NUMBER=
DEFAULT_EXPOSURE=100
DEFAULT_GAIN=1.0
IMAGE_SAVE_PATH=./captures
IMAGE_FORMAT=jpg
IMAGE_QUALITY=95
# CORS
ALLOWED_ORIGINS=http://localhost:3000,http://localhost:5173cd Nest
npm run typeorm:run-migrationsRun all services together:
npm run devOr run individually:
# Frontend only
npm run dev:frontend
# Backend only
npm run dev:backend
# Python camera service only
npm run dev:python# Build all
npm run build
# Start all services
npm run startFrom root directory:
| Command | Description |
|---|---|
npm install |
Install all dependencies |
npm run setup:python |
Setup Python virtual environment |
npm run dev |
Run all services in development mode |
npm run dev:frontend |
Run Vue frontend only |
npm run dev:backend |
Run NestJS backend only |
npm run dev:python |
Run Python camera service only |
npm run build |
Build all services |
npm run start |
Start all services in production mode |
- Frontend: See
frontend-vue/README.md - Backend: See
Documentation/NESTJS_BACKEND_SPECIFICATION.md - Camera Service: See
backend-python/README.md - API Documentation:
- NestJS: http://localhost:3000/api (Swagger)
- Python: http://localhost:8001/docs (FastAPI)
POST /api/v1/auth/register- Register new userPOST /api/v1/auth/login- LoginGET /api/v1/auth/profile- Get user profile
POST /api/v1/camera/capture- Capture imageGET /api/v1/camera/settings- Get camera settingsPUT /api/v1/camera/settings- Update settingsGET /api/v1/camera/preview- Get video stream URL
POST /api/v1/stage/move- Move stageGET /api/v1/stage/position- Get current positionPOST /api/v1/stage/home- Home stage
GET /api/v1/images- List imagesGET /api/v1/images/:id- Get image detailsDELETE /api/v1/images/:id- Delete image
cd Nest
npm run test
npm run test:e2ecd frontend-vue
npm run test- Verify Pixelink SDK is installed
- Check USB connection
- Try specifying
CAMERA_SERIAL_NUMBERinbackend-python/.env - Check camera works with Pixelink Capture software
- Verify PostgreSQL is running
- Check credentials in
Nest/.env - Ensure database exists:
createdb compucyto
Change ports in respective .env files:
- Frontend:
vite.config.tsโserver.port - Backend:
Nest/.envโPORT - Python:
backend-python/.envโPORT
Add your frontend URL to:
Nest/src/main.tsโ CORS configurationbackend-python/.envโALLOWED_ORIGINS
- Change
JWT_SECRETin production - Use strong database passwords
- Don't commit
.envfiles - Enable HTTPS in production
- Restrict CORS origins
# Coming soon - Docker Compose configuration
docker-compose up- Build all services:
npm run build - Setup PostgreSQL on server
- Configure environment variables
- Run migrations:
cd Nest && npm run typeorm:run-migrations - Start services:
- Frontend: Serve
frontend-vue/distwith Nginx - Backend:
cd Nest && npm run start:prod - Python:
cd backend-python && uvicorn main:app
- Frontend: Serve
- Fork the repository
- Create feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open Pull Request
MIT
- Lorenzo
- Pixelink for camera SDK
- NestJS team
- Vue.js team
- FastAPI team