Code Monkey home page Code Monkey logo

node-crud-application's Introduction

Node.js CRUD Application

Overview

This project is a Node.js-based CRUD application with comprehensive user management features, including registration, login, profile updates, password management, and user activity tracking. The application employs JWT authentication for secure user sessions, handles file uploads with Cloudinary, and uses middleware for various functionalities, including authentication and file handling.

Features

  • User Registration and Authentication (Login/Logout)
  • Secure Password Management
  • Profile Management (Update Avatar and Cover Image)
  • User Activity Tracking (Watch History)
  • JWT Authentication for Secure Sessions
  • File Uploading with Multer and Cloudinary

Routes

  • POST /register: Register a new user with an avatar and cover image.
  • POST /login: Log in an existing user.
  • POST /logout: Log out the current user.
  • POST /refresh-token: Refresh the access token.
  • POST /change-password: Change the current user's password.
  • GET /current-user: Get details of the currently logged-in user.
  • PATCH /update-account: Update account details (full name, email).
  • PATCH /avatar: Update user avatar.
  • PATCH /cover-image: Update user cover image.
  • GET /c/:username: Get a user's channel profile.
  • GET /history: Get the watch history of the current user.

Tech Stack

  • Backend: Node.js, Express.js
  • Database: MongoDB
  • Authentication: JWT
  • File Upload: Multer, Cloudinary
  • Security: Bcrypt
  • Utilities: Async Handler, API Error Handling

Installation

  1. Clone the repository:

    git clone <repository_url>
    cd Node-Crud-Application
  2. Install dependencies:

    npm install
  3. Create a .env file in the root directory and add your environment variables:

    PORT=3000
    MONGO_URI=<your_mongodb_uri>
    ACCESS_TOKEN_SECRET=<your_access_token_secret>
    REFRESH_TOKEN_SECRET=<your_refresh_token_secret>
    CLOUDINARY_CLOUD_NAME=<your_cloudinary_cloud_name>
    CLOUDINARY_API_KEY=<your_cloudinary_api_key>
    CLOUDINARY_API_SECRET=<your_cloudinary_api_secret>
  4. Start the server

    npm run dev

node-crud-application's People

Contributors

anujsinghrawat 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.