Git Product home page Git Product logo

alx-files_manager's Introduction

alx-files_manager

This project is a summary of this back-end trimester: authentication, NodeJS, MongoDB, Redis, pagination and background processing.

The objective is to build a simple platform to upload and view files:

  • User authentication via a token
  • List all files
  • Upload a new file
  • Change permission of a file
  • View a file
  • Generate thumbnails for images

You will be guided step by step for building it, but you have some freedoms of implementation, split in more files etc… (utils folder will be your friend)

Of course, this kind of service already exists in the real life - it’s a learning purpose to assemble each piece and build a full product.

Enjoy!

Learning Objectives

At the end of this project, you are expected to be able to explain to anyone, without the help of Google:

  • how to create an API with Express
  • how to authenticate a user
  • how to store data in MongoDB
  • how to store temporary data in Redis
  • how to setup and use a background worker

Getting Started

To get started with the alx-files_manager project, follow these steps:

  1. Clone the repository to your local machine:

    git clone https://github.com/your-username/alx-files_manager.git
  2. Change into the project directory:

    cd alx-files_manager
  3. Install the required dependencies:

    npm install
  4. Start the application:

    npm run start-server
  5. Open your web browser and navigate to http://localhost:5000 to access the application.

Project Structure

The project structure is as follows:

  • app.js: The main entry point of the application.
  • routes/: Contains the route handlers for different endpoints.
  • controllers/: Contains the logic for handling requests and responses.
  • models/: Contains the database models.
  • middlewares/: Contains the middleware functions.
  • config/: Contains the configuration files.
  • utils/: Contains utility functions.

API Endpoints

The following API endpoints are available:

  • POST /api/auth/register: Register a new user.
  • POST /api/auth/login: Log in an existing user.
  • GET /api/files: Get a list of all files.
  • POST /api/files: Upload a new file.
  • PUT /api/files/:id/permission: Change the permission of a file.
  • GET /api/files/:id: View a file.
  • GET /api/files/:id/thumbnail: Generate a thumbnail for an image.

Authentication

The alx-files_manager project uses token-based authentication. After registering or logging in, you will receive an access token that needs to be included in the Authorization header of each request.

Example:

alx-files_manager's People

Contributors

elgaharbiayoub avatar fati1909 avatar

Stargazers

 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.