https://github.com/arifnextdev/thirsty-server
Thirsty Server is a Node.js and TypeScript backend for managing beauty products. It provides secure JWT authentication, product validation, and MongoDB integration, with modern security practices and development tools.
https://github.com/arifnextdev/thirsty-server
express helmetjs jwt-authentication mongoose nodejs
Last synced: 8 months ago
JSON representation
Thirsty Server is a Node.js and TypeScript backend for managing beauty products. It provides secure JWT authentication, product validation, and MongoDB integration, with modern security practices and development tools.
- Host: GitHub
- URL: https://github.com/arifnextdev/thirsty-server
- Owner: arifnextdev
- Created: 2023-09-20T20:43:40.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-06T17:08:01.000Z (over 1 year ago)
- Last Synced: 2025-04-03T07:42:56.293Z (11 months ago)
- Topics: express, helmetjs, jwt-authentication, mongoose, nodejs
- Language: TypeScript
- Homepage: https://thirsty-server.vercel.app
- Size: 121 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Thirsty Server
Thirsty Server is a backend API built with Node.js, Express, MongoDB, and TypeScript for managing beauty products. It includes modern security practices, user authentication, and validation features to ensure smooth and secure product management.
## Features
- **Authentication**: JWT-based user authentication.
- **Security**: Protected API endpoints using `helmet`, `cors`, `hpp`, and data sanitization with `express-mongo-sanitize`.
- **Validation**: Input validation using `validator`, and password hashing with `bcrypt`.
- **Database**: MongoDB is used for data storage, connected via Mongoose.
- **Development**: `nodemon` is configured for hot-reloading in development mode.
- **Code Quality**: ESLint and Prettier are configured for linting and code formatting.
- **Pre-commit Checks**: Husky hooks ensure code quality before each commit.
## Getting Started
### Prerequisites
- Node.js >= 18
- MongoDB
### Installation
1. Clone the repository:
```bash
git clone https://github.com/arifnextdev/thirsty-server.git
cd thirsty-server
```
2. Install dependencies:
```bash
npm install
```
3. Create a `.env` file for environment variables:
```bash
NODE_ENV=development
PORT=5000
MONGODB_URI=your_mongodb_uri
JWT_SECRET=your_jwt_secret
```
4. Build the project:
```bash
npm run build
```
5. Start the server:
```bash
npm start
```
### Development
To run in development mode with hot-reloading:
```bash
npm run dev
```
### Available Scripts
- `npm start`: Starts the production server.
- `npm run dev`: Starts the development server with `nodemon`.
- `npm run build`: Compiles TypeScript to JavaScript.
- `npm run lint:check`: Runs ESLint for code linting checks.
- `npm run lint:fix`: Fixes any linting issues.
- `npm run prettier:check`: Checks code formatting using Prettier.
- `npm run prettier:fix`: Fixes code formatting using Prettier.
- `npm run up`: Runs the `upgrade.sh` script.
## License
This project is licensed under the MIT License.
```
This file is ready to be added to your GitHub repository. Let me know if you'd like to make any changes!