A simple API for user sign-up and sign-in.
This API provides endpoints for user sign-up and sign-in. It uses Express.js for the server, Mongoose for database interactions, and bcrypt for password hashing.
- User sign-up with validation
- User sign-in with password comparison
- MongoDB for data storage
- Secure password hashing
Before you begin, ensure you have met the following requirements:
- Node.js and npm installed
- MongoDB installed and running
- Git installed (for cloning the repository)
To get a local copy up and running, follow these simple steps:
1. Clone the repository:
git clone https://github.com/YOUR_USERNAME/signup_api.git
2. Change into project directory
cd signup_api
3. install dependencies
npm install
4. Create a .env file in the root directory with your MongoDB connection URI. For example:
MONGODB_URI=mongodb://localhost/your-database-name
5. start the server
npm start
You can test the API using tools like Insomnia or Postman. Here are the available endpoints:
Example Request Body: { "name": "John Doe", "email": "[email protected]", "password": "secretpassword" }
Example Request Body: { "email": "[email protected]", "password": "secretpassword" }
Note - Make sure to replace example data with your actual data.