Skip to content

The FastAPI File Management Project is a secure web application built with FastAPI, offering user authentication and efficient file operations such as uploading, downloading, and directory management. Leveraging MongoDB for data storage, it allows users to manage their files with ease.

License

Notifications You must be signed in to change notification settings

swoyam2609/MyDrive-Backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FastAPI File Management Project

This is a FastAPI project for file management with user accounts. It includes features like user authentication, file upload/download, directory creation/deletion, and user activity tracking.

Installation

  1. Clone the repository:

    git clone https://github.com/your-username/fastapi-file-management.git
    cd fastapi-file-management
  2. Create a virtual environment (optional but recommended):

    python -m venv venv
    source venv/bin/activate  # On Windows, use `venv\Scripts\activate`
  3. Install dependencies:

    pip install -r requirements.txt
  4. Set up MongoDB:

    • Create a MongoDB Atlas account and configure the connection string in main.py.
    • Update the SECRET_KEY and other configurations in main.py as needed.

Usage

  1. Run the FastAPI server:

    uvicorn main:app --host 0.0.0.0 --port 8000 --reload
  2. Access the FastAPI Swagger documentation at http://localhost:8000/docs for API endpoints and testing.

API Endpoints

  • Login: /token - Obtain an access token for authentication.
  • Signup: /signup - Create a new user account.
  • Get Directories: /directories - Get a list of directories for the authenticated user.
  • Create Directory: /create_directory - Create a new directory for the authenticated user.
  • Upload File: /upload - Upload a file to the specified path for the authenticated user.
  • Download File: /download - Download a file from the specified path for the authenticated user.
  • Delete File: /delete - Delete a file from the specified path for the authenticated user.
  • Delete Directory: /delete_directory - Delete a directory and its contents for the authenticated user.

Dependencies

Author

Swoyam Siddharth Nayak

About

The FastAPI File Management Project is a secure web application built with FastAPI, offering user authentication and efficient file operations such as uploading, downloading, and directory management. Leveraging MongoDB for data storage, it allows users to manage their files with ease.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages