https://github.com/rishika105/auth-app-express
A backend project that contains authentication features like singup, login using ExpressJS.
https://github.com/rishika105/auth-app-express
express-js mongodb node-js
Last synced: 2 months ago
JSON representation
A backend project that contains authentication features like singup, login using ExpressJS.
- Host: GitHub
- URL: https://github.com/rishika105/auth-app-express
- Owner: rishika105
- Created: 2024-05-23T10:01:28.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-17T17:13:20.000Z (9 months ago)
- Last Synced: 2025-02-13T06:43:01.130Z (4 months ago)
- Topics: express-js, mongodb, node-js
- Language: JavaScript
- Homepage:
- Size: 24.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Auth App(Express)
## Overview
This is a simple backend project that implements user authentication features such as signup and login using **ExpressJS** and **MongoDB**.## Features
- **User Signup**: Users can register with a username and password.
- **User Login**: Users can log in with their credentials.
- **JWT Authentication**: Uses JSON Web Tokens (JWT) for secure authentication and authorization.
- **Error Handling**: Centralized error handling for user-friendly error messages.
## Technologies Used
- **Node.js**: JavaScript runtime for server-side code.
- **Express.js**: Fast and lightweight web framework for Node.js.
- **MongoDB**: NoSQL database to store user information.
- **Mongoose**: Object Data Modeling (ODM) library for MongoDB.
- **JWT**: Used for secure authentication of users.## Installation
1. Clone the repository:
```bash
git clone https://github.com/rishika105/auth-app-express.git
```2. Navigate to the project directory:
```bash
cd auth-app-express
```3. Install dependencies:
```bash
npm install
```4. Create a `.env` file for environment variables (such as MongoDB URI, JWT secret):
```
PORT = 4000
MONGODB_URL=
JWT_SECRET=
```5. Start the server:
```bash
npm start
```The server will start running on [http://localhost:3000](http://localhost:3000).
## API Endpoints
- **POST** `/api/signup`: Register a new user.
- **POST** `/api/login`: Authenticate an existing user and return a JWT.