Giter Site home page Giter Site logo

alx-files_manager's Introduction

alx-files_manager

Overview

This project, alx-files_manager, aims to create a simple platform for uploading and viewing files. The project encompasses various back-end technologies and concepts, including Node.js, Express.js, MongoDB, Redis, and more. It is designed to consolidate knowledge of authentication, data storage, background processing, and API development.

Learning Objectives

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

  1. Create an API with Express.
  2. Authenticate users.
  3. Store data in MongoDB.
  4. Manage temporary data in Redis.
  5. Set up and use background workers.

Technologies Used

  • Node.js
  • Express.js
  • MongoDB
  • Redis
  • Kue (for background jobs)
  • ES6

Project Structure

  • utils/: Contains utility classes and methods.
  • routes/: Defines the API endpoints.
  • controllers/: Contains the logic for handling API requests.

Setup Instructions

  1. Clone the Repository:

    git clone https://github.com/waltertaya/alx-files_manager.git
    cd alx-files_manager
  2. Install Dependencies:

    npm install
  3. Environment Variables: Set up the following environment variables:

    • DB_HOST: MongoDB host (default: localhost)
    • DB_PORT: MongoDB port (default: 27017)
    • DB_DATABASE: Database name (default: files_manager)
    • REDIS_HOST: Redis host
    • REDIS_PORT: Redis port
    • FOLDER_PATH: Directory to store uploaded files (default: /tmp/files_manager)
  4. Running the Server: Start the server with the following command:

    npm run start-server

    The server will run on the port specified by the PORT environment variable, or default to port 5000.

Key Features

  1. User Authentication:

    • Token-based authentication for secure API access.
    • Endpoints to connect, disconnect, and fetch user details.
  2. File Management:

    • Upload and manage files.
    • Generate and manage thumbnails for images.
    • Set permissions for files (public/private).
  3. Data Handling:

    • Use MongoDB for persistent storage of user and file data.
    • Use Redis for caching and session management.
  4. Background Processing:

    • Use Kue to manage background jobs, such as generating thumbnails.

Endpoints

  • GET /status: Check the status of Redis and MongoDB.
  • GET /stats: Retrieve the number of users and files.
  • POST /users: Create a new user.
  • POST /files: Upload a new file.
  • GET /connect: Authenticate a user.
  • GET /disconnect: Sign out a user.
  • GET /users/me: Retrieve the current user's information.

Requirements

  • Editors: vi, vim, emacs, Visual Studio Code
  • Node.js version: 12.x.x
  • ESLint for code linting

Provided Files

  • package.json: Project dependencies and scripts.
  • .eslintrc.js: ESLint configuration.
  • babel.config.js: Babel configuration.

Note

Please ensure that all implemented functionalities are thoroughly tested and reviewed. Manual QA review is required upon project completion. The auto review will be triggered at the project deadline.

Author

alx-files_manager's People

Contributors

waltertaya avatar

Watchers

 avatar

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.