DigitalAuth
DigitalAuth is a secure authentication platform integrated with a rich text editor powered by Editor.js. It allows users to authenticate seamlessly while creating and managing dynamic content. The platform prioritizes both security and usability, making it an ideal solution for collaborative and content-driven applications.
- Email and password-based authentication.
- Social login integration (Google, GitHub) via OAuth.
- Secure session management with JWT.
- Integrated Editor.js, a block-based editor for dynamic content creation.
- Supports headings, paragraphs, lists, images, and custom tools.
- Saves editor content as JSON for flexibility and reusability.
- Role-specific access permissions for content creation and management.
- Middleware to validate roles and protect resources.
- Built with Next.js and Tailwind CSS for a smooth, mobile-friendly experience.
- Passwords hashed with bcrypt.
- Protection against XSS and CSRF vulnerabilities.
- Secure cookies and HTTPS for secure communication.
- Next.js
- React
- Tailwind CSS
- Next.js API routes
- Node.js
- MongoDB
- NextAuth.js (JWT and OAuth)
- Editor.js
- Node.js (v14 or higher)
- MongoDB
- Clone the repository:
git clone https://github.com/Saurabhn16/DigitalAuth.git
- Navigate to the project directory:
cd DigitalAuth
- Install dependencies:
npm install
- Create a
.env.local
file in the root directory and add the following environment variables:NEXTAUTH_URL=<your_deployment_url> MONGODB_URI=<your_mongodb_connection_string> NEXTAUTH_SECRET=<random_secret_key> GOOGLE_CLIENT_ID=<your_google_client_id> GOOGLE_CLIENT_SECRET=<your_google_client_secret> GITHUB_CLIENT_ID=<your_github_client_id> GITHUB_CLIENT_SECRET=<your_github_client_secret>
- Start the development server:
npm run dev
- Open the app in your browser at
http://localhost:3000
.
-
Authentication:
- Sign up with email or use Google/GitHub to log in.
- Manage user sessions via secure JWT tokens.
-
Text Editor:
- Use the Editor.js interface to create dynamic content.
- Save and retrieve content as JSON objects.
-
Access Control:
- Admins can manage all content.
- Editors can create and edit assigned content.
DigitalAuth/
├── components/ # Reusable UI components
├── pages/ # Next.js pages (routes)
│ ├── api/ # API routes for backend logic
├── styles/ # Global and component-specific styles
├── utils/ # Utility functions
├── public/ # Static assets (images, icons, etc.)
├── .env.local # Environment variables (not included in repo)
└── README.md # Project documentation
- Add collaborative editing capabilities.
- Implement custom Editor.js plugins for advanced content blocks.
- Enable content export in different formats (PDF, Word).
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch:
git checkout -b feature-name
- Commit your changes:
git commit -m "Add feature-name"
- Push the branch:
git push origin feature-name
- Open a pull request.
This project is licensed under the MIT License.