Initial commit: enterprise digital platform with portal SSO, DigiServer, IT Assets, NetworkView, Server Monitor

This commit is contained in:
ske087
2026-05-10 21:07:50 +03:00
commit 8d9df56b0b
364 changed files with 73655 additions and 0 deletions
+76
View File
@@ -0,0 +1,76 @@
#!/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