Skip to content

AbdullahMart/Taal_School_Project_Fullstack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Taal School Project - Fullstack

Kısa Açıklama Bu depo, React (Vite) ile kodlanmış bir ön yüz ve Python FastAPI tabanlı bir backend API içerir. Backend, MySQL veritabanına bağlanarak öğrenci yönetimi, sınavlar ve kurs verilerini yönetir. Proje Docker ile containerize edilmiş olup, kolay kurulumu için docker-compose desteklemektedir.


📋 Gereksinimler

  • Backend: Python 3.9+
  • Frontend: Node.js LTS (18.x veya üstü) ve npm
  • Database: MySQL 8.0
  • Git (veya GitHub'dan ZIP ile indirme)

Not: Yerel kurulumda backend ve frontend bağımlılıklarını tek komutla yüklemek için requirements.txt ve npm install kullanılır.

  • Docker Desktop (opsiyonel)
  • Docker Compose (opsiyonel)

⚙️ Environment Variables (bu dosyalari yerelde bilgisayrinizda olustrmaniz gerekiyor)

Backend (.env dosyası - backend-api/.env):

DB_USER=root
DB_PASSWORD=!@#123qwert (kendi sifrenizi yazin)
DB_HOST=localhost
DB_NAME=career_academy
DB_PORT=3306

# Auth Credentials
AUTH_EMAIL=johndoe@careeracademy.com
AUTH_PASSWORD=password123

# Security
SECRET_KEY=9a2f6b8c4d2e1f0a3b5c7d9e8f0a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8
ALGORITHM=HS256
ACCESS_TOKEN_EXPIRE_MINUTES=43200

Frontend (.env dosyası - frontend-ui/.env):

# Auth Credentials
AUTH_EMAIL=johndoe@careeracademy.com
AUTH_PASSWORD=password123

🚀 Kurulum ve Çalıştırma

Option 1: Yerel Kurulum 👨‍💻

  1. Repoyu İndirin:
git clone https://github.com/AbdullahMart/Taal_School_Project_Fullstack.git
cd Taal_School_Project_Fullstack
  1. Veritabanı Kurulumu:

    • MySQL'i başlatın (yerel kurulum yapılmış olmalı, veritabanı oluşturulmuş olmalı)
    • Tabloları elle oluşturmanıza gerek yoktur. Backend ilk başlatıldığında eksik tablolar otomatik olarak oluşturulur.
  2. Backend Kurulumu:

cd backend-api
python -m venv venv  # (sanal ortam)
venv\Scripts\activate  # Windows
pip install -r requirements.txt
python main.py

# veya
source venv/bin/activate  # macOS/Linux
pip install -r requirements.txt
python main.py
  1. Frontend Kurulumu:
cd frontend-ui
npm install
npm run dev

Tarayıcıda açın: http://localhost:5173


Option 2: Docker ile Kurulum (Alternatif) 🐋

  1. Repoyu indirin:
git clone https://github.com/AbdullahMart/Taal_School_Project_Fullstack.git
cd Taal_School_Project_Fullstack
  1. Environment dosyasını oluşturun (isteğe bağlı):
# Backend için .env dosyası (backend-api/.env)
DB_HOST=db
DB_PORT=3306
DB_USER=root
DB_PASSWORD=rootpassword
DB_NAME=career_academy
  1. Docker Compose ile çalıştırın:
docker-compose up --build
  1. Uygulamaya erişin:

Tüm servisler otomatik olarak başlatılacak ve birbirine bağlanacaktır.


📁 Proje Yapısı

Taal_School_Project_Fullstack/
├── backend-api/              # Python FastAPI Backend
│   ├── main.py              # FastAPI uygulaması
│   ├── db.py                # SQLAlchemy database config
│   ├── requirements.txt      # Python bağımlılıkları
│   ├── Dockerfile
│   ├── core/
│   │   ├── config.py        # Yapılandırma
│   │   └── security.py      # JWT & Auth
│   ├── models/
│   │   └── models.py        # SQLAlchemy models
│   ├── routers/
│   │   ├── auth.py          # Auth API endpoints
│   │   └── data.py          # Data API endpoints
│   ├── schemas/
│   │   └── student.py       # Pydantic schemas
│   └── services/
│       └── data_service.py  # Business logic
├── frontend-ui/             # React + TypeScript + Vite
│   ├── package.json
│   ├── vite.config.ts
│   ├── tsconfig.json
│   ├── Dockerfile
│   ├── index.html
│   ├── src/
│   │   ├── App.tsx
│   │   ├── main.tsx
│   │   ├── types.ts
│   │   └── components/
│   │       ├── LoginPage.tsx
│   │       ├── HomePage.tsx
│   │       ├── StudentPage.tsx
│   │       ├── CoursePage.tsx
│   │       ├── ExamPage.tsx
│   │       ├── DashboardStats.tsx
│   │       └── ...
├── docker-compose.yml       # Docker Compose configuration
├── students_table.sql       # Veritabanı şeması
└── README.md

📊 Veritabanı Tabloları

students - Öğrenci Bilgileri

- student_id (INT, Primary Key)
- first_name (VARCHAR)
- last_name (VARCHAR)
- country (VARCHAR)
- age (INT)
- gender (VARCHAR)
- education_level (VARCHAR)
- field_of_study (VARCHAR)

app_question_body - Sınav Soruları

question_id (INT, Primary Key)
student_id (INT, Foreign Key)
created_at (DATETIME)
level (VARCHAR)
skill (VARCHAR)
code (VARCHAR)
title (VARCHAR)
paragraphs (INT)
question_count (INT)
status (VARCHAR)

student_stats - Öğrenci İstatistikleri

student_stats_id (INT, Primary Key, Auto Increment)
student_id (INT, Foreign Key)
country (VARCHAR)
field_of_study (VARCHAR)
platform_used (VARCHAR)
device_used (VARCHAR)
learning_mode (VARCHAR)
enrollment_date (VARCHAR)
daily_learning_hours (VARCHAR)
quizzes_attempted (INT)
assignments_submitted (INT)
course_completion_rate (VARCHAR)
satisfaction_score (INT)

🔐 API Endpoints

Authentication (Auth)

POST /api/login
# Body: { "email": "user@example.com", "password": "password" }
# Response: { "access_token": "...", "token_type": "bearer", "user": {...} }

Data (Students, Questions, Stats)

GET /api/students              # Tüm öğrencileri listele
POST /api/students             # Yeni öğrenci ekle
GET /api/students/{id}         # Öğrenci detayları
PUT /api/students/{id}         # Öğrenci güncelle
DELETE /api/students/{id}      # Öğrenci sil

GET /api/questions             # Tüm soruları listele
GET /api/questions/{id}        # Soru detayları

⚠️ Yaygın Sorunlar ve Çözümleri

1. "Port already in use" Hatası

# 3001 portunu kullanan işlemi bulun ve durdurun
# Windows:
netstat -ano | findstr :3001
taskkill /PID <PID> /F

# macOS/Linux:
lsof -i :3001
kill -9 <PID>

2. "MySQL connection refused"

  • MySQL servisi çalışıyor mu? (Services'te kontrol edin)
  • Kullanıcı adı/parola doğru mu?
  • Port 3306 (yerel) veya 3307 (Docker) açık mı?

3. "ModuleNotFoundError: No module named 'fastapi'"

# Virtual environment aktif mi?
# Değilse aktif edin ve pip install -r requirements.txt çalıştırın
pip install -r requirements.txt

4. "npm ERR! code ERESOLVE"

# node_modules sil ve yeniden kur
rm -r node_modules package-lock.json
npm install

5. Docker Compose Hatası

# Logları görüntüle
docker-compose logs -f

# Container'ları temizle ve yeniden başlat
docker-compose down
docker-compose up --build

📚 Kullanılan Teknolojiler

Backend

  • FastAPI - Modern Python web framework
  • SQLAlchemy - ORM database management
  • Uvicorn - ASGI server
  • Python-jose - JWT authentication
  • Passlib - Password hashing
  • mysql-connector-python - MySQL driver

Frontend

  • React - UI library
  • TypeScript - Type-safe JavaScript
  • Vite - Build tool
  • Tailwind CSS - Styling

DevOps

  • Docker - Containerization
  • Docker Compose - Multi-container orchestration

🤝 Katkıda Bulunma

Projeden yararlandıysanız, lütfen bir ⭐ bırakınız!


📝 Lisans

Bu proje eğitim amaçlıdır.


Geliştirici: Abdullah Mart

Basarilar dilerim... 🎓

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors