https://github.com/rubel011/mysql-nodejs-backend
This is Mysql Node.js backend project, where you can register, log in, and access restricted resources. AWS-deployed-Link:-
https://github.com/rubel011/mysql-nodejs-backend
api aws-ec2 bcrypt expressjs jsonwebtoken jwt jwt-authentication mysql nodejs nodemailer planetscale sequelize sequelize-cli
Last synced: 10 months ago
JSON representation
This is Mysql Node.js backend project, where you can register, log in, and access restricted resources. AWS-deployed-Link:-
- Host: GitHub
- URL: https://github.com/rubel011/mysql-nodejs-backend
- Owner: Rubel011
- Created: 2023-09-29T13:50:36.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-26T11:23:43.000Z (almost 2 years ago)
- Last Synced: 2025-04-11T01:54:02.662Z (10 months ago)
- Topics: api, aws-ec2, bcrypt, expressjs, jsonwebtoken, jwt, jwt-authentication, mysql, nodejs, nodemailer, planetscale, sequelize, sequelize-cli
- Language: JavaScript
- Homepage: https://quadb-nodejs-qxb9.onrender.com/
- Size: 130 KB
- Stars: 2
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# QuadB Tech Node.js Backend Project
This is the QuadB Tech Node.js backend project, where you can register, log in, and access restricted resources.
## API Documentation: for Swagger
You can explore the API documentation using Swagger UI. Access the documentation by navigating to:
https://quadb-nodejs-qxb9.onrender.com/api-docs
## Functionality
The API includes the following functionality:
- User Registration
- User Login and Authentication
- User details by user_id
- User Management- create , update, delete
- Get user information like user's image
## Backend Deployment
The backend of this project is deployed on AWS and can be accessed via the following link:
[Backend Deployment Link](https://quadb-nodejs-qxb9.onrender.com/)
## Backend-Routes
- **User Authentication**:
- `POST /users/register`: Register a new user.
- `POST /users/login`: Log in with a registered user.
- `GET /users/details/{user_id}`: Get the user's details by user_id .
- `PUT /users/update`: update the user (protected route using JWT).
- `POST /users/image/{user_id}`: get user's image.
- `POST /users/insert`: insert new user (protected route using JWT).
- `DELETE /users/delete/{user_id}`: delete the user using user_id.
### Technologies Used
- Node.js
- Express.js
- MySQL
- Sequelize
- Sequelize-cli
- Bcrypt
- JWT
- Swagger (for API documentation)
### Installation
1. Clone the repository to your local machine:
```bash
git clone https://github.com/Rubel011/quadb-nodejs-backend.git
2. Navigate to the project directory:
```bash
cd quadb-nodejs-backend
3. Install the project dependencies:
```bash
npm install
4. Create a .env file in the project root and configure the following environment variables:
```markdown
PORT=your-database-port
DB_USER=your-database-username
DB_PASS=your-database-password
DB_Name=your-database-name
DB_HOST=your-database-host
NODE_ENV=production
ACCESS_TOKEN_SECRET=masai-school-web
REFRESH_TOKEN_SECRET=masai-school
ACCESS_TOKEN_EXPIRATION=1d
REFRESH_TOKEN_EXPIRATION=24d
EMAIL_ID=nodemailer-email-id
GOOGLEKEY=nodemailer-google-key
FRONTEND_DEPLOYED_URL=#
BACKEND_DEPLOYED_URL=http://localhost:8080/
4. Start the server:
```
npm run server
```
5. Access the backend API at http://localhost:PORT.