GithubHelp home page GithubHelp logo

findme's Introduction

findme

A user creation application

Follow these steps to run the project:

  1. Clone the Repository Clone the project repository to your local machine. Replace <url> with the URL of your repository.

    git clone <url>
    
  2. Navigate to the Project Directory Change your current directory to the project's directory.

    cd <repository-name>
    
  3. Navigate to client and server directories

    cd client
    cd server
    
  4. Install Dependencies Install the project dependencies for both client and server using npm.

    npm install
    
  5. Setup environment variables Create a .env file and add your environment variables.

    • client
    VITE_USERS_BACKEND_URL = <your_backend_url>
    
    • server
    MONGO_URI = <mongodb_uri>
    PORT = <port_number>
    SECRET = <your_jwt_secret>
    
  6. Run the Project Finally, run the project.

    npm run start
    

That's it! Your Findme project should now be running.

API Documentation

Note:

For admin privileges create account with admin after the "@" symbol in email.

eg:

GET /:userName

Fetches the details of a user.

  • URL Params: userName - The username of the user.
  • Success Response: User object.
  • Error Response: Error message.

GET /profilePic/:userName

Fetches the profile picture of a user.

  • URL Params: userName - The username of the user.
  • Success Response: Profile picture file.
  • Error Response: Error message.

GET /

Lists all users. Requires authentication and admin privileges.

  • Headers: Authorization: Bearer <token>
  • Success Response: Array of user objects.
  • Error Response: Error message.

POST /create

Creates a new user.

  • Data Params: User object. The profile picture should be included in the 'profilePic' field as a file.
  • Success Response: Created user object and token for authenticated requests.
  • Error Response: Error message.

POST /login

Logs in a user.

  • Data Params: Object with userName and password.
  • Success Response: token for authenticated requests.
  • Error Response: Error message.

PUT /:id

Updates a user. Requires authentication.

  • URL Params: id - The ID of the user.
  • Headers: Authorization: Bearer <token>
  • Data Params: User object with updated fields.
  • Success Response: Updated user object.
  • Error Response: Error message.

DELETE /:id

Deletes a user. Requires authentication.

  • URL Params: id - The ID of the user.
  • Headers: Authorization: Bearer <token>
  • Success Response: Deleted user object.
  • Error Response: Error message.

findme's People

Contributors

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