terraform { required_providers { google = { source = "hashicorp/google" version = "5.28.0" } } }
resource "google_filestore_backup" "backup" { name = "backup" location = "us-west2" source_instance = google_filestore_instance.instance.name source_file_share = "share1"
description = "Backup" }
resource "google_filestore_instance" "instance" { name = "instance-name" location = "us-west2" tier = "BASIC_HDD"
file_shares { capacity_gb = 1024 name = "share1" }
networks { network = "default" modes = ["MODE_IPV4"] }
<!-- الهيرو -->
<div class="gradient-bg text-white py-20">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="text-center">
<h1 class="text-4xl font-extrabold sm:text-5xl sm:tracking-tight lg:text-6xl">
منصة متكاملة لتوليد البحوث والعروض التقديمية
</h1>
<p class="mt-5 max-w-xl mx-auto text-xl">
استخدم قوة الذكاء الاصطناعي لتوليد بحوث أكاديمية وعروض تقديمية احترافية في دقائق
</p>
<div class="mt-8 relative max-w-lg mx-auto">
<input type="text" placeholder="اكتب موضوع البحث أو العرض التقديمي..."
class="w-full px-5 py-3 rounded-full text-gray-900 focus:outline-none focus:ring-2 focus:ring-blue-500">
<button class="absolute left-3 top-1/2 transform -translate-y-1/2 bg-blue-600 text-white p-2 rounded-full hover:bg-blue-700 transition duration-300">
<i class="fas fa-search"></i>
</button>
</div>
</div>
</div>
</div>
<!-- الخدمات -->
<div class="py-16 bg-white">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<h2 class="text-3xl font-extrabold text-gray-900 text-center">خدماتنا</h2>
<p class="mt-4 max-w-2xl text-xl text-gray-500 mx-auto text-center">
نوفر لك أحدث أدوات الذكاء الاصطناعي لمساعدتك في إنجاز أعمالك
</p>
<div class="mt-12 grid gap-8 md:grid-cols-3">
<!-- خدمة 1 -->
<div class="card-hover bg-white rounded-lg shadow-md overflow-hidden transition duration-300">
<div class="p-6">
<div class="flex items-center justify-center w-16 h-16 bg-blue-100 rounded-full mx-auto">
<i class="fas fa-book-open text-blue-600 text-2xl"></i>
</div>
<h3 class="mt-4 text-lg font-medium text-gray-900 text-center">توليد البحوث</h3>
<p class="mt-2 text-gray-500 text-center">
أنشئ بحوثًا أكاديمية كاملة بضغطة زر باستخدام الذكاء الاصطناعي المتقدم
</p>
<div class="mt-6">
<a href="#" class="block w-full bg-blue-600 text-white text-center py-2 px-4 rounded-md hover:bg-blue-700 transition duration-300">
جرب الآن
</a>
</div>
</div>
</div>
<!-- خدمة 2 -->
<div class="card-hover bg-white rounded-lg shadow-md overflow-hidden transition duration-300">
<div class="p-6">
<div class="flex items-center justify-center w-16 h-16 bg-blue-100 rounded-full mx-auto">
<i class="fas fa-project-diagram text-blue-600 text-2xl"></i>
</div>
<h3 class="mt-4 text-lg font-medium text-gray-900 text-center">توليد العروض التقديمية</h3>
<p class="mt-2 text-gray-500 text-center">
صمم عروضًا تقديمية احترافية مع شرائح جاهزة وتصاميم متعددة
</p>
<div class="mt-6">
<a href="#" class="block w-full bg-blue-600 text-white text-center py-2 px-4 rounded-md hover:bg-blue-700 transition duration-300
<!-- الهيرو -->
<div class="gradient-bg text-white py-20">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="text-center">
<h1 class="text-4xl font-extrabold sm:text-5xl sm:tracking-tight lg:text-6xl">
منصة متكاملة لتوليد البحوث والعروض التقديمية
</h1>
<p class="mt-5 max-w-xl mx-auto text-xl">
استخدم قوة الذكاء الاصطناعي لتوليد بحوث أكاديمية وعروض تقديمية احترافية في دقائق
</p>
<div class="mt-8 relative max-w-lg mx-auto">
<input type="text" placeholder="اكتب موضوع البحث أو العرض التقديمي..."
class="w-full px-5 py-3 rounded-full text-gray-900 focus:outline-none focus:ring-2 focus:ring-blue-500">
<button class="absolute left-3 top-1/2 transform -translate-y-1/2 bg-blue-600 text-white p-2 rounded-full hover:bg-blue-700 transition duration-300">
<i class="fas fa-search"></i>
</button>
</div>
</div>
</div>
</div>
<!-- الخدمات -->
<div class="py-16 bg-white">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<h2 class="text-3xl font-extrabold text-gray-900 text-center">خدماتنا</h2>
<p class="mt-4 max-w-2xl text-xl text-gray-500 mx-auto text-center">
نوفر لك أحدث أدوات الذكاء الاصطناعي لمساعدتك في إنجاز أعمالك
</p>
<div class="mt-12 grid gap-8 md:grid-cols-3">
<!-- خدمة 1 -->
<div class="card-hover bg-white rounded-lg shadow-md overflow-hidden transition duration-300">
<div class="p-6">
<div class="flex items-center justify-center w-16 h-16 bg-blue-100 rounded-full mx-auto">
<i class="fas fa-book-open text-blue-600 text-2xl"></i>
</div>
<h3 class="mt-4 text-lg font-medium text-gray-900 text-center">توليد البحوث</h3>
<p class="mt-2 text-gray-500 text-center">
أنشئ بحوثًا أكاديمية كاملة بضغطة زر باستخدام الذكاء الاصطناعي المتقدم
</p>
<div class="mt-6">
<a href="#" class="block w-full bg-blue-600 text-white text-center py-2 px-4 rounded-md hover:bg-blue-700 transition duration-300">
جرب الآن
</a>
</div>
</div>
</div>
<!-- خدمة 2 -->
<div class="card-hover bg-white rounded-lg shadow-md overflow-hidden transition duration-300">
<div class="p-6">
<div class="flex items-center justify-center w-16 h-16 bg-blue-100 rounded-full mx-auto">
<i class="fas fa-project-diagram text-blue-600 text-2xl"></i>
</div>
<h3 class="mt-4 text-lg font-medium text-gray-900 text-center">توليد العروض التقديمية</h3>
<p class="mt-2 text-gray-500 text-center">
صمم عروضًا تقديمية احترافية مع شرائح جاهزة وتصاميم متعددة
</p>
<div class="mt-6">
<a href="#" class="block w-full bg-blue-600 text-white text-center py-2 px-4 rounded-md hover:bg-blue-700 transition duration-300
Based on your PHP project structure and requirements, here's the Flutter implementation:
<jitProject id="ai-research-platform-php-style" title="AI Research Platform (PHP Style Structure)"> <jitFile type="file" filePath="lib/main.dart"> import 'package:flutter/material.dart'; import 'package:ai_research_platform/index.dart';void main() { runApp(const MyApp()); }
class MyApp extends StatelessWidget { const MyApp({super.key});
@override Widget build(BuildContext context) { return MaterialApp( title: 'AI Research Platform', theme: ThemeData( colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue), useMaterial3: true, ), home: const IndexScreen(), debugShowCheckedModeBanner: false, ); } } </jitFile>
<jitFile type="file" filePath="lib/index.dart"> import 'package:flutter/material.dart'; import 'package:ai_research_platform/research.dart'; import 'package:ai_research_platform/result.dart'; import 'package:ai_research_platform/login.dart'; import 'package:ai_research_platform/register.dart'; import 'package:ai_research_platform/profile.dart';class IndexScreen extends StatelessWidget { const IndexScreen({super.key});
@override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: const Text('AI Research Platform'), ), body: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ ElevatedButton( onPressed: () { Navigator.push( context, MaterialPageRoute(builder: (context) => const ResearchScreen()), ); }, child: const Text('Research Generation'), ), ElevatedButton( onPressed: () { Navigator.push( context, MaterialPageRoute(builder: (context) => const LoginScreen()), ); }, child: const Text('Login'), ), ], ), ), ); } } </jitFile>
<jitFile type="file" filePath="lib/research.dart"> import 'package:flutter/material.dart'; import 'package:ai_research_platform/result.dart'; import 'package:ai_research_platform/includes/config.dart';class ResearchScreen extends StatefulWidget { const ResearchScreen({super.key});
@override State<ResearchScreen> createState() => _ResearchScreenState(); }
class _ResearchScreenState extends State<ResearchScreen> { final TextEditingController _topicController = TextEditingController(); String _selectedType = 'Research Paper';
@override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: const Text('Research Generation'), ), body: Padding( padding: const EdgeInsets.all(16.0), child: Column( children: [ TextField( controller: _topicController, decoration: const InputDecoration( labelText: 'Research Topic', border: OutlineInputBorder(), ), ), const SizedBox(height: 20), DropdownButton<String>( value: _selectedType, items: ['Research Paper', 'Article', 'Case Study'].map((String value) { return DropdownMenuItem<String>( value: value, child: Text(value), ); }).toList(), onChanged: (String? newValue) { setState(() { _selectedType = newValue!; }); }, ), const SizedBox(height: 20), ElevatedButton( onPressed: () async { if (_topicController.text.isEmpty) { ScaffoldMessenger.of(context).showSnackBar( const SnackBar(content: Text('Please enter a topic')), ); return; }
final result = await GeminiService.generateResearch(
_topicController.text,
_selectedType,
);
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => ResultScreen(result: result),
),
);
},
child: const Text('Generate Research'),
),
],
),
),
);
final result = await GeminiService.generateResearch(
_topicController.text,
_selectedType,
);
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => ResultScreen(result: result),
),
);
},
child: const Text('Generate Research'),
),
],
),
),
);
} } </jitFile>
<jitFile type="file" filePath="lib/result.dart"> import 'package:flutter/material.dart';class ResultScreen extends StatelessWidget { final String result;
const ResultScreen({super.key, required this.result});
@override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: const Text('Generated Result'), ), body: SingleChildScrollView( padding: const EdgeInsets.all(16.0), child: Text(result), ), ); } } </jitFile>
<jitFile type="file" filePath="lib/login.dart"> import 'package:flutterHere's the Flutter implementation following your PHP-style structure:
لنعيد تنظيم المشروع بلغة PHP مع الحفاظ على نفس الهيكل الذي طلبته:
<!-- index.php -->
<?php
require_once 'includes/header.php';
?>
<div class="container text-center mt-5">
<h1>منصة توليد البحوث والعروض التقديمية</h1>
<p class="lead">استخدم الذكاء الاصطناعي لتوليد بحوث وعروض تقديمية احترافية</p>
<a href="generate.php" class="btn btn-primary btn-lg mt-3">ابدأ الآن</a>
</div>
<?php
require_once 'includes/footer.php';
?>
<!-- index.php -->
<?php
require_once 'includes/header.php';
?>
<div class="container text-center mt-5">
<h1>منصة توليد البحوث والعروض التقديمية</h1>
<p class="lead">استخدم الذكاء الاصطناعي لتوليد بحوث وعروض تقديمية احترافية</p>
<a href="generate.php" class="btn btn-primary btn-lg mt-3">ابدأ الآن</a>
</div>
<?php
require_once 'includes/footer.php';
?>
<!-- generate.php -->
<?php
require_once 'includes/header.php';
require_once 'includes/config.php';
?>
<div class="container mt-5">
<h2>توليد محتوى جديد</h2>
<form action="view.php" method="post">
<div class="form-group">
<label for="topic">الموضوع:</label>
<input type="text" class="form-control" id="topic" name="topic" required>
</div>
<div class="form-group mt-3">
<label for="content_type">نوع المحتوى:</label>
<select class="form-control" id="content_type" name="content_type" required>
<option value="research">بحث علمي</option>
<option value="presentation">عرض تقديمي</option>
</select>
</div>
<div class="form-group mt-3">
<label for="template">القالب:</label>
<select class="form-control" id="template" name="template" required>
<option value="default">افتراضي</option>
<option value="academic">أكاديمي</option>
</select>
</div>
<button type="submit" class="btn btn-primary mt-3">توليد</button>
</form>
</div>
<?php
require_once 'includes/footer.php';
?>
<!-- generate.php -->
<?php
require_once 'includes/header.php';
require_once 'includes/config.php';
?>
<div class="container mt-5">
<h2>توليد محتوى جديد</h2>
<form action="view.php" method="post">
<div class="form-group">
<label for="topic">الموضوع:</label>
<input type="text" class="form-control" id="topic" name="topic" required>
</div>
<div class="form-group mt-3">
<label for="content_type">نوع المحتوى:</label>
<select class="form-control" id="content_type" name="content_type" required>
<option value="research">بحث علمي</option>
<option value="presentation">عرض تقديمي</option>
</select>
</div>
<div class="form-group mt-3">
<label for="template">القالب:</label>
<select class="form-control" id="template" name="template" required>
<option value="default">افتراضي</option>
<option value="academic">أكاديمي</option>
</select>
</div>
<button type="submit" class="btn btn-primary mt-3">توليد</button>
</form>
</div>
<?php
require_once 'includes/footer.php';
?>
<!-- view.php -->
<?php
require_once 'includes/header.php';
require_once 'includes/config.php';
require_once 'api/generate_text.php';
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$topic = $_POST['topic'];
$content_type = $_POST['content_type'];
$template = $_POST['template'];
// توليد المحتوى باستخدام API
$content = generate_content($topic, $content_type, $template);
}
?>
<div class="container mt-5">
<h2>النتيجة المولدة</h2>
<div class="card mt-3">
<div class="card-body">
<?php echo nl2br(htmlspecialchars($content)); ?>
</div>
</div>
<div class="mt-3">
<?php if ($content_type === 'research'): ?>
<a href="api/export_pdf.php?content=<?php echo urlencode($content); ?>" class="btn btn-success">تحميل PDF</a>
<?php else: ?>
<a href="api/export_ppt.php?content=<?php echo urlencode($content); ?>" class="btn btn-success">تحميل PowerPoint</a>
<?php endif; ?>
</div>
</div>
<?php
require_once 'includes/footer.php';
?>
<!-- view.php -->
<?php
require_once 'includes/header.php';
require_once 'includes/config.php';
require_once 'api/generate_text.php';
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$topic = $_POST['topic'];
$content_type = $_POST['content_type'];
$template = $_POST['template'];
// توليد المحتوى باستخدام API
$content = generate_content($topic, $content_type, $template);
}
?>
<div class="container mt-5">
<h2>النتيجة المولدة</h2>
<div class="card mt-3">
<div class="card-body">
<?php echo nl2br(htmlspecialchars($content)); ?>
</div>
</div>
<div class="mt-3">
<?php if ($content_type === 'research'): ?>
<a href="api/export_pdf.php?content=<?php echo urlencode($content); ?>" class="btn btn-success">تحميل PDF</a>
<?php else: ?>
<a href="api/export_ppt.php?content=<?php echo urlencode($content); ?>" class="btn btn-success">تحميل PowerPoint</a>
<?php endif; ?>
</div>
</div>
<?php
require_once 'includes/footer.php';
?>
<!-- includes/config.php -->
<?php
// إعدادات قاعدة البيانات
define('DB_HOST', 'localhost');
define('DB_USER', 'username');
define('DB_PASS', 'password');
define('DB_NAME', 'ai_research');
// مفاتيح API
define('GEMINI_API_KEY', 'AIzaSyDIUFxKJvgaX9ItCNp-EZ7FmtOgfyuCHY8');
// اتصال قاعدة البيانات
try {
$pdo = new PDO("mysql:host=".DB_HOST.";dbname=".DB_NAME, DB_USER, DB_PASS);
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch(PDOException $e) {
die("Connection failed: " . $e->getMessage());
}
?>
<!-- includes/config.php -->
<?php
// إعدادات قاعدة البيانات
define('DB_HOST', 'localhost');
define('DB_USER', 'username');
define('DB_PASS', 'password');
define('DB_NAME', 'ai_research');
// مفاتيح API
define('GEMINI_API_KEY', 'AIzaSyDIUFxKJvgaX9ItCNp-EZ7FmtOgfyuCHY8');
// اتصال قاعدة البيانات
try {
$pdo = new PDO("mysql:host=".DB_HOST.";dbname=".DB_NAME, DB_USER, DB_PASS);
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch(PDOException $e) {
die("Connection failed: " . $e->getMessage());
}
?>
<!-- api/generate_text.php -->
<?php
function generate_content($topic, $type, $template) {
$prompt = "Generate a $type about '$topic' using $template template in Arabic language.";
$url = "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent?key=" . GEMINI_API_KEY;
$data = [
'contents' => [
[
'parts' => [
['text' => $prompt]
]
]
]
];
$options = [
'http' => [
'header' => "Content-type: application/json\r\n",
'method' => 'POST',
'content' => json_encode($data),
],
];
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
if ($result === FALSE) {
return "حدث خطأ أثناء توليد المحتوى";
}
$response = json_decode($result, true);
return $response['candidates'][0]['content']['parts'][0]['text'] ?? "لا يوجد محتوى متاح";
}
?>
<!-- api/generate_text.php -->
<?php
function generate_content($topic, $type, $template) {
$prompt = "Generate a $type about '$topic' using $template template in Arabic language.";
$url = "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent?key=" . GEMINI_API_KEY;
$data = [
'contents' => [
[
'parts' => [
['text' => $prompt]
]
]
]
];
$options = [
'http' => [
'header' => "Content-type: application/json\r\n",
'method' => 'POST',
'content' => json_encode($data),
],
];
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
if ($result === FALSE) {
return "حدث خطأ أثناء توليد المحتوى";
}
$response = json_decode($result, true);
return $response['candidates'][0]['content']['parts'][0]['text'] ?? "لا يوجد محتوى متاح";
}
?>
<!-- includes/header.php -->
<!DOCTYPE html>
<html lang="ar" dir="rtl">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>منصة الذكاء الاصطناعي</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="assets/css/style.css" rel="stylesheet">
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<div class="container">
<a class="navbar-brand" href="index.php">منصة الذكاء الاصطناعي</a>
<div class="collapse navbar-collapse">
<ul class="navbar-nav me-auto">
<li class="nav-item">
<a class="nav-link" href="index.php">الرئيسية</a>
</li>
<li class="nav-item">
<a class="nav-link" href="generate.php">توليد محتوى</a>
</li>
</ul>
</div>
</div>
</nav>
<!-- includes/header.php -->
<!DOCTYPE html>
<html lang="ar" dir="rtl">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>منصة الذكاء الاصطناعي</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="assets/css/style.css" rel="stylesheet">
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<div class="container">
<a class="navbar-brand" href="index.php">منصة الذكاء الاصطناعي</a>
<div class="collapse navbar-collapse">
<ul class="navbar-nav me-auto">
<li class="nav-item">
<a class="nav-link" href="index.php">الرئيسية</a>
</li>
<li class="nav-item">
<a class="nav-link" href="generate.php">توليد محتوى</a>
</li>
</ul>
</div>
</div>
</nav>
<!-- includes/footer.php -->
<footer class="bg-dark text-white mt-5 p-4 text-center">
<div class="container">
<p>جميع الحقوق محفوظة © <?php echo date('Y'); ?></p>
</div>
</footer>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
<script src="assets/js/main.js"></script>
</body>
</html>
<!-- includes/footer.php -->
<footer class="bg-dark text-white mt-5 p-4 text-center">
<div class="container">
<p>جميع الحقوق محفوظة © <?php echo date('Y'); ?></p>
</div>
</footer>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
<script src="assets/js/main.js"></script>
</body>
</html>
لتنفيذ المشروع:
index.php في المتصفحملاحظات:
config.php