Spaces:
Running
python-learning-platform/
Browse files│
├── client/
│ ├── index.html
│ ├── vite.config.js
│ ├── package.json
│ └── src/
│ │
│ ├── main.jsx
│ ├── App.jsx
│ │
│ ├── routes/
│ │ ├── AppRoutes.jsx
│ │ ├── ProtectedRoute.jsx
│ │ └── PublicRoute.jsx
│ │
│ ├── pages/
│ │ ├── home/
│ │ │ └── HomePage.jsx
│ │ │
│ │ ├── auth/
│ │ │ ├── LoginPage.jsx
│ │ │ ├── RegisterPage.jsx
│ │ │ └── VerifyEmailPage.jsx
│ │ │
│ │ ├── dashboard/
│ │ │ ├── DashboardPage.jsx
│ │ │ ├── ProfilePage.jsx
│ │ │ └── LearningPage.jsx
│ │ │
│ │ └── errors/
│ │ ├── NotFound.jsx
│ │ └── Unauthorized.jsx
│ │
│ ├── layouts/
│ │ ├── MainLayout.jsx
│ │ └── DashboardLayout.jsx
│ │
│ ├── components/
│ │ ├── ui/
│ │ │ ├── Button.jsx
│ │ │ ├── Input.jsx
│ │ │ ├── Card.jsx
│ │ │ └── LoadingSpinner.jsx
│ │ │
│ │ ├── navigation/
│ │ │ ├── Sidebar.jsx
│ │ │ └── Topbar.jsx
│ │ │
│ │ └── feedback/
│ │ ├── Toast.jsx
│ │ └── Modal.jsx
│ │
│ ├── context/
│ │ ├── AuthContext.jsx
│ │ ├── ThemeContext.jsx
│ │ └── LanguageContext.jsx
│ │
│ ├── hooks/
│ │ ├── useAuth.js
│ │ ├── useTheme.js
│ │ └── useLanguage.js
│ │
│ ├── services/
│ │ ├── api.js
│ │ ├── auth.service.js
│ │ ├── user.service.js
│ │ └── course.service.js
│ │
│ ├── i18n/
│ │ ├── index.js
│ │ ├── fa.json
│ │ └── en.json
│ │
│ ├── utils/
│ │ ├── validators.js
│ │ ├── formatters.js
│ │ └── constants.js
│ │
│ └── styles/
│ ├── tailwind.css
│ └── globals.css
│
├── server/
│ ├── server.js
│ ├── package.json
│ │
│ ├── config/
│ │ ├── database.js
│ │ ├── jwt.config.js
│ │ ├── googleOAuth.config.js
│ │ └── mail.config.js
│ │
│ ├── models/
│ │ ├── User.model.js
│ │ ├── Course.model.js
│ │ ├── Lesson.model.js
│ │ └── Progress.model.js
│ │
│ ├── routes/
│ │ ├── auth.routes.js
│ │ ├── user.routes.js
│ │ ├── course.routes.js
│ │ └── progress.routes.js
│ │
│ ├── controllers/
│ │ ├── auth.controller.js
│ │ ├── user.controller.js
│ │ ├── course.controller.js
│ │ └── progress.controller.js
│ │
│ ├── services/
│ │ ├── auth.service.js
│ │ ├── email.service.js
│ │ ├── otp.service.js
│ │ └── google.service.js
│ │
│ ├── middleware/
│ │ ├── auth.middleware.js
│ │ ├── role.middleware.js
│ │ ├── validation.middleware.js
│ │ └── error.middleware.js
│ │
│ ├── utils/
│ │ ├── asyncHandler.js
│ │ ├── appError.js
│ │ └── logger.js
│ │
│ └── validations/
│ ├── auth.validation.js
│ ├── user.validation.js
│ └── course.validation.js
│
├── docker/
│ ├── client.Dockerfile
│ ├── server.Dockerfile
│ └── nginx.conf
│
├── docker-compose.yml
├── .env.example
├── .gitignore
└── README.md
این رو با تمام فایل و کد همه رو بده با توضیح زیر 🧭 نقشه کامل نهایی Python Learning Platform
(Master Blueprint + Professional Suggestions)
لایه 0 — اصول طلایی (قبل از هر چیز)
اینها خط قرمزهای پروژه هستند:
❌ گرفتن رمز ایمیل واقعی → ممنوع
✔️ رمز مخصوص سایت + Hash
✔️ تفکیک کامل Frontend / Backend
✔️ هیچ logic سنگین داخل Route
✔️ همهچیز قابل تست و قابل توسعه
لایه 1 — معماری نهایی سیستم (Final Architecture)
Client (React + Vite)
├── Auth / Dashboard / LMS
└── i18n / Theme / Security
↓ HTTPS
Backend (Node + Express)
├── Auth / Courses / Progress
├── Email / OTP / Google OAuth
└── Security / Validation
↓
MongoDB Atlas
پیشنهاد حرفهای
Access Token کوتاه
Refresh Token امن (HttpOnly)
لایه 2 — ساختار پروژه (Approved Structure)
ساختاری که دادی تأیید میشود ✅
با ۳ اصلاح پیشنهادی:
اصلاح 1 — Entry Point
- src/app/main.jsx
+ src/main.jsx
اصلاح 2 — اضافه کردن vite.config.js
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
export default defineConfig({
plugins: [react()],
resolve: {
alias: {
'@': '/src',
},
},
});
اصلاح 3 — Validation واقعی
Backend: zod یا joi
Frontend: react-hook-form + zod
لایه 3 — Auth Blueprint (کامل + امن)
Registration
Email + Password
Hash (bcrypt)
Create OTP
Send Email
Verify OTP
Activate Account
Login
Email + Password
JWT Access
Refresh Token
Google Login
OAuth
Auto register
Role = user
پیشنهاد
مسیرها جدا، logic در controller، سرویس مستقل
لایه 4 — Dashboard & LMS
Dashboard Modules
Profile
My Courses
Progress
Resume Learning
Settings
LMS Structure
Course
└── Sections
└── Lessons
├── Text
├── Code
├── Quiz
└── Project
پیشنهاد حرفهای
قفل درسها
ذخیره آخرین موقعیت
درصد پیشرفت
لایه 5 — UI/UX System
Design Rules
Tailwind + Design Tokens
Dark / Light
RTL / LTR
Dashboard Layout ثابت
پیشنهاد ارتقایی
Framer Motion برای transitions
Skeleton loaders
Empty states حرفهای
لایه 6 — i18n واقعی (نه نمایشی)
Lazy load زبانها
مسیرهای مشترک
ذخیره زبان در LocalStorage
SEO-friendly
لایه 7 — Backend Hardening (امنیت)
Rate Limiter
Helmet
CORS policy
Central Error Handler
Logger (Winston)
لایه 8 — تست (حرفهای)
Backend
Unit: services
Integration: routes
Auth flow test
Frontend
Component tests
Auth flow
Protected routes
لایه 9 — Docker & Production
Docker
Dockerfile client
Dockerfile server
docker-compose واقعی
Deploy
Frontend → Vercel
Backend → Render
DB → Atlas و یک پوشه به اسم (۱) درست کن به عنوان مرجعشون بعد بقیه پوشه ها و فایل ها طبق نقشه با داخل پوشه ۱