Skip to content

An advanced Node.js backend system enabling secure user authentication, file uploads, and management. Utilizing JWT, bcrypt for security, and Cloudinary for avatar uploads, it facilitates user registration, login/logout, file uploads, and details management seamlessly.

Notifications You must be signed in to change notification settings

raobaba/Skailama_FullStack_Assignment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 

Repository files navigation

Project Title

Description

This project is a comprehensive backend system built using Node.js, Express, and MongoDB. It provides functionalities to manage user authentication, file uploads, and associated details.

Features

  • User Authentication: Utilizes JWT for secure user registration, login, logout, and profile management. Passwords are securely hashed using bcrypt.
  • User Profile: Allows users to register with a unique email, username, and an avatar uploaded to Cloudinary.
  • Upload Management: Offers functionalities to create, update, delete, and retrieve file uploads associated with specific users. Each upload can have multiple files with respective details.
  • File Details Management: Enables users to create, update, and delete details associated with files uploaded. These details include name, description, and timestamp.

Technologies Used

  • Node.js: Server-side JavaScript runtime environment.
  • Express: Web application framework for Node.js.
  • MongoDB: NoSQL database used to store user and upload-related data.
  • Mongoose: Elegant MongoDB object modeling for Node.js.
  • JWT (JSON Web Tokens): Used for secure authentication.
  • Bcrypt: Library for hashing passwords securely.
  • Cloudinary: Cloud-based image and video management service used for avatar uploads.
  • For API endpoints and examples, refer to the [Postman Collection](link-to-your-postman-collection.

Getting Started

Prerequisites

  • Node.js and npm installed on your machine
  • MongoDB database set up
  • Cloudinary API credentials

Installation

  1. Clone the repository

    git clone https://github.com/your-username/repository-name.git
  2. Install dependencies

    cd repository-name
    npm install
  3. Set up environment variables

    • Create a .env file based on the provided .env.example and add necessary credentials.
  4. Start the server

    npm start

Usage

  • User Registration: Send a POST request to /api/user/register with username, email, and password.
  • User Login: Send a POST request to /api/user/login with email and password. This returns a token for authentication.
  • Upload Management: Access endpoints in /api/upload for creating, updating, and retrieving uploads and associated details.
  • User Profile Update: Send a PUT request to /api/user/:id with updated username and avatar for profile modification.

Endpoints

User Routes:

  • /api/v1/register: Register a new user.
  • /api/v1/login: Log in a user.
  • /api/v1/logout: Log out the user.
  • /api/v1/getById/:id: Get user details by ID.
  • /api/v1/:id: Update user details.

Upload Routes:

  • /api/v1/:userId: Create a new upload.
  • /api/v1/create/:uploadId/:fileId: Create details for a file in an upload.
  • /api/v1/update/:uploadId/:fileId/:detailId: Update details for a file in an upload.
  • /api/v1/delete/:uploadId/:fileId/:detailId: Delete details for a file in an upload.
  • /api/v1/getAll/:userId: Get all uploads by user ID.
  • /api/v1/files/:uploadId: Get files by upload ID.
  • /api/v1/details/:uploadId/:fileId: Get details by file ID in an upload.

Contributing

Feel free to contribute by opening issues or pull requests. Follow the existing code style and guidelines.

License

This project is licensed under the MIT License.

About

An advanced Node.js backend system enabling secure user authentication, file uploads, and management. Utilizing JWT, bcrypt for security, and Cloudinary for avatar uploads, it facilitates user registration, login/logout, file uploads, and details management seamlessly.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages