{"id":26996443,"url":"https://github.com/chirag-s-kotian/server","last_synced_at":"2026-04-12T10:43:56.400Z","repository":{"id":283973399,"uuid":"870220806","full_name":"Chirag-S-Kotian/server","owner":"Chirag-S-Kotian","description":"a backend repo for cdrive project build using nodejs,typescript,cloudinary,prisma,neon postgresql,multer,etc.","archived":false,"fork":false,"pushed_at":"2025-03-23T11:46:44.000Z","size":60,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-23T12:28:04.996Z","etag":null,"topics":["cloudinary","expressjs","jwt-tokens","multer-storage","neon-postgresql","nodejs","nodemailer","prisma","typescript"],"latest_commit_sha":null,"homepage":"https://server-five-black.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/Chirag-S-Kotian.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-10-09T16:46:49.000Z","updated_at":"2025-03-23T11:46:48.000Z","dependencies_parsed_at":"2025-03-23T12:38:07.490Z","dependency_job_id":null,"html_url":"https://github.com/Chirag-S-Kotian/server","commit_stats":null,"previous_names":["chirag-s-kotian/server"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chirag-S-Kotian%2Fserver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chirag-S-Kotian%2Fserver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chirag-S-Kotian%2Fserver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chirag-S-Kotian%2Fserver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Chirag-S-Kotian","download_url":"https://codeload.github.com/Chirag-S-Kotian/server/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247103239,"owners_count":20884024,"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":["cloudinary","expressjs","jwt-tokens","multer-storage","neon-postgresql","nodejs","nodemailer","prisma","typescript"],"created_at":"2025-04-04T01:18:46.217Z","updated_at":"2026-04-12T10:43:56.393Z","avatar_url":"https://github.com/Chirag-S-Kotian.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\n\n\r\n# CDrive - Backend\r\n\r\nWelcome to the **CDrive** backend repository! CDrive is a cloud-based file storage system that allows users to upload, store, and manage files securely. This backend service handles user authentication, file management, and secure integration with **Cloudinary** for file storage.\r\n\r\n## Features\r\n\r\n- **User Authentication**: Register, login, and email verification using OTP.\r\n- **File Management**: Upload, update, retrieve, and delete files securely.\r\n- **Cloud Integration**: Stores files using **Cloudinary**.\r\n- **Authentication Middleware**: Ensures that only authorized users can perform certain actions.\r\n\r\n## Table of Contents\r\n\r\n1. [Technologies Used](#technologies-used)\r\n2. [Installation](#installation)\r\n3. [Usage](#usage)\r\n4. [Environment Variables](#environment-variables)\r\n5. [API Endpoints](#api-endpoints)\r\n6. [Inspiration](#inspiration)\r\n7. [Author](#author)\r\n\r\n## Technologies Used\r\n\r\n- **Node.js**: Server-side JavaScript runtime.\r\n- **Express**: Web framework for Node.js.\r\n- **Prisma**: ORM for interacting with the database.\r\n- **PostgreSQL**: Relational database.\r\n- **Cloudinary**: Cloud-based image and file management.\r\n- **JWT**: For secure authentication.\r\n- **Multer**: For handling file uploads.\r\n- **Nodemailer**: For sending email verifications.\r\n\r\n## Installation\r\n\r\nFollow these steps to set up the backend on your local machine:\r\n\r\n### 1. Clone the repository\r\n\r\n```bash\r\ngit clone https://github.com/Chirag-S-Kotian/server.git\r\n```\r\n\r\n### 2. Navigate to the project directory\r\n\r\n```bash\r\ncd server\r\n```\r\n\r\n### 3. Install dependencies\r\n\r\n```bash\r\nnpm install\r\n```\r\n\r\n### 4. Set up environment variables\r\n\r\nCreate a `.env` file in the root of your project and add the following variables:\r\n\r\n```bash\r\nDATABASE_URL=your_postgresql_database_url\r\nJWT_SECRET=your_jwt_secret\r\nCLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name\r\nCLOUDINARY_API_KEY=your_cloudinary_api_key\r\nCLOUDINARY_API_SECRET=your_cloudinary_api_secret\r\nMAIL_USER=your_email_address_for_sending_verifications\r\nMAIL_PASSWORD=your_email_password\r\n```\r\n\r\n### 5. Set up the database\r\n\r\nRun Prisma migrations to set up the PostgreSQL database:\r\n\r\n```bash\r\nnpx prisma migrate dev\r\n```\r\n\r\n### 6. Start the server\r\n\r\n```bash\r\nnpm run dev\r\n```\r\n\r\nThe server will start running on `http://localhost:4000`.\r\n\r\n## Usage\r\n\r\nOnce your server is up and running, you can interact with the backend via API endpoints.\r\n\r\n### 1. **User Registration and Login**\r\n\r\n- **Register**: POST `/api/users/register`\r\n- **Login**: POST `/api/users/login`\r\n- **Verify OTP**: POST `/api/users/verify`\r\n\r\n### 2. **File Management**\r\n\r\n- **Upload File**: POST `/api/files/upload`\r\n- **Get All Files**: GET `/api/files`\r\n- **Get File by ID**: GET `/api/files/:id`\r\n- **Update File**: PUT `/api/files/:id`\r\n- **Delete File**: DELETE `/api/files/:id`\r\n\r\n## Environment Variables\r\n\r\nTo run this project, you will need to set the following environment variables in your `.env` file:\r\n\r\n- `DATABASE_URL`: Your PostgreSQL connection URL.\r\n- `JWT_SECRET`: A secret key for generating JSON Web Tokens.\r\n- `CLOUDINARY_CLOUD_NAME`: Your Cloudinary account name.\r\n- `CLOUDINARY_API_KEY`: Your Cloudinary API key.\r\n- `CLOUDINARY_API_SECRET`: Your Cloudinary API secret.\r\n- `MAIL_USER`: The email address used to send OTPs.\r\n- `MAIL_PASSWORD`: The password for the email account.\r\n\r\n## API Endpoints\r\n\r\nHere are the main routes available:\r\n\r\n### User Routes (`/api/users`)\r\n\r\n| Route            | Method | Description                 |\r\n|------------------|--------|-----------------------------|\r\n| `/register`      | POST   | Register a new user         |\r\n| `/login`         | POST   | Login an existing user      |\r\n| `/verify`        | POST   | Verify user OTP             |\r\n\r\n### File Routes (`/api/files`)\r\n\r\n| Route            | Method | Description                    |\r\n|------------------|--------|--------------------------------|\r\n| `/upload`        | POST   | Upload a new file              |\r\n| `/`              | GET    | Get all files for a user       |\r\n| `/:id`           | GET    | Get a specific file by ID      |\r\n| `/:id`           | PUT    | Update a file's details        |\r\n| `/:id`           | DELETE | Delete a file from storage     |\r\n\r\n## Inspiration\r\n\r\n\"To achieve something remarkable, we must go beyond what is comfortable and expected. **CDrive** isn't just another file management tool—it's a testament to the power of persistence, creativity, and belief in the process. Every feature, every bug fix, and every improvement is a step towards excellence.\"\r\n\r\nAs developers, we write more than just code. We write our stories of resilience, determination, and growth. Remember, the journey is as important as the destination.\r\n\r\nKeep pushing boundaries, and keep creating something that truly matters.\r\n\r\n## Author\r\n\r\nDeveloped by **Chirag S Kotian**.\r\n\r\nFeel free to reach out for any questions, feedback, or collaboration!\r\n\r\n---","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchirag-s-kotian%2Fserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchirag-s-kotian%2Fserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchirag-s-kotian%2Fserver/lists"}