Skip to content

24-f1001257/login_signup-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Backend API

Overview: This documentation covers the [Project Name] project, a Node.js application using Express, MongoDB with Mongoose, and bcrypt for password hashing. It facilitates user signup, login, and user data retrieval.

Table of Contents:

  1. Installation
  2. Usage
  3. Project Structure
  4. Dependencies
  5. Configuration
  6. Routes
  7. Models
  8. Contributing
  9. License

Installation:

  1. Clone Repository:
git clone github.com/Mrinal-exe/backend-api
  1. Install Dependencies:
npm install
  1. Configure MongoDB:
  • Ensure MongoDB is installed and running.
  • Check configuration in config/mongo.js.
  1. Run the Application:
npm start

Usage:

  • The application exposes API endpoints for user-related operations.
  • Use tools like Postman or curl for testing.

Project Structure:

  • index.js: Entry point.
  • config/mongo.js: MongoDB configuration.
  • model/user_model.js: User model definition.
  • routes/routes.js: Express router for API routes.

Dependencies:

Configuration:

  • Make a new file and name it .env and define PORT and URI.
  • Set the MongoDB connection URL and Post.

Routes:

  1. GET /getall
  • Fetches all users from the database.
  1. POST /signup
  • Registers a new user by hashing the password and saving to the database.
  1. POST /login
  • Authenticates a user by comparing the provided password with the hashed password.

Models:

  • User Model (model/user_model.js):
  • Defines the structure of the user schema.

About

A login and signup API made in nodejs as practice.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published