Complete authentication solution with database integration for Node.js and React applications.
- π JWT Authentication - Secure token-based authentication
- π OAuth Integration - Google, GitHub, and more OAuth providers
- β‘ Plug-and-Play - Minimal configuration required
- π‘οΈ Security First - Rate limiting, CORS, Helmet protection
- π± React Components - Ready-to-use React authentication components
- π― TypeScript Ready - Full TypeScript support
- π Comprehensive Examples - Complete working examples
- ποΈ Database Integration - MongoDB, PostgreSQL, Redis support
- π Hybrid Storage - Primary storage + Redis caching
- π Health Monitoring - Built-in health checks and monitoring
npm install @authosphere/nodejs-auth-module
npm install @authosphere/react-auth-component# Clone the repository
git clone https://github.com/your-username/authosphere.git
cd authosphere
# Install all databases (macOS)
./scripts/setup/setup-databases.sh
# Run full stack application (Backend + React Frontend)
./scripts/examples/start-full-stack.sh
# Or run backend only
./scripts/examples/start-example.sh
# Or run React frontend only
./scripts/examples/start-react-example.shAvailable storage types:
- In-Memory - No setup required, data lost on restart
- MongoDB - NoSQL database with Mongoose
- PostgreSQL - Relational database with Prisma ORM
- Redis - In-memory storage for sessions and tokens
- Hybrid - PostgreSQL + Redis caching
URLs after startup:
- Backend API: http://localhost:3000
- React App: http://localhost:3001
- Health Check: http://localhost:3000/health
π See FULL_STACK_GUIDE.md for complete instructions
import express from 'express';
import { createAuthosphere } from '@authosphere/nodejs-auth-module';
const app = express();
// Configure Authosphere
const authosphere = createAuthosphere({
jwtSecret: 'your-super-secret-jwt-key',
storage: {
type: 'mongodb', // or 'postgresql', 'redis', 'memory'
options: {
uri: 'mongodb://localhost:27017/authosphere'
}
},
oauth: {
google: {
clientId: 'your-google-client-id',
clientSecret: 'your-google-client-secret'
}
},
frontendUrl: 'http://localhost:3000'
});
// Use Authosphere middleware
app.use('/auth', authosphere);
app.listen(3000, () => {
console.log('Server running on port 3000');
});import React from 'react';
import { AuthProvider, ProtectedRoute } from '@authosphere/react-auth-component';
function App() {
return (
<AuthProvider apiUrl="http://localhost:3000/auth">
<ProtectedRoute>
<h1>Welcome to your protected app!</h1>
</ProtectedRoute>
</AuthProvider>
);
}
export default App;- Getting Started - Quick start guide (5 minutes)
- Quick Reference - Commands and configurations reference
- Project Summary - Complete project overview
- Package Integration - Quick package integration guide
- Packages Overview - Complete packages overview
- Integration Guide - Complete integration instructions
- Development Guide - Development and contribution guide
- API Reference - Detailed API documentation
- Database Integration - Database setup and configuration
- OAuth Setup - OAuth provider configuration
- Examples - Working examples and demos
- Examples Overview - Complete examples overview
- Project Structure - Complete project organization
- Scripts Overview - Available scripts and utilities
- Scripts Reference - Complete scripts reference
- Web Applications - Full-stack web apps with authentication
- SPA (Single Page Apps) - React, Vue, Angular applications
- Mobile Apps - React Native with authentication backend
- Microservices - JWT-based service authentication
- Admin Panels - Protected admin interfaces
# JWT Configuration
JWT_SECRET=your-super-secret-jwt-key-change-in-production
# Database Configuration
MONGODB_URI=mongodb://localhost:27017/authosphere
DATABASE_URL=postgresql://user:pass@localhost:5432/authosphere
REDIS_URL=redis://localhost:6379
STORAGE_TYPE=mongodb
# OAuth Providers
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret
# Frontend URL
FRONTEND_URL=http://localhost:3000Authosphere supports multiple OAuth providers:
- β Google - Full support
- β GitHub - Full support
- β Facebook - Full support
- π Discord - Coming soon
- π Twitter - Coming soon
| Package | Description | Version |
|---|---|---|
@authosphere/nodejs-auth-module |
Backend authentication module | 2.0.0 |
@authosphere/react-auth-component |
React authentication components | 2.0.0 |
- Node.js 16+
- npm 8+
# Clone the repository
git clone https://github.com/your-org/authosphere.git
cd authosphere
# Install dependencies
npm install
# Start development servers
npm run devnpm start # Start both backend and frontend
npm run dev # Start in development mode
npm run build # Build all packages
npm test # Run tests
npm run lint # Run linterThis project is licensed under the MIT License - see the LICENSE file for details.
We welcome contributions! Please follow these steps:
- 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 to AuthOSphere
- π§ Email: info@terekhindt.com
- π Website: www.terekhindt.com
- π Issues: GitHub Issues
- Express.js - Web framework
- React - UI library
- JWT - JSON Web Tokens
- OAuth 2.0 - Authorization framework
Made with β€οΈ by Terekhin Digital Crew
All rights reserved. Copyright Β© 2025 Terekhin Digital Crew