Coder Social home page Coder Social logo

mohamed-lifa7 / next-drive Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 2.0 619 KB

Next Drive is a powerful web application that closely resembles Google Drive. It is designed to simplify file management tasks such as uploading, organizing files into folders (including nested folders), and offering a comprehensive search functionality, among other essential features.

License: MIT License

JavaScript 2.19% TypeScript 97.27% CSS 0.54%
file-upload firebase google-drive google-drive-clone nextjs13 storage

next-drive's Introduction

Next Drive

Next Drive is a powerful web application that closely resembles Google Drive. It is designed to simplify file management tasks such as uploading, organizing files into folders (including nested folders), and offering a comprehensive search functionality, among other essential features.


Table of Contents

  1. Introduction
  2. Preview
  3. Getting Started
  4. Project Structure
  5. Usage
  6. Configuration
  7. Deployment
  8. Contributing
  9. License

Introduction

Your all-in-one solution for efficient cloud-based file management. This web application simplifies the process of uploading, organizing, and accessing your files securely, no matter where you are. Whether you need to store personal documents, collaborate with others, or simply find a specific file in a massive collection, Next Drive has you covered.

Preview

preveiw

preview dark theme

Dark Mode Preview

Tech Stack

Next Drive is built using a variety of technologies and frameworks that make it powerful and efficient. Here's an overview of the key components in our tech stack:

  • Next.js: A popular React framework for building server-rendered and statically generated web applications.

  • NextAuth.js: An authentication library for Next.js that simplifies the implementation of authentication, including OAuth providers, JWT, and more.

  • Firebase: A comprehensive platform for building web and mobile applications, including Firestore for NoSQL database, Firebase Storage for file storage, and Firebase Admin for server-side operations.

  • Tailwind CSS: A highly customizable CSS framework that allows for rapid UI development with utility-f first classes.

  • Shadcn UI: A UI library built using Tailwind CSS and Radix UI that provides a collection of copy-paste components for creating a consistent and stylish user interface.

  • Zod: A TypeScript-first schema validation and object serialization library.

Our tech stack is carefully chosen to provide a robust and scalable foundation for Next Drive, ensuring a fast and secure user experience.

Getting Started

To start working with Next Drive locally, follow these steps:

Prerequisites

Before you begin, make sure you have the following prerequisites in place:

  • Node.js installed on your machine.
  • A Firebase project set up with the required API keys. Refer to the .env.example file for specific details on the required keys.

Installation

  1. Clone the repository to your local machine:
git clone https://github.com/mohamed-lifa7/next-drive.git
  1. Navigate to the project directory:
cd next-drive
  1. Install the project dependencies using npm:
npm install
  1. Create a .env file in the project's root directory and populate it with the necessary API keys and configuration information from the .env.example file.
cp .env.example .env

Edit the .env file with your API keys and configuration details.

  1. Start the development server:
npm run dev
  1. The Next Drive application should now be running locally at http://localhost:3000. You can access it in your web browser.

Now you have Next Drive set up locally on your machine and can start exploring and contributing to the project. If you encounter any issues or have questions, feel free to reach out to us.

Project Structure

Next Drive uses app directory instead of pages directory and follows a well-organized project structure to keep codebase clean and maintainable. Here's an overview of directories tree of the project:

│
├── .next
├── .git
├── public
├── node_modules
├── src
│   ├── app
│   │   ├── api
│   │   │   ├── auth
│   │   │   │   └── [...nextauth]
│   │   │   │       └── route.ts
│   │   │   └── ...
│   │   ├── auth
│   │   │   ├── error
│   │   │   │   └── page.tsx
│   │   │   ├── error.tsx
│   │   │   ├── signin
│   │   │   │   ├── page.tsx
│   │   │   │   └── profile-setup
│   │   │   │       └── page.tsx
│   │   │   └── ...
│   │   ├── contact
│   │   │   └── page.tsx
│   │   ├── ...
│   ├── components
│   │   ├── auth
│   │   │   ├── auth-buttons.tsx
│   │   │   ├── user-auth-form.tsx
│   │   │   └── who-am-i.tsx
│   │   ├── icons.tsx
│   │   ├── layout
│   │   │   ├── features.tsx
│   │   │   ├── footer.tsx
│   │   │   ├── ...
│   │   ├── others
│   │   │   ├── feedback-form.tsx
│   │   │   └── share-file-form.tsx
│   │   ├── ...
│   ├── context
│   │   ├── folder-navigation.context.tsx
│   │   ├── nextauth-provider.tsx
│   │   └── ...
│   ├── lib
│   │   ├── firebase
│   │   │   ├── file-utils.ts
│   │   │   ├── firebase-admin-config.ts
│   │   │   ├── ...
│   │   ├── site.ts
│   │   └── ...
│   ├── middleware.ts
│   ├── server
│   │   └── auth.ts
│   ├── styles
│   │   └── globals.css
│   └── types
│       ├── index.ts
│       └── schema.ts
├── components.json
├── next.config.mjs
├── next-end.d.ts
├── package.json
├── package-lock.json
├── postcss.config.cjs
├── prettier.config.mjs
├── README.md
├── tailwind.config.ts
├── tsconfig.json
├── .env
├── .env.example
├── .eslintrc.chs
├── .gitignore
└── ...

Contributing

We welcome contributions from the community to help improve Next Drive. Whether you want to report a bug, suggest an enhancement, or contribute code, your help is greatly appreciated.

Reporting Issues

If you encounter a bug, have a feature request, or want to suggest improvements, please open an issue on our GitHub issue tracker. When submitting an issue, please provide as much detail as possible, including steps to reproduce the problem if applicable.

Proposing Changes

If you'd like to contribute code to Next Drive, please follow these steps:

  1. Fork the repository to your own GitHub account.
  2. Clone your forked repository to your local machine.
git clone https://github.com/mohamed-lifa7/next-drive.git
  1. Create a new branch for your feature or bug fix.
git checkout -b feature-name
  1. Make your changes and commit them with descriptive commit messages.
  2. Push your changes to your GitHub repository.
git push origin feature-name
  1. Open a pull request (PR) to the main repository's main branch. Provide a clear title and description for your PR.
  2. Your PR will be reviewed, and any necessary feedback or changes will be discussed. Once your PR is approved, it will be merged into the main project.

Code Style

To maintain code consistency, we use ESLint for JavaScript/TypeScript linting. Please make sure your code adheres to our coding standards. You can run ESLint using the following command:

npm run lint

Contact

If you have any questions or need further assistance, you can reach out to us through the contact section within the app or by creating an issue on GitHub.

Thank you for contributing to Next Drive! We appreciate your support and look forward to your contributions.

Configuration

The configuration settings for Next Drive are stored in the .env.example file in the project's root directory. To configure the application, follow these steps:

  1. Locate the .env.example file in the project's root directory.

  2. Create a copy of the .env.example file and rename it to .env.

  3. Open the newly created .env file in a text editor.

  4. Modify the configuration settings as needed, including API keys and environment-specific variables. Ensure that you provide the required API keys and credentials, as specified in the .env.example file.

  5. Save the .env file with your changes.

The configuration settings in the .env file are used by Next Drive to connect to external services, manage environment variables, and customize the behavior of the application.

Note: Ensure that you keep sensitive information, such as API keys and credentials, confidential and do not share them publicly. Use environment variables and consider using a secrets management solution for added security.

Deployment

To deploy Next Drive, we recommend using Vercel, a powerful platform for serverless deployment and hosting. Vercel is well-suited for Next.js applications and offers a seamless deployment process.

Deploy with Vercel

Note: While we recommend Vercel for its ease of use and seamless integration with Next.js, you can use other platforms like Netlify or Docker if you prefer. However, for the purpose of this guide, we'll stick with Vercel as our recommended deployment platform.

Follow these steps to deploy Next Drive on Vercel:

  1. Visit the Vercel Next.js deployment guide to get started.

  2. Sign up for a Vercel account if you don't already have one.

  3. Connect your Vercel account to your GitHub repository where Next Drive is hosted.

  4. Configure your deployment settings as needed.

  5. Click the "Deploy" button.

During the setup, you need to define the all the environment variables

Vercel will automatically build and deploy your Next Drive application. Once the deployment is complete, you'll receive a URL where you can access your live application.

By deploying on Vercel, you can take advantage of its powerful features, such as automatic deployments on every push to your repository, SSL certificates, and easy scaling. It's an excellent choice for hosting Next.js applications.

License

Next Drive is open-source software released under the MIT License. You are free to use, modify, and distribute this software as per the terms of the license.

Show Your Support

If you find Next Drive useful, consider supporting the project in one of the following ways:

  • Star the Repository: If you appreciate the work that has gone into Next Drive, please give it a star on GitHub. Your star helps us gain visibility and encourages more contributors to join the project.

  • Donate: If you'd like to buy us a virtual pizza (or a real one if you're feeling generous), check out our donation options on our GitHub main page. Your support keeps our code well-fed and happy!

Your support is like the extra cheese on our code pizza, making it even more delightful. Thanks for being a slice of the Next Drive community!

next-drive's People

Contributors

mohamed-lifa7 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

next-drive's Issues

[next-auth][error][OAUTH_CALLBACK_HANDLER_ERROR] https://next-auth.js.org/errors#oauth_callback_handler_error 5 NOT_FOUND:

I am getting this error while trying either GitHub or Google oAuth.

[next-auth][debug][adapter_getUserByAccount] { args: [ { providerAccountId: '86073734', provider: 'github' } ] }
[next-auth][error][adapter_error_getUserByAccount] 
https://next-auth.js.org/errors#adapter_error_getuserbyaccount 5 NOT_FOUND:  {
  message: '5 NOT_FOUND: ',
  stack: 'Error: 5 NOT_FOUND: \n' +
    '    at callErrorFromStatus (/Users/ravi.ada/projects/play/next-drive/node_modules/@grpc/grpc-js/build/src/call.js:31:19)\n' +
    '    at Object.onReceiveStatus (/Users/ravi.ada/projects/play/next-drive/node_modules/@grpc/grpc-js/build/src/client.js:357:73)\n' +
    '    at Object.onReceiveStatus (/Users/ravi.ada/projects/play/next-drive/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:323:181)\n' +
    '    at /Users/ravi.ada/projects/play/next-drive/node_modules/@grpc/grpc-js/build/src/resolving-call.js:94:78\n' +
    '    at process.processTicksAndRejections (node:internal/process/task_queues:77:11)\n' +
    'for call at\n' +
    '    at ServiceClientImpl.makeServerStreamRequest (/Users/ravi.ada/projects/play/next-drive/node_modules/@grpc/grpc-js/build/src/client.js:340:32)\n' +
    '    at ServiceClientImpl.<anonymous> (/Users/ravi.ada/projects/play/next-drive/node_modules/@grpc/grpc-js/build/src/make-client.js:105:19)\n' +
    '    at /Users/ravi.ada/projects/play/next-drive/node_modules/@google-cloud/firestore/build/src/v1/firestore_client.js:227:29\n' +
    '    at /Users/ravi.ada/projects/play/next-drive/node_modules/google-gax/build/src/streamingCalls/streamingApiCaller.js:38:28\n' +
    '    at /Users/ravi.ada/projects/play/next-drive/node_modules/google-gax/build/src/normalCalls/timeout.js:44:16\n' +
    '    at Object.request (/Users/ravi.ada/projects/play/next-drive/node_modules/google-gax/build/src/streamingCalls/streaming.js:130:40)\n' +
    '    at makeRequest (/Users/ravi.ada/projects/play/next-drive/node_modules/retry-request/index.js:141:28)\n' +
    '    at retryRequest (/Users/ravi.ada/projects/play/next-drive/node_modules/retry-request/index.js:109:5)\n' +
    '    at StreamProxy.setStream (/Users/ravi.ada/projects/play/next-drive/node_modules/google-gax/build/src/streamingCalls/streaming.js:121:37)\n' +
    '    at StreamingApiCaller.call (/Users/ravi.ada/projects/play/next-drive/node_modules/google-gax/build/src/streamingCalls/streamingApiCaller.js:54:16)\n' +
    '    at /Users/ravi.ada/projects/play/next-drive/node_modules/google-gax/build/src/createApiCall.js:84:30\n' +
    'Caused by: Error\n' +
    '    at Query._get (/Users/ravi.ada/projects/play/next-drive/node_modules/@google-cloud/firestore/build/src/reference.js:1719:23)\n' +
    '    at Query.get (/Users/ravi.ada/projects/play/next-drive/node_modules/@google-cloud/firestore/build/src/reference.js:1707:21)\n' +
    '    at getOneDoc (webpack-internal:///(rsc)/./node_modules/@auth/firebase-adapter/index.js:259:52)\n' +
    '    at getUserByAccount (webpack-internal:///(rsc)/./node_modules/@auth/firebase-adapter/index.js:126:35)\n' +
    '    at _callee2$ (webpack-internal:///(rsc)/./node_modules/next-auth/core/errors.js:301:43)\n' +
    '    at tryCatch (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/regeneratorRuntime.js:36:24)\n' +
    '    at Generator.eval (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/regeneratorRuntime.js:123:25)\n' +
    '    at Generator.eval [as next] (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/regeneratorRuntime.js:64:29)\n' +
    '    at asyncGeneratorStep (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/asyncToGenerator.js:4:28)\n' +
    '    at _next (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/asyncToGenerator.js:22:17)\n' +
    '    at eval (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/asyncToGenerator.js:27:13)\n' +
    '    at new Promise (<anonymous>)\n' +
    '    at eval (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/asyncToGenerator.js:19:16)\n' +
    '    at Object.callback (webpack-internal:///(rsc)/./node_modules/next-auth/core/routes/callback.js:42:49)\n' +
    '    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n' +
    '    at async AuthHandler (webpack-internal:///(rsc)/./node_modules/next-auth/core/index.js:202:38)\n' +
    '    at async NextAuthRouteHandler (webpack-internal:///(rsc)/./node_modules/next-auth/next/index.js:50:30)\n' +
    '    at async NextAuth._args$ (webpack-internal:///(rsc)/./node_modules/next-auth/next/index.js:85:24)\n' +
    '    at async /Users/ravi.ada/projects/play/next-drive/node_modules/next/dist/compiled/next-server/app-route.runtime.dev.js:6:62361',
  name: 'Error'
}
[next-auth][error][OAUTH_CALLBACK_HANDLER_ERROR] 
https://next-auth.js.org/errors#oauth_callback_handler_error 5 NOT_FOUND:  Error: 5 NOT_FOUND: 
    at callErrorFromStatus (/Users/ravi.ada/projects/play/next-drive/node_modules/@grpc/grpc-js/build/src/call.js:31:19)
    at Object.onReceiveStatus (/Users/ravi.ada/projects/play/next-drive/node_modules/@grpc/grpc-js/build/src/client.js:357:73)
    at Object.onReceiveStatus (/Users/ravi.ada/projects/play/next-drive/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:323:181)
    at /Users/ravi.ada/projects/play/next-drive/node_modules/@grpc/grpc-js/build/src/resolving-call.js:94:78
    at process.processTicksAndRejections (node:internal/process/task_queues:77:11)
for call at
    at ServiceClientImpl.makeServerStreamRequest (/Users/ravi.ada/projects/play/next-drive/node_modules/@grpc/grpc-js/build/src/client.js:340:32)
    at ServiceClientImpl.<anonymous> (/Users/ravi.ada/projects/play/next-drive/node_modules/@grpc/grpc-js/build/src/make-client.js:105:19)
    at /Users/ravi.ada/projects/play/next-drive/node_modules/@google-cloud/firestore/build/src/v1/firestore_client.js:227:29
    at /Users/ravi.ada/projects/play/next-drive/node_modules/google-gax/build/src/streamingCalls/streamingApiCaller.js:38:28
    at /Users/ravi.ada/projects/play/next-drive/node_modules/google-gax/build/src/normalCalls/timeout.js:44:16
    at Object.request (/Users/ravi.ada/projects/play/next-drive/node_modules/google-gax/build/src/streamingCalls/streaming.js:130:40)
    at makeRequest (/Users/ravi.ada/projects/play/next-drive/node_modules/retry-request/index.js:141:28)
    at retryRequest (/Users/ravi.ada/projects/play/next-drive/node_modules/retry-request/index.js:109:5)
    at StreamProxy.setStream (/Users/ravi.ada/projects/play/next-drive/node_modules/google-gax/build/src/streamingCalls/streaming.js:121:37)
    at StreamingApiCaller.call (/Users/ravi.ada/projects/play/next-drive/node_modules/google-gax/build/src/streamingCalls/streamingApiCaller.js:54:16)
    at /Users/ravi.ada/projects/play/next-drive/node_modules/google-gax/build/src/createApiCall.js:84:30
Caused by: Error
    at Query._get (/Users/ravi.ada/projects/play/next-drive/node_modules/@google-cloud/firestore/build/src/reference.js:1719:23)
    at Query.get (/Users/ravi.ada/projects/play/next-drive/node_modules/@google-cloud/firestore/build/src/reference.js:1707:21)
    at getOneDoc (webpack-internal:///(rsc)/./node_modules/@auth/firebase-adapter/index.js:259:52)
    at getUserByAccount (webpack-internal:///(rsc)/./node_modules/@auth/firebase-adapter/index.js:126:35)
    at _callee2$ (webpack-internal:///(rsc)/./node_modules/next-auth/core/errors.js:301:43)
    at tryCatch (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/regeneratorRuntime.js:36:24)
    at Generator.eval (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/regeneratorRuntime.js:123:25)
    at Generator.eval [as next] (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/regeneratorRuntime.js:64:29)
    at asyncGeneratorStep (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/asyncToGenerator.js:4:28)
    at _next (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/asyncToGenerator.js:22:17)
    at eval (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/asyncToGenerator.js:27:13)
    at new Promise (<anonymous>)
    at eval (webpack-internal:///(rsc)/./node_modules/@babel/runtime/helpers/asyncToGenerator.js:19:16)
    at Object.callback (webpack-internal:///(rsc)/./node_modules/next-auth/core/routes/callback.js:42:49)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async AuthHandler (webpack-internal:///(rsc)/./node_modules/next-auth/core/index.js:202:38)
    at async NextAuthRouteHandler (webpack-internal:///(rsc)/./node_modules/next-auth/next/index.js:50:30)
    at async NextAuth._args$ (webpack-internal:///(rsc)/./node_modules/next-auth/next/index.js:85:24)
    at async /Users/ravi.ada/projects/play/next-drive/node_modules/next/dist/compiled/next-server/app-route.runtime.dev.js:6:62361 {
  name: 'GetUserByAccountError',
  code: 5
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.