Spaces:
Sleeping
Sleeping
File size: 9,249 Bytes
b996603 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 | #!/usr/bin/env python
"""
SSC Project Setup Verification Script
Verifies that all required files and dependencies are in place
"""
import os
import sys
from pathlib import Path
def check_file_exists(file_path, description=""):
"""Check if a file exists"""
exists = os.path.exists(file_path)
status = "β
" if exists else "β"
desc = f" - {description}" if description else ""
print(f"{status} {file_path}{desc}")
return exists
def check_directory_exists(dir_path, description=""):
"""Check if a directory exists"""
exists = os.path.isdir(dir_path)
status = "β
" if exists else "β"
desc = f" - {description}" if description else ""
print(f"{status} {dir_path}{desc}")
return exists
def verify_project_structure():
"""Verify the complete project structure"""
print("\n" + "="*60)
print("π SSC PROJECT STRUCTURE VERIFICATION")
print("="*60 + "\n")
all_good = True
# Root files
print("π Root Directory Files:")
all_good &= check_file_exists("README.md", "Main documentation")
all_good &= check_file_exists("QUICK_START.md", "Quick start guide")
all_good &= check_file_exists("API_DOCUMENTATION.md", "API docs")
all_good &= check_file_exists("PROJECT_STRUCTURE.md", "Project structure")
all_good &= check_file_exists("FEATURES_CHECKLIST.md", "Features list")
all_good &= check_file_exists("docker-compose.yml", "Docker compose")
all_good &= check_file_exists(".gitignore", "Git ignore")
# Backend structure
print("\nπ¦ Backend Files:")
all_good &= check_directory_exists("backend", "Backend directory")
all_good &= check_file_exists("backend/main.py", "FastAPI entry point")
all_good &= check_file_exists("backend/requirements.txt", "Python dependencies")
all_good &= check_file_exists("backend/.env", "Environment config")
all_good &= check_file_exists("backend/.env.example", "Example env")
all_good &= check_file_exists("backend/Dockerfile", "Docker config")
all_good &= check_file_exists("backend/load_test_data.py", "Test data loader")
# Backend app
print("\nπ Backend App Structure:")
all_good &= check_directory_exists("backend/app", "App directory")
all_good &= check_file_exists("backend/app/config.py", "Configuration")
all_good &= check_file_exists("backend/app/database.py", "Database setup")
# Models
print("\nποΈ Database Models:")
all_good &= check_directory_exists("backend/app/models", "Models directory")
all_good &= check_file_exists("backend/app/models/user.py", "User model")
all_good &= check_file_exists("backend/app/models/payment.py", "Payment model")
all_good &= check_file_exists("backend/app/models/performance_log.py", "Performance model")
all_good &= check_file_exists("backend/app/models/notification.py", "Notification model")
# Routes
print("\nπ£οΈ API Routes:")
all_good &= check_directory_exists("backend/app/routes", "Routes directory")
all_good &= check_file_exists("backend/app/routes/auth.py", "Auth routes")
all_good &= check_file_exists("backend/app/routes/players.py", "Player routes")
all_good &= check_file_exists("backend/app/routes/premium.py", "Premium routes")
all_good &= check_file_exists("backend/app/routes/performance.py", "Performance routes")
all_good &= check_file_exists("backend/app/routes/dashboard.py", "Dashboard routes")
all_good &= check_file_exists("backend/app/routes/admin.py", "Admin routes")
# Schemas
print("\nπ Request/Response Schemas:")
all_good &= check_directory_exists("backend/app/schemas", "Schemas directory")
all_good &= check_file_exists("backend/app/schemas/user.py", "User schemas")
all_good &= check_file_exists("backend/app/schemas/payment.py", "Payment schemas")
all_good &= check_file_exists("backend/app/schemas/performance.py", "Performance schemas")
all_good &= check_file_exists("backend/app/schemas/notification.py", "Notification schemas")
# Utils
print("\nπ οΈ Utilities:")
all_good &= check_directory_exists("backend/app/utils", "Utils directory")
all_good &= check_file_exists("backend/app/utils/auth.py", "Auth utilities")
all_good &= check_file_exists("backend/app/utils/premium.py", "Premium utilities")
all_good &= check_file_exists("backend/app/utils/logger.py", "Logger utilities")
# Middleware
print("\nβοΈ Middleware:")
all_good &= check_directory_exists("backend/app/middleware", "Middleware directory")
all_good &= check_file_exists("backend/app/middleware/__init__.py", "Rate limiting & logging")
all_good &= check_file_exists("backend/app/middleware/auth.py", "Auth middleware")
# Frontend
print("\nβοΈ Frontend Files:")
all_good &= check_directory_exists("frontend", "Frontend directory")
all_good &= check_file_exists("frontend/package.json", "Node dependencies")
all_good &= check_file_exists("frontend/vite.config.js", "Vite config")
all_good &= check_file_exists("frontend/index.html", "HTML template")
all_good &= check_file_exists("frontend/.env", "Frontend env")
all_good &= check_file_exists("frontend/.env.example", "Example env")
all_good &= check_file_exists("frontend/Dockerfile", "Docker config")
# Frontend src
print("\nπ Frontend Source Code:")
all_good &= check_directory_exists("frontend/src", "Src directory")
all_good &= check_file_exists("frontend/src/main.jsx", "React entry")
all_good &= check_file_exists("frontend/src/App.jsx", "App component")
# Components
print("\nπ§© React Components:")
all_good &= check_directory_exists("frontend/src/components", "Components dir")
all_good &= check_file_exists("frontend/src/components/Navbar.jsx", "Navbar component")
# Pages
print("\nπ React Pages:")
all_good &= check_directory_exists("frontend/src/pages", "Pages dir")
all_good &= check_file_exists("frontend/src/pages/Home.jsx", "Home page")
all_good &= check_file_exists("frontend/src/pages/Auth.jsx", "Auth pages")
all_good &= check_file_exists("frontend/src/pages/Dashboard.jsx", "Dashboard page")
all_good &= check_file_exists("frontend/src/pages/Players.jsx", "Players page")
all_good &= check_file_exists("frontend/src/pages/Profile.jsx", "Profile page")
# Utils & Styles
print("\nπ¨ Frontend Utils & Styles:")
all_good &= check_directory_exists("frontend/src/utils", "Utils dir")
all_good &= check_file_exists("frontend/src/utils/api.js", "API service")
all_good &= check_directory_exists("frontend/src/styles", "Styles dir")
all_good &= check_file_exists("frontend/src/styles/global.css", "Global styles")
all_good &= check_file_exists("frontend/src/styles/theme.js", "Theme config")
return all_good
def print_summary():
"""Print project summary"""
print("\n" + "="*60)
print("π PROJECT SUMMARY")
print("="*60 + "\n")
print("β¨ Complete SSC Application Created!")
print("\nπ§ Backend (FastAPI):")
print(" β’ 6 API route modules")
print(" β’ 4 SQLAlchemy models")
print(" β’ 4 Pydantic schema modules")
print(" β’ Middleware for auth, rate limiting, logging")
print(" β’ Utility functions for all features")
print("\nβοΈ Frontend (React):")
print(" β’ 5 main pages (Home, Auth, Dashboard, Players, Profile)")
print(" β’ 1 reusable navbar component")
print(" β’ CSS modules for styling")
print(" β’ Axios API client")
print(" β’ React Router v6 for navigation")
print("\nπ Documentation:")
print(" β’ README.md (3000+ words)")
print(" β’ API_DOCUMENTATION.md (2500+ words)")
print(" β’ QUICK_START.md (setup guide)")
print(" β’ PROJECT_STRUCTURE.md (architecture)")
print(" β’ FEATURES_CHECKLIST.md (50+ features)")
print("\nπ― Core Features:")
print(" β’ User registration & authentication")
print(" β’ Player profiles & stats tracking")
print(" β’ Performance logging system")
print(" β’ Premium subscription (freemium model)")
print(" β’ Dashboard with analytics")
print(" β’ Leaderboards & rankings")
print(" β’ Admin panel")
print(" β’ Notifications system")
print(" β’ Activity logging")
print(" β’ Rate limiting")
print("\nπ Next Steps:")
print(" 1. cd backend")
print(" 2. python -m venv venv && source venv/bin/activate")
print(" 3. pip install -r requirements.txt")
print(" 4. python load_test_data.py")
print(" 5. python -m uvicorn main:app --reload")
print("\n Then in another terminal:")
print(" 1. cd frontend")
print(" 2. npm install")
print(" 3. npm run dev")
print("\nπ See QUICK_START.md for detailed setup instructions")
print("\n" + "="*60 + "\n")
if __name__ == "__main__":
all_good = verify_project_structure()
if all_good:
print("\nβ
All project files verified successfully!\n")
print_summary()
else:
print("\nβ οΈ Some files are missing. Please check the above list.\n")
sys.exit(1)
|