This guide explains multiple ways to deploy ClassPulse:
- As a systemd service (production)
- Using Docker and Docker Compose
- Using the Makefile for quick setup
- Manual development setup
- Python 3.8 or higher
- Git
- For systemd: Ubuntu/Debian system with sudo privileges
- For Docker: Docker and Docker Compose installed
git clone https://github.com/michael-borck/class-pulse.git
cd class-pulseThe start.sh script will:
- Create a Python virtual environment
- Install all required dependencies
- Start the application with gunicorn
./start.shPress Ctrl+C to stop the application after verifying it works.
Copy the service file to the systemd directory:
sudo cp classpulse.service /etc/systemd/system/If needed, edit the service file to match your environment:
sudo nano /etc/systemd/system/classpulse.serviceKey settings to verify:
User=andGroup=- Should match your usernameWorkingDirectory=- Path to your ClassPulse installationExecStart=- Path to the start.sh script
# Reload systemd to recognize the new service
sudo systemctl daemon-reload
# Enable the service to start on boot
sudo systemctl enable classpulse.service
# Start the service
sudo systemctl start classpulse.service# Check the service status
sudo systemctl status classpulse.service
# View real-time logs
sudo journalctl -u classpulse -f- Start the service:
sudo systemctl start classpulse - Stop the service:
sudo systemctl stop classpulse - Restart the service:
sudo systemctl restart classpulse - Check status:
sudo systemctl status classpulse - Disable auto-start:
sudo systemctl disable classpulse
# View all logs
sudo journalctl -u classpulse
# View last 100 lines
sudo journalctl -u classpulse -n 100
# Follow logs in real-time
sudo journalctl -u classpulse -f
# View logs from today
sudo journalctl -u classpulse --since todayDocker provides an isolated environment and is great for containerized deployments.
git clone https://github.com/michael-borck/class-pulse.git
cd class-pulse# Build and start the application
docker-compose up -d
# View logs
docker-compose logs -f
# Stop the application
docker-compose down# Build the Docker image
docker build -t classpulse:latest .
# Run the container
docker run -d \
-p 5000:5000 \
-v $(pwd)/instance:/app/instance \
-e SECRET_KEY=your-secret-key-here \
--name classpulse \
classpulse:latest
# View logs
docker logs -f classpulse
# Stop the container
docker stop classpulse
docker rm classpulseThe Makefile provides convenient commands for both development and production setup.
git clone https://github.com/michael-borck/class-pulse.git
cd class-pulse# Development setup (includes dev tools)
make setup
# Production setup
make setup-prod
# Run development server
make run
# Run production server with gunicorn
make prod
# Initialize database
make db-init
# Run linting and formatting
make lint
make format
# Clean up cache files
make clean# Build Docker image
make docker-build
# Start with Docker Compose
make docker-up
# Stop Docker Compose
make docker-downFor development or testing purposes, you can run the application manually.
git clone https://github.com/michael-borck/class-pulse.git
cd class-pulsepython3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activatepip install --upgrade pip
pip install -r requirements.txtpython -c "from app import app, db; app.app_context().push(); db.create_all()"# Development server
python app.py
# Production server with gunicorn
gunicorn --workers=4 --bind=0.0.0.0:5000 --worker-class=gthread --threads=2 wsgi:applicationRegardless of the deployment method, you can access ClassPulse at:
- Local: http://localhost:5000
- Network: http://YOUR_SERVER_IP:5000
-
Check the logs for errors:
sudo journalctl -u classpulse -n 50
-
Verify the start.sh script is executable:
chmod +x /home/michael/projects/class-pulse/start.sh
-
Test running the script manually:
cd /home/michael/projects/class-pulse ./start.sh
Ensure the user specified in the service file has:
- Read access to all application files
- Write access to the instance directory
- Execute permission on start.sh
If port 5000 is already in use, either:
- Stop the conflicting service
- Change the port in start.sh (modify the
--bindparameter)
# Stop the service
sudo systemctl stop classpulse
# Pull the latest changes
cd /home/michael/projects/class-pulse
git pull
# Restart the service
sudo systemctl start classpulse# Pull latest changes
git pull
# Rebuild and restart
docker-compose down
docker-compose build
docker-compose up -d# Activate virtual environment
source venv/bin/activate
# Pull latest changes
git pull
# Update dependencies
pip install -r requirements.txt
# Restart your application- Firewall: Configure your firewall to allow traffic on port 5000
- HTTPS: Consider using a reverse proxy (nginx/Apache) for SSL/TLS
- Environment Variables: Store sensitive configuration in environment files
- Database: For production, consider using PostgreSQL instead of SQLite
For production deployments, it's recommended to use nginx as a reverse proxy:
server {
listen 80;
server_name your-domain.com;
location / {
proxy_pass http://127.0.0.1:5000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location /socket.io {
proxy_pass http://127.0.0.1:5000/socket.io;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}For issues or questions:
- Check the GitHub repository
- Review application logs using journalctl
- Ensure all dependencies are properly installed