Welcome to Clash App, a cutting-edge real-time voting platform where users can participate in polls and vote in real-time. This application leverages advanced web technologies to provide a seamless, interactive user experience, ensuring scalability and performance.
- Real-Time Voting: Engage users with live voting powered by WebSockets.
- Secure Authentication: User authentication is managed using NextAuth for a robust, secure, and seamless login experience.
- Password Recovery: Email-based password recovery system implemented with BullMQ for queue management and Redis for fast processing.
- Data Validation: Forms and APIs are validated with Zod, ensuring type-safe and reliable data handling.
- Modern Tech Stack: Built with Next.js, TypeScript, PostgreSQL, Prisma, and Redis for a scalable and maintainable architecture.
-
Frontend:
- Next.js: React framework for server-side rendering and static generation.
- TypeScript: Type-safe development for fewer runtime errors and better maintainability.
-
Backend:
- PostgreSQL: Relational database for reliable data storage.
- Prisma: ORM for seamless database interactions with type safety.
- Redis: In-memory data store used for WebSocket sessions and queues.
-
Authentication:
- NextAuth: Secure, flexible authentication for password and OAuth-based login.
-
Validation:
- Zod: Schema-based validation for APIs and frontend forms.
-
Queues:
- BullMQ: Queue management for handling tasks like email notifications.
-
WebSockets:
- Real-time communication for instant updates on voting results.
git clone https://github.com/deepanshurajput0/Clash-App-by-using-Advanced-Tech-Stack/tree/mainnpm installCreate a .env file in the root directory and configure the following variables:
DATABASE_URL=your_postgresql_database_url
REDIS_URL=your_redis_connection_url
NEXTAUTH_SECRET=your_nextauth_secret
EMAIL_SMTP_HOST=your_smtp_host
EMAIL_SMTP_PORT=your_smtp_port
EMAIL_SMTP_USER=your_smtp_user
EMAIL_SMTP_PASS=your_smtp_passwordRun the following commands to set up your PostgreSQL database with Prisma:
npx prisma migrate devnpm run devVisit http://localhost:3000 to view the application.
-
Voting in Real-Time:
- Users participate in polls and see live updates using WebSockets.
- Poll results are updated dynamically without refreshing the page.
-
Authentication and Authorization:
- NextAuth provides secure login and session management.
- Users can recover their passwords via email, with tasks queued and processed using BullMQ.
-
Validation:
- Zod ensures all incoming and outgoing data is validated for integrity and security.
-
Queues and Redis:
- Redis powers fast, efficient WebSocket communication and queue management.
- BullMQ handles background tasks like sending password recovery emails.
We welcome contributions! Please follow these steps:
- Fork the repository.
- Create a new branch.
- Make your changes and commit them.
- Submit a pull request.
This project is licensed under the MIT License.
This README provides a detailed overview of the Clash App and guides contributors and users on how to get started effectively.