Skip to content

FaithRono/alx-files_manager

Repository files navigation

📁 File Management Platform

This project is a comprehensive summary of the back-end trimester topics, covering authentication, NodeJS, MongoDB, Redis, pagination, and background processing. The objective is to build a simple platform for uploading and viewing files with functionalities such as user authentication via a token, listing all files, uploading new files, changing file permissions, viewing files, and generating thumbnails for images.

File Management

Table of Contents

Project Overview


The File Management Platform is designed to provide users with the ability to manage their files securely and efficiently. It includes features such as:

  • User authentication using tokens.
  • Listing all uploaded files.
  • Uploading new files.
  • Changing file permissions.
  • Viewing files.
  • Generating thumbnails for image files.

Features


  • 🔐 User Authentication: Secure authentication mechanism using tokens.
  • 📄 File Listing: List all uploaded files with pagination.
  • 📤 File Upload: Upload new files to the platform.
  • 🔄 Permission Management: Change the permissions of files (e.g., private, public).
  • 👁️ File Viewing: View the content of uploaded files.
  • 🖼️ Thumbnail Generation: Generate and view thumbnails for image files.
  • ⚙️ Background Processing: Use background workers for processing tasks such as thumbnail generation.

Learning Objectives


By the end of this project, you should be able to:

  1. Create an API with Express:

    • Set up a Node.js server with Express.
    • Define API endpoints for file management.
  2. Authenticate a User:

    • Implement token-based authentication.
    • Secure API endpoints using authentication middleware.
  3. Store Data in MongoDB:

    • Connect to a MongoDB database.
    • Perform CRUD operations on MongoDB collections.
  4. Store Temporary Data in Redis:

    • Set up Redis for caching and temporary data storage.
    • Use Redis for session management and caching.
  5. Setup and Use a Background Worker:

    • Implement background processing using a worker library (e.g., Bull).
    • Process tasks such as thumbnail generation in the background.

Technologies Used


  • Node.js: JavaScript runtime for building the server.
  • Express.js: Web framework for building APIs.
  • MongoDB: NoSQL database for storing file metadata.
  • Redis: In-memory data structure store for caching and temporary data.
  • Bull: Background job processing library.
  • Multer: Middleware for handling file uploads.
  • JWT: JSON Web Tokens for user authentication.

Setup and Installation


  1. Clone the Repository:
    git clone https://github.com/your-username/file-management-platform.git
    cd file-management-platform
    
    
  2. Install Dependencies:
    npm install
    
    
  3. Set Up Environment Variables: Create a .env file in the root directory and add the following environment variables:
    PORT=3000
    MONGODB_URI=mongodb://localhost:27017/file_management
    REDIS_URL=redis://localhost:6379
    JWT_SECRET=your_jwt_secret
    
  4. Start the Server:
    npm start
    

API Endpoints


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published