Skip to content

This repository is a FileManager created in NextJS 14. Create a unique user, create your folders and upload your files.

License

Notifications You must be signed in to change notification settings

DiegoLibonati/FileManager-NextJS

Repository files navigation

FileManager NextJS

Getting Started

  1. Clone the repository with git clone "repository link"
  2. Join to filemanager-app folder and execute: npm install or yarn install in the terminal
  3. Go to the previous folder and execute: docker-compose build --no-cache in the terminal
  4. Once built, you must execute the command: docker-compose up --force-recreate in the terminal

NOTE: You have to be standing in the folder containing the: docker-compose.yml and you need to install Docker Desktop if you are in Windows. NOTE: In the folder whose location is: filemanager-app/src/cloud, inside the cloud folder will be created the folders for each user registered in the application. The name of the main folder refers to the user's username.

Description

This repository is a FileManager created in NextJS 14.

  • Login, registration, email verification and password retrieval system
  • Auth system via JWT with public and private routes
  • Email sending with NodeMailer
  • Statistics of available space in your home folder
  • Folder creation
  • File uploading
  • Folder and file deletion
  • Navigating through folders
  • And much more

Technologies used

  1. NextJS 14
  2. Docker
  3. MongoDB
  4. Tailwind CSS
  5. Typescript

Libraries used

Dependencies

"@types/bcryptjs": "^2.4.6"
"@types/jest": "^29.5.14"
"@types/node": "^20.14.0"
"@types/nodemailer": "^6.4.15"
"@types/react": "^18"
"@types/react-dom": "^18"
"@types/supertest": "^6.0.2"
"@reduxjs/toolkit": "^2.2.5"
"axios": "^1.7.2"
"bcryptjs": "^2.4.3"
"jose": "^5.4.0"
"mongoose": "^8.4.1"
"next": "14.2.3"
"nodemailer": "^6.9.14"
"react": "^18"
"react-dom": "^18"
"react-icons": "^5.2.1"
"react-redux": "^9.1.2"

devDependencies

"@testing-library/dom": "^10.4.0"
"@testing-library/jest-dom": "^6.6.3"
"@testing-library/react": "^16.1.0"
"@testing-library/user-event": "^14.5.2"
"eslint": "^8"
"eslint-config-next": "14.2.3"
"jest": "^29.7.0"
"jest-environment-jsdom": "^29.7.0"
"postcss": "^8"
"tailwindcss": "^3.4.1"
"ts-node": "^10.9.2"
"typescript": "^5"
"axios-mock-adapter": "^2.1.0"

Portfolio Link

https://www.diegolibonati.com.ar/#/project/FileManager-NextJS

Video

2024-06-23.17-17-37.mp4

Testing

Frontend

  1. Join to filemanager-app folder
  2. Execute: yarn test or npm test

Documentation APP

Version

APP VERSION: 1.0.0
README UPDATED: 15/01/2024
AUTHOR: Diego Libonati

Env Keys

NOTE: You must create the .env inside the folder filemanager-app

  1. WATCHPACK_POLLING: If set to True fixes the hot reloading problem
  2. NEXT_PUBLIC_API_URL: This is the link to the application if you are in development leave it as localhost
  3. MONGODB_URI: This is the connection URI to the mongo database
  4. SECRET_KEY_AUTH: This environment variable is a random string for signing JWT tokens.
  5. EMAIL: Here you will enter your email
  6. EMAIL_PASS: Here you will enter the application password generated for your email or email company.
# React
WATCHPACK_POLLING=true

# Frontend Envs
NEXT_PUBLIC_API_URL=http://localhost:3000

# Backend Envs
MONGODB_URI=mongodb://root:[email protected]:27017/filemanager?authSource=admin
SECRET_KEY_AUTH=MO1GlDj3f88CzE294KePeWiT9GLG3qIoE9inxNYBadkBwfCUo1
[email protected]
EMAIL_PASS=Your password application

FileManger Endpoints API

NOTE: All the endpoints except the AUTH endpoints, must have a header with the name Authorization whose value of this key is the TOKEN generated by JWT when we log in the APP. We can get it from the cookies.


  • Endpoint Name: Alive
  • Endpoint Route: /api/v1/alive
  • Endpoint Method: GET
  • Endpoint Fn: This endpoint returns the version, author and name of the api.

  • Endpoint Name: Login
  • Endpoint Route: /api/v1/auth/login
  • Endpoint Method: POST
  • Endpoint Fn: Endpoint used to log in to an existing account. Receives a username and password body

  • Endpoint Name: LogOut
  • Endpoint Route: /api/v1/auth/logout
  • Endpoint Method: GET
  • Endpoint Fn: Endpoint for logging out of the application

  • Endpoint Name: Register
  • Endpoint Route: /api/v1/auth/register
  • Endpoint Method: POST
  • Endpoint Fn: Endpoint used to register in the application to log in and access the account. You receive a username, email and password body.

  • Endpoint Name: Reset Password
  • Endpoint Route: /api/v1/auth/reset
  • Endpoint Method: POST
  • Endpoint Fn: Endpoint that serves to reset the password of a specific account by body with id, username and password.

  • Endpoint Name: Send Email Reset Password
  • Endpoint Route: /api/v1/auth/send_email_reset
  • Endpoint Method: POST
  • Endpoint Fn: Endpoint used to send an email to reset the password of an account. Send a body with the email to send the email.

  • Endpoint Name: Verify Email
  • Endpoint Route: /api/v1/auth/verify
  • Endpoint Method: GET
  • Endpoint Fn: Endpoint used to verify the email address of our account. By parameters it will send the id of the hashed user and the username of the account to be verified.

  • Endpoint Name: Get Categories
  • Endpoint Route: /api/v1/filemanager/categories
  • Endpoint Method: GET
  • Endpoint Fn: Endpoint used to obtain all the categories of the application.

  • Endpoint Name: Get Categories Files
  • Endpoint Route: /api/v1/filemanager/categories/files
  • Endpoint Method: GET
  • Endpoint Fn: Endpoint used to obtain the files of a specific category. It receives by parameters the id of the category to check.

  • Endpoint Name: Get All Folders
  • Endpoint Route: /api/v1/filemanager/folders
  • Endpoint Method: GET
  • Endpoint Fn: Endpoint used to obtain all the folders of the application.

  • Endpoint Name: Get Recent Upload File
  • Endpoint Route: /api/v1/filemanager/recent_upload
  • Endpoint Method: GET
  • Endpoint Fn: Endpoint that serves to obtain the most recent file uploaded to our account.

  • Endpoint Name: Get Space Used
  • Endpoint Route: /api/v1/filemanager/space_used
  • Endpoint Method: GET
  • Endpoint Fn: Endpoint that serves to obtain information about the available, used and limited space in our account that varies depending on the plan.

  • Endpoint Name: Upload File
  • Endpoint Route: /api/v1/filemanager/upload
  • Endpoint Method: POST
  • Endpoint Fn: Endpoint used to upload a file. We must pass through the body a formData with the file and the path to upload (the path has to be existing).

  • Endpoint Name: Get Content of Folder
  • Endpoint Route: /api/v1/filemanager
  • Endpoint Method: GET
  • Endpoint Fn: Endpoint used to get all files and folders from a specific path sent by parameter.

  • Endpoint Name: Create Folder
  • Endpoint Route: /api/v1/filemanager
  • Endpoint Method: POST
  • Endpoint Fn: Endpoint which is used to create a specific folder by passing the path to where the folder should be created in body.

  • Endpoint Name: Delete Folder Or File
  • Endpoint Route: /api/v1/filemanager
  • Endpoint Method: DELETE
  • Endpoint Fn: Endpoint used to delete a folder or file. By parameter we will pass the path to delete and the type to delete if it is a folder or file.

  • Endpoint Name: Change Plan
  • Endpoint Route: /api/v1/user/change_plan
  • Endpoint Method: GET
  • Endpoint Fn: Endpoint used to change the plan of an account by passing by parameter the plan to change. 0 free and 1 paid.

  • Endpoint Name: Send Email To Verify
  • Endpoint Route: /api/v1/user/send_email_to_verify
  • Endpoint Method: GET
  • Endpoint Fn: Endpoint used to forward mail for account verification

  • Endpoint Name: Get User Info
  • Endpoint Route: /api/v1/user/user_info
  • Endpoint Method: GET
  • Endpoint Fn: Endpoint used to obtain information about the active user, i.e., logged in.

About

This repository is a FileManager created in NextJS 14. Create a unique user, create your folders and upload your files.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages