Templates (8 basic templates): - base.html: Main layout with navigation, flash messages, responsive design - login.html: User login form with remember me option - register.html: User registration with validation - dashboard.html: Main dashboard with statistics cards and recent activity - players_list.html: Players list placeholder - add_player.html: Add player form - groups_list.html: Groups list placeholder - create_group.html: Create group form - content_list.html: Content list placeholder - upload_content.html: File upload form - admin.html: Admin panel with system overview Development Setup: - run_dev.sh: Automated development server setup script - Creates virtual environment - Installs dependencies - Initializes database - Creates default admin user (admin/admin123) - Runs Flask development server on port 5000 Static Files: - static/uploads/ directory with .gitkeep - Ready for media file uploads Testing Features: ✅ Basic navigation and routing ✅ Authentication flow (login/register/logout) ✅ Dashboard with statistics ✅ Flash message system ✅ Responsive design with clean UI ✅ Placeholder templates for all routes Ready for manual testing at http://localhost:5000
77 lines
2.0 KiB
Bash
Executable File
77 lines
2.0 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# DigiServer v2 - Development Test Runner
|
|
# This script sets up and runs the application in development mode
|
|
|
|
set -e
|
|
|
|
echo "================================================"
|
|
echo " DigiServer v2 - Development Environment"
|
|
echo "================================================"
|
|
echo ""
|
|
|
|
# Check if we're in the right directory
|
|
if [ ! -f "requirements.txt" ]; then
|
|
echo "❌ Error: requirements.txt not found. Run this from the digiserver-v2 directory."
|
|
exit 1
|
|
fi
|
|
|
|
# Check if virtual environment exists
|
|
if [ ! -d "venv" ]; then
|
|
echo "📦 Creating virtual environment..."
|
|
python3 -m venv venv
|
|
echo "✅ Virtual environment created"
|
|
else
|
|
echo "✅ Virtual environment found"
|
|
fi
|
|
|
|
# Activate virtual environment
|
|
echo "🔄 Activating virtual environment..."
|
|
source venv/bin/activate
|
|
|
|
# Install/update dependencies
|
|
echo "📥 Installing dependencies..."
|
|
pip install -q --upgrade pip
|
|
pip install -q -r requirements.txt
|
|
|
|
echo "✅ Dependencies installed"
|
|
echo ""
|
|
|
|
# Check if .env exists
|
|
if [ ! -f ".env" ]; then
|
|
echo "⚠️ Warning: .env file not found, using .env.example"
|
|
cp .env.example .env
|
|
fi
|
|
|
|
# Initialize database if it doesn't exist
|
|
if [ ! -f "instance/dashboard.db" ]; then
|
|
echo "🗄️ Initializing database..."
|
|
export FLASK_APP=app.app:create_app
|
|
flask init-db
|
|
echo "✅ Database initialized"
|
|
|
|
echo "👤 Creating default admin user..."
|
|
flask create-admin
|
|
echo "✅ Admin user created (username: admin, password: admin123)"
|
|
else
|
|
echo "✅ Database found"
|
|
fi
|
|
|
|
echo ""
|
|
echo "================================================"
|
|
echo " Starting Flask Development Server"
|
|
echo "================================================"
|
|
echo ""
|
|
echo "🌐 Server will be available at: http://localhost:5000"
|
|
echo "👤 Default admin: username=admin, password=admin123"
|
|
echo ""
|
|
echo "Press Ctrl+C to stop the server"
|
|
echo ""
|
|
|
|
# Set Flask environment
|
|
export FLASK_APP=app.app:create_app
|
|
export FLASK_ENV=development
|
|
|
|
# Run Flask
|
|
flask run --host=0.0.0.0 --port=5000
|