{"id":29534502,"url":"https://github.com/khaledsaeed18/yalla-learn-backend","last_synced_at":"2025-07-17T00:38:58.676Z","repository":{"id":295459599,"uuid":"941185816","full_name":"KhaledSaeed18/yalla-learn-backend","owner":"KhaledSaeed18","description":"Yalla Learn - 🚀 Backend","archived":false,"fork":false,"pushed_at":"2025-06-29T14:11:37.000Z","size":397,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-29T15:25:20.638Z","etag":null,"topics":["2fa","backend","expressjs","jwt","nodejs","nodemailer","nodemon","postgresql","prisma","restful-api","typescript","zod"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KhaledSaeed18.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-03-01T17:36:15.000Z","updated_at":"2025-06-29T14:11:41.000Z","dependencies_parsed_at":"2025-05-25T17:44:11.764Z","dependency_job_id":"a1b95a88-59af-4fd5-a986-447b6d7b9556","html_url":"https://github.com/KhaledSaeed18/yalla-learn-backend","commit_stats":null,"previous_names":["khaledsaeed18/yalla-learn-backend"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/KhaledSaeed18/yalla-learn-backend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KhaledSaeed18%2Fyalla-learn-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KhaledSaeed18%2Fyalla-learn-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KhaledSaeed18%2Fyalla-learn-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KhaledSaeed18%2Fyalla-learn-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KhaledSaeed18","download_url":"https://codeload.github.com/KhaledSaeed18/yalla-learn-backend/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KhaledSaeed18%2Fyalla-learn-backend/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265555169,"owners_count":23787349,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["2fa","backend","expressjs","jwt","nodejs","nodemailer","nodemon","postgresql","prisma","restful-api","typescript","zod"],"created_at":"2025-07-17T00:38:57.946Z","updated_at":"2025-07-17T00:38:58.671Z","avatar_url":"https://github.com/KhaledSaeed18.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Yalla Learn Backend\n\n[![TypeScript](https://img.shields.io/badge/TypeScript-007ACC?logo=typescript\u0026logoColor=white)](https://www.typescriptlang.org/)\n[![Node.js](https://img.shields.io/badge/Node.js-43853D?logo=node.js\u0026logoColor=white)](https://nodejs.org/)\n[![Express.js](https://img.shields.io/badge/Express.js-404D59?logo=express)](https://expressjs.com/)\n[![Prisma](https://img.shields.io/badge/Prisma-3982CE?logo=Prisma\u0026logoColor=white)](https://www.prisma.io/)\n[![PostgreSQL](https://img.shields.io/badge/PostgreSQL-316192?logo=postgresql\u0026logoColor=white)](https://www.postgresql.org/)\n\nA comprehensive backend API for the Yalla Learn platform.\n\n## 🏗️ Architecture\n\n### Technology Stack\n\n- **Runtime**: Node.js with TypeScript\n- **Framework**: Express.js\n- **Database**: PostgreSQL with Prisma ORM\n- **Authentication**: JWT with speakeasy for 2FA\n- **Validation**: Zod schemas\n- **Email**: Nodemailer with Google OAuth2\n- **Security**: bcryptjs, sanitize-html, express-rate-limit\n\n### Project Structure\n\n```bash\nsrc/\n├── api/                    # API modules\n│   ├── auth/              # Authentication endpoints\n│   ├── blog/              # Blog management\n│   ├── contact/           # Contact form\n│   ├── expense-tracker/   # Financial tracking\n│   ├── jobs/              # Job board\n│   ├── kanban/            # Task management\n│   ├── listings/          # Marketplace listings\n│   ├── qa/                # Q\u0026A platform\n│   ├── services/          # Service directory\n│   └── user/              # User management\n├── constants/             # Application constants\n├── middlewares/           # Express middlewares\n├── types/                 # TypeScript type definitions\n└── utils/                 # Utility functions\n```\n\n## 🚦 Getting Started\n\n### Prerequisites\n\n- Node.js (v18 or higher)\n- PostgreSQL database\n- SMTP credentials (for email functionality)\n- Google OAuth2 credentials (for email service)\n\n### Installation\n\n1. **Clone the repository**\n\n   ```bash\n   git clone https://github.com/KhaledSaeed18/yalla-learn-backend.git\n   cd yalla-learn-backend\n   ```\n\n2. **Install dependencies**\n\n   ```bash\n   yarn install\n   ```\n\n3. **Environment Setup**\n\n   Configure the following variables in `.env`:\n\n   ```env\n   # Server Configurations\n    PORT=\n    API_VERSION=\n    BASE_URL=\n\n    # App Configurations\n    SALT_ROUNDS=\n\n    # Database Configurations\n    DATABASE_URL=\n\n    # JWT Configurations\n    JWT_SECRET=\n    JWT_REFRESH_SECRET=\n\n    # Email Configurations\n    CLIENT_ID=\n    CLIENT_SECRET=\n    REFRESH_TOKEN=\n    USER_EMAIL=\n    REDIRECT_URI=\n\n    # AI Configurations\n    GEMINI_API_KEY=\n\n   ```\n\n4. **Database Setup**\n\n   ```bash\n   npx prisma generate\n   npx prisma db push\n   ```\n\n5. **Start Development Server**\n\n   ```bash\n   yarn dev\n   ```\n\n### Production Deployment\n\n1. **Build the project**\n\n   ```bash\n   yarn build\n   ```\n\n2. **Start production server**\n\n   ```bash\n   yarn start\n   ```\n\n## 📚 API Documentation\n\n### Base URL\n\n```bash\nDevelopment: http://localhost:5000/api/v1\n```\n\n### Response Format\n\nAll API responses follow a consistent format:\n\n```json\n{\n  \"status\": \"success\" | \"fail\" | \"error\",\n  \"statusCode\": 200,\n  \"message\": \"Operation completed successfully\",\n  \"data\": { ... }\n}\n```\n\n## 🛡️ Security Features\n\n### Input Validation \u0026 Sanitization\n\n- **Zod Schema Validation** for request data\n- **HTML Sanitization** to prevent XSS attacks\n- **SQL Injection Prevention** via Prisma ORM\n- **Rate Limiting** to prevent abuse\n\n### Authentication Security\n\n- **Secure Password Hashing** using bcryptjs\n- **JWT Token Security** with short-lived access tokens\n- **2FA Implementation** using TOTP standard\n- **Email Verification** for account security\n\n### Data Protection\n\n- **CORS Configuration** for cross-origin security\n- **Security Headers** implementation\n- **Environment Variable Protection**\n- **Input Length Restrictions**\n\n## 🔧 Development\n\n### Code Standards\n\n- **TypeScript** for type safety\n- **ESLint** for code linting\n- **Prisma** for database operations\n- **Modular Architecture** with separation of concerns\n\n### Available Scripts\n\n```bash\nyarn dev        # Start development server with hot reload\nyarn build      # Build for production\nyarn start         # Start production server\nyarn lint      # Run ESLint\n```\n\n### Environment Variables\n\nThe application requires proper environment configuration for:\n\n- Database connection\n- JWT secrets\n- Email service credentials\n- CORS origins\n- Rate limiting settings\n\n## 🤝 Contributing\n\nWe welcome contributions! Please see our [Contributing Guidelines](CONTRIBUTING.md) for details.\n\n### Development Workflow\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Add tests if applicable\n5. Submit a pull request\n\n### Code Review Process\n\n- All changes require review\n- Automated checks must pass\n- Follow existing code patterns\n- Update documentation as needed\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## 📞 Support\n\n- **Bug Reports**: [GitHub Issues](https://github.com/KhaledSaeed18/yalla-learn-backend/issues)\n\n\u003cdiv align=\"center\"\u003e\n\n## 🌐 Visit Our Website\n\n**Experience Yalla Learn in your browser!**\n\n### [🚀 Try Yalla Learn →](https://yalla-learn.me)\n\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhaledsaeed18%2Fyalla-learn-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkhaledsaeed18%2Fyalla-learn-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhaledsaeed18%2Fyalla-learn-backend/lists"}