- Python 3.9+
- Node.js 18+
- Git
git clone https://github.com/mukuldesai/ZeroDay.git
cd zeroday
python -m venv env
source env/bin/activate # Windows: env\Scripts\activate
pip install -r requirements.txt
pip install -r requirements-dev.txt
cd frontend
npm install
cd ..
cp .env.example .envCreate .env file:
OPENAI_API_KEY=your_openai_api_key
ANTHROPIC_API_KEY=your_anthropic_api_key
DATABASE_URL=sqlite:///database/users.db
DEMO_MODE=true
SECRET_KEY=your_secret_key_here
ALLOWED_ORIGINS=http://localhost:3000,https://yourdomain.compython database/setup.py
python -m scripts.setup_demoBackend:
python api/main.pyFrontend (new terminal):
cd frontend
npm run devAccess application at http://localhost:3000
Frontend (Vercel):
- Connect GitHub repository to Vercel
- Set build command:
cd frontend && npm run build - Set output directory:
frontend/.next - Add environment variables in Vercel dashboard
Backend (Railway):
- Connect repository to Railway
- Set start command:
python api/main.py - Add environment variables
- Configure custom domain
FROM python:3.9-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
EXPOSE 8000
CMD ["python", "api/main.py"]docker build -t zeroday .
docker run -p 8000:8000 --env-file .env zerodaysudo apt update
sudo apt install python3 python3-pip nodejs npm nginx
git clone https://github.com/yourusername/zeroday.git
cd zeroday
python3 -m venv env
source env/bin/activate
pip install -r requirements.txt
cd frontend
npm install
npm run build
cd ..
sudo systemctl enable nginx
sudo systemctl start nginxNginx Configuration (/etc/nginx/sites-available/zeroday):
server {
listen 80;
server_name your-domain.com;
location / {
proxy_pass http://localhost:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
location /api {
proxy_pass http://localhost:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}python database/setup.pypip install psycopg2-binary
export DATABASE_URL=postgresql://user:password@localhost/zeroday
python database/setup.pypython vector_store/chromadb_setup.py init
python vector_store/demo_vectorstore.py populate_allexport CHROMA_SERVER_HOST=your-chroma-host
export CHROMA_SERVER_PORT=8000
python vector_store/chromadb_setup.py initpython scripts/setup_demo.py
python vector_store/demo_vectorstore.py populate_allBackend health: GET /api/health
Vector store health: python vector_store/chromadb_setup.py health
Database health: python database/setup.py check
Development:
DEBUG=true
DEMO_MODE=true
LOG_LEVEL=DEBUGProduction:
DEBUG=false
DEMO_MODE=false
LOG_LEVEL=INFO
DATABASE_URL=postgresql://...
REDIS_URL=redis://...Backend:
- Use gunicorn:
gunicorn -w 4 -k uvicorn.workers.UvicornWorker api.main:app - Enable caching with Redis
- Configure database connection pooling
Frontend:
- Enable production build:
npm run build - Configure CDN for static assets
- Enable compression in Next.js config
tail -f logs/app.log
tail -f logs/vector_store.log- Database query performance
- Vector search latency
- API response times
- Memory usage
python scripts/backup_database.pypython vector_store/chromadb_setup.py backupPort already in use:
lsof -ti:8000 | xargs kill -9
lsof -ti:3000 | xargs kill -9Database connection issues:
python database/setup.py checkVector store issues:
python vector_store/chromadb_setup.py healthDemo data missing:
python scripts/reset_database.py
python scripts/setup_demo.pyexport DEBUG=true
export LOG_LEVEL=DEBUG
python api/main.py- Environment variables configured
- Secret keys generated
- CORS origins restricted
- HTTPS enabled in production
- Database credentials secured
- API rate limiting enabled
- Input validation implemented
- Authentication middleware active
For deployment issues:
- Check application logs
- Verify environment variables
- Test database connectivity
- Validate vector store setup
- Check network configuration
Repository: https://github.com/mukuldesai/ZeroDay Documentation: /docs Demo: https://your-demo-url.com