-
Notifications
You must be signed in to change notification settings - Fork 10
Enhance README #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Expanded README with detailed features, installation instructions, API documentation, and security features.
README.md
Outdated
| ## 🎯 Features | ||
|
|
||
| - 🔐 **Password Security** - Bcrypt hashing (10 salt rounds) | ||
| - ✅ **Input Validation** - Joi validation for emails, passwords, and user data | ||
| - 🔑 **JWT Authentication** - Secure token-based auth | ||
| - 📦 **MongoDB Integration** - Mongoose ORM with pagination | ||
| - 🛡️ **CORS Protection** - Cross-origin request handling | ||
| - 📝 **Request Logging** - Morgan HTTP request logger | ||
| - 📧 **Email Support** - SendGrid integration ready | ||
| - 🚀 **Production Ready** - Error handling and security best practices |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove emojis
| @@ -1,14 +1,359 @@ | |||
| # root-template-express | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i prefer the earlier heading
README.md
Outdated
| ## 📸 Demo | ||
|
|
||
| Here's how the API works: | ||
|
|
||
| ``` | ||
| POST /api/users - Create User | ||
| POST /api/auth/login - Login | ||
| GET /api/users - List Users (requires token) | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this is needed. Maybe we can have autogenerated API docs
README.md
Outdated
| ``` | ||
|
|
||
| ## 🛠️ Tech Stack | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this is needed. Maybe we can have autogenerated API docs
README.md
Outdated
|
|
||
| ```bash | ||
| # Clone the repository | ||
| git clone https://github.com/sanjana2505006/template-express-mongodb.git |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrong url?
README.md
Outdated
| ## 📚 API Documentation | ||
|
|
||
| ### Authentication Endpoints | ||
|
|
||
| #### Login | ||
| ```http | ||
| POST /api/auth/login | ||
| Content-Type: application/json | ||
| { | ||
| "email": "[email protected]", | ||
| "password": "MyPass@123", | ||
| "type": "root" | ||
| } | ||
| ``` | ||
|
|
||
| **Response:** | ||
| ```json | ||
| { | ||
| "status": true, | ||
| "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", | ||
| "user": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is for lines 107 to 202. We should not add API docs here
README.md
Outdated
| ## 📁 Project Structure | ||
|
|
||
| ``` | ||
| . | ||
| ├── controllers/ # Business logic for routes | ||
| │ ├── auth.js # Authentication logic | ||
| │ ├── user.js # User management logic | ||
| │ └── util.js # Utility functions | ||
| ├── models/ # Mongoose schemas | ||
| │ └── user.js # User schema | ||
| ├── routes/ # API route definitions | ||
| │ ├── index.js # Main router | ||
| │ ├── auth.js # Auth routes | ||
| │ ├── user.js # User routes | ||
| │ └── util.js # Utility routes | ||
| ├── middlewares/ # Custom middleware | ||
| │ ├── validateToken.js # JWT validation | ||
| │ └── allowRoot.js # Role-based access | ||
| ├── utils/ # Utility functions | ||
| │ ├── validators.js # Joi validation schemas | ||
| │ ├── generate.js # Key/secret generation | ||
| │ ├── asyncForEach.js # Async helpers | ||
| │ ├── mkdirSync.js # Directory creation | ||
| │ └── unlinkSync.js # File deletion | ||
| ├── data/ # Test data | ||
| │ └── test.http # HTTP client requests | ||
| ├── server.js # Main server file | ||
| ├── package.json # Dependencies | ||
| └── README.md # This file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not needed, maybe we can have folder level only
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay sure!
|
Hi @krushndayshmookh, |
This makes the project more beginner-friendly, clear to set up, and ready for open-source collaboration