A secure, scalable authentication microservice that generates and validates JWT tokens across your ecosystem. Named after the Sanskrit word for "seal/token," Mudra provides robust identity management with minimal overhead.
Built with:
- Node.js
- Express
- MongoDB
- Redis
- JWT token generation and validation
- Secure user authentication
- Scalable microservice architecture
- Redis caching for improved performance
- MongoDB for persistent storage
- Node.js (v14 or higher)
- MongoDB
- Redis
# Clone the repository
git clone https://github.com/yourusername/mudra.git
# Install dependencies
npm install# MongoDB
brew tap mongodb/brew
brew install mongodb-community
brew services start mongodb-community
# Verify MongoDB
mongosh
# Redis
brew install redis
brew services start redis
# Verify Redis
redis-cli ping # Should return "PONG"Create a .env file in the root directory:
PORT=3000
MONGODB_URI=mongodb://localhost:27017/mudra
JWT_SECRET=your_jwt_secret
REDIS_URL=redis://localhost:6379POST /api/auth/register
Content-Type: application/json
{
"username": "string",
"email": "string",
"password": "string"
}POST /api/auth/login
Content-Type: application/json
{
"email": "string",
"password": "string"
}GET /api/auth/verify
Authorization: Bearer <token>All errors follow this format:
{
"error": "Error message description"
}- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Thanks to all contributors who have helped shape Mudra
- Inspired by modern authentication best practices