A secure authentication server built with Express.js featuring comprehensive security measures and modern authentication capabilities.
-
🔐 Authentication
- Custom authentication strategy
- Google OAuth integration
- Session-based authentication
- Passport.js integration
-
🛡️ Security
- CSRF protection
- Helmet security headers
- Rate limiting
- CORS configuration
- Cookie security
-
🔧 Core Features
- MongoDB integration
- WebSocket support (Socket.IO)
- File upload handling
- Request logging
- Error handling middleware
- Environment configuration
- Node.js
- MongoDB
- npm or yarn
- Clone the repository
- Install dependencies:
npm install
- Create a
.env
file with the following variables:
PORT=8080
NODE_ENV=development
MONGODB_URI=your_mongodb_uri
SESSION_SECRET=your_session_secret
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
- Start the server:
npm run dev
The server will be available at:
- Local: http://localhost:8080
- WebSocket: ws://localhost:8080
- Network: http://your_ip:8080
- Express.js
- MongoDB
- Socket.IO
- Passport.js
- Helmet
- CORS
- Cookie Parser
- Express Session
- Double CSRF Protection
- Rate Limiting
- Secure Sessions
- Helmet Security Headers
- CORS Configuration
- Error Handling
Feel free to submit issues and pull requests.
This project is licensed under the MIT License.