{"id":20565705,"url":"https://github.com/puskar-roy/e-learning-platform----backend","last_synced_at":"2026-02-14T06:31:10.937Z","repository":{"id":231135398,"uuid":"780794949","full_name":"Puskar-Roy/E-learning-Platform----Backend","owner":"Puskar-Roy","description":"E-learning Platform with Typescript, Node Js, Express Js, Prisma, Postgre SQL For Serverless Postgre SQL - Neon DB, For Email Send - Resend, For File Upload - Cloudinary","archived":false,"fork":false,"pushed_at":"2025-03-05T18:03:42.000Z","size":328,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-09T04:11:19.123Z","etag":null,"topics":["expressjs","nodejs","postgresql","prisma-orm","typescript"],"latest_commit_sha":null,"homepage":"https://elearningplatformm.vercel.app","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Puskar-Roy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"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}},"created_at":"2024-04-02T07:10:14.000Z","updated_at":"2025-03-05T18:03:45.000Z","dependencies_parsed_at":"2025-01-16T19:51:24.259Z","dependency_job_id":null,"html_url":"https://github.com/Puskar-Roy/E-learning-Platform----Backend","commit_stats":null,"previous_names":["puskar-roy/e-learning-platform----backend"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Puskar-Roy/E-learning-Platform----Backend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Puskar-Roy%2FE-learning-Platform----Backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Puskar-Roy%2FE-learning-Platform----Backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Puskar-Roy%2FE-learning-Platform----Backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Puskar-Roy%2FE-learning-Platform----Backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Puskar-Roy","download_url":"https://codeload.github.com/Puskar-Roy/E-learning-Platform----Backend/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Puskar-Roy%2FE-learning-Platform----Backend/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29438758,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T05:24:35.651Z","status":"ssl_error","status_checked_at":"2026-02-14T05:24:34.830Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["expressjs","nodejs","postgresql","prisma-orm","typescript"],"created_at":"2024-11-16T04:38:46.724Z","updated_at":"2026-02-14T06:31:10.921Z","avatar_url":"https://github.com/Puskar-Roy.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ca name=\"readme-top\"\u003e\u003c/a\u003e\n\n\u003cbr /\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://github.com/Puskar-Roy/Attendance-System---Backend\"\u003e\n    \u003cimg src=\"https://t4.ftcdn.net/jpg/01/28/93/91/360_F_128939133_0WXTVdZ1bv1NXusQsdYYJLIwTVoXHqQ7.jpg\" alt=\"Logo\" width=\"150\" height=\"120\"\u003e\n  \u003c/a\u003e\n\n\n  \u003ch3 align=\"center\"\u003eE-learning Portal - Backend\u003c/h3\u003e\n\n  \u003cp align=\"center\"\u003e\n    \u003cbr /\u003e\n    \u003ca href=\"https://www.postman.com/warped-resonance-359125/workspace/e-learning-platform\"\u003e\u003cstrong\u003ePostman Public Workspace\u003c/strong\u003e\u003c/a\u003e\n    \u003cbr /\u003e\n    \u003cbr /\u003e\n    \u003ca href=\"https://elearningplatformm.vercel.app\"\u003eView Demo\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/Puskar-Roy/E-learning-Platform----Backend/issues\"\u003eReport Bug\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/Puskar-Roy/E-learning-Platform----Backend/issues\"\u003eRequest Feature\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n\n\n##### Note: *For production, include your frontend URL in the `whitelist` array within `src/index.ts`. Update the `.env` file by setting `DEV_MODE=PROD` to ensure that CORS is restricted. In `DEV_MODE=DEV`, any URL can send requests to the backend. Set `EMAIL_SERVICE=RESEND` to use the default email service as Resend. Note that in the free tier of Resend, you can only send emails to your own email account. The current setup utilizes the NodeMailer SMTP service. For testing the API, use the admin credentials: email: `admin@admin.com`, password: `admin`*\n\n## API End Points\n\n### 1. Authentication Routes\n```bash\n/api/v0.1/auth/login                                      POST               //for login\n/api/v0.1/auth/register                                   POST               //for register\n/api/v0.1/auth/forgot-password                            GET                //for forgot password\n/api/v0.1/auth/reset-password                             POST               //for reset password \n```\n\n### 2. Users Routes\n\n```bash\n/api/v0.1/users                                           GET                //for all users\n/api/v0.1/users/:id                                       GET                //for a single user\n/api/v0.1/users/:id                                       DELETE             //for delete a user\n/api/v0.1/users/:id                                       PUT                //for update a user\n/api/v0.1/users/:userId/enrollments                       GET                //for get all enrolled courses of a user\n```\n\n### 3. Course Routes\n\n```bash\n/api/v0.1/course                                          POST               //for create a course admin only\n/api/v0.1/course?category=Python\u0026level=Advance            GET                //for get all courses and you can add queries but its optional\n/api/v0.1/course?category=JS\u0026level=Beginner\u0026page=1\u0026pageLimit=3               //pagination with all the queries but its all optional\n/api/v0.1/course/:id                                      PUT                //for update a course admin only\n/api/v0.1/course/:id                                      DELETE             //for delete a course admin only\n/api/v0.1/course/:id                                      GET                //for get a single course\n/api/v0.1//course/trending                                GET                //for popular courses based on user enrollment\n/api/v0.1/course/:courseId/enroll                         POST               //for enroll in a course\n/api/v0.1/course/:courseId/leave                          DELETE             //for leave from a course\n/api/v0.1/course/:courseId/reviews                        GET                //for getting all reviews of a course\n```\n\n### 4. Review Routes\n\n```bash\n/api/v0.1/review                                         POST               //for create a review\n/api/v0.1/review/:id                                     DELETE             //for delete a review\n/api/v0.1/review/:id                                     PUT                //for update a review\n```\n\n\n### 5. Profile Routes\n\n```bash\n/api/v0.1/users/:userId/profile                          POST               //for set profile and profile pic of a user\n/api/v0.1/users/:userId/profile                          PUT                //for update profile and profile pic of a user\n```\n\n\n\n## Getting Started 🚀\n\n### Prerequisites\nBefore you begin contributing to this project, make sure you have the following set up:\n\n- [Node.js](https://nodejs.org/): A JavaScript runtime.\n- [npm](https://www.npmjs.com/): The Node.js package manager.\n\n### Run This ⌨️\n\n1. **Clone the Repository:**\n   ```bash\n   git clone https://github.com/Puskar-Roy/E-learning-Platform----Backend\n   ```\n2. **Install Dependencies:**\n   ```bash\n    npm install\n   ```\n3. **Add Environment Variables:**\n   ```bash\n   touch .env\n   ```\n4. **Add the necessary configuration:**\n   ```bash\n    PORT = 8000\n    JWT_SECRET=\"erknevlkenrlkijerjoikmlefnlfrnjfrklsdk;\"        //jwt secret\n    JWT_COOKIE_EXPIRES_IN=\"3d\"                                  //in days     \n    RESEND_API=\u003cresend-api\u003e\n    DATABASE_URL=\u003cdatabase-url\u003e\n    CLOUDINARY_CLOUD_NAME=\u003ccloud-name\u003e\n    CLOUDINARY_API_KEY=\u003capi-key\u003e\n    CLOUDINARY_API_SECRET=\u003capi-secret\u003e\n    DEV_MODE=DEV                                               // node env = DEV or PROD\n    BACKENDURL=http://localhost:8000                           // your backend URL\n    EMAIL_SERVICE=RESEND                                       // RESEND or NODEMAILER\n    EMAIL=\u003cyour-email\u003e                                         // Need If you use Email service as Node Mailer\n    PASSWORD=xbwcpouxmlzcauxm                                  //This password is not your Gmail password. To obtain it, enable two-step verification for your Gmail account. Then, create an app password in your Gmail settings then you get the password.\n   ```\n5. **Run This Project:**\n   ```bash\n   npm run dev\n   ```\n\n   \u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\n\n\n## About The Project\n\n\n- **Linting \u0026 Formatting:**\n  - ✔️ ESLint for code linting\n  - 🎨 Prettier for code formatting\n\n- **Deployment:**\n  - 🌐 Ready for deployment on Vercel\n  - 🚀 One-click deployment\n\n- **Development Workflow:**\n  - 🔧 Configured for TypeScript\n  - 🔄 Live reload for efficient development\n  - 🛠 Optimized code for production\n\n- **Security Measures Added:**\n  - 🔐 Helmet for setting up security headers\n  - 🔒 XSS protection with xss-clean middleware\n  - 🚧 HTTP Parameter Pollution (HPP) protection\n  - 🧼 MongoDB data sanitization with express-mongo-sanitize\n  - 🚦 Rate limiting with express-rate-limit for protection against brute-force attacks\n  - 🌐 CORS (Cross-Origin Resource Sharing) configured to allow requests only from a specific origin  \n\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n### Built With\n\n\n\n- **[![Node.js](https://img.shields.io/badge/Node.js-43853D?style=for-the-badge\u0026logo=node.js\u0026logoColor=white)](https://nodejs.org/):** A JavaScript runtime built on Chrome's V8 JavaScript engine.\n- **[![Express.js](https://img.shields.io/badge/Express.js-404D59?style=for-the-badge)](https://expressjs.com/):** Fast, unopinionated, minimalist web framework for Node.js.\n- **[![TypeScript](https://shields.io/badge/TypeScript-3178C6?logo=TypeScript\u0026logoColor=FFF\u0026style=flat-square)](https://www.typescriptlang.org/):** A superset of JavaScript that adds static types.\n- **[![JavaScript](https://img.shields.io/badge/JavaScript-323330?style=for-the-badge\u0026logo=javascript\u0026logoColor=F7DF1E)](https://developer.mozilla.org/en-US/docs/Web/JavaScript):** The programming language of \n- **[![MongoDB](https://img.shields.io/badge/MongoDB-4EA94B?style=for-the-badge\u0026logo=mongodb\u0026logoColor=white)](https://www.mongodb.com/):** The database for modern applications.\n- **[![Vercel](https://img.shields.io/badge/Vercel-000000?style=for-the-badge\u0026logo=vercel\u0026logoColor=white)](https://vercel.com/):** Cloud platform for serverless deployment and hosting.\n- **[![ESLint](https://img.shields.io/badge/ESLint-4B32C3?style=for-the-badge\u0026logo=eslint\u0026logoColor=white)](https://eslint.org/):** Pluggable linting utility for identifying and fixing code issues.\n- **[![Prettier](https://img.shields.io/badge/Prettier-F7B93E?style=for-the-badge\u0026logo=prettier\u0026logoColor=white)](https://prettier.io/):** Opinionated code formatter to ensure consistent code styling the web.\n\n\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\n## Contributing 🌟   \n### Making Contributions\n\nWe welcome and appreciate contributions from the community ❤️! Here's how you can contribute:\n\n- **Open Issues:** Check for open issues or create a new one to start discussions.\n- **Fork the Repository:** Fork the project to your own GitHub account.\n- **Create Pull Request:** Make changes in your fork and submit a pull request.\n\n### Welcome Contributors!\n\n🚀 Thank you for considering contributing to this project! Your involvement makes this template even better. Feel free to explore the code, share your ideas, and make improvements ✌️.\n\n🌟 Don't hesitate to reach out if you have any questions or need assistance. Together, let's make this project amazing!🟩\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n### Puskar Roy 🖋️\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpuskar-roy%2Fe-learning-platform----backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpuskar-roy%2Fe-learning-platform----backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpuskar-roy%2Fe-learning-platform----backend/lists"}