Skip to content

Clash App, a cutting-edge real-time voting platform where users can participate in polls and vote in real-time. by using Advanced Tech Stack ( Next JS , Typescript, Postgresql , Prisma, Redis, Queues )

Notifications You must be signed in to change notification settings

deepanshurajput0/Clash-App-by-using-Advanced-Tech-Stack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 

Repository files navigation

Clash App: Real-Time Voting Platform

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.


Features

  • 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.

Tech Stack

  • 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.

Getting Started

1. Clone the Repository

git clone https://github.com/deepanshurajput0/Clash-App-by-using-Advanced-Tech-Stack/tree/main

2. Install Dependencies

npm install

3. Environment Variables

Create 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_password

4. Set Up the Database

Run the following commands to set up your PostgreSQL database with Prisma:

npx prisma migrate dev

5. Start the Development Server

npm run dev

Visit http://localhost:3000 to view the application.


How It Works

  1. Voting in Real-Time:

    • Users participate in polls and see live updates using WebSockets.
    • Poll results are updated dynamically without refreshing the page.
  2. Authentication and Authorization:

    • NextAuth provides secure login and session management.
    • Users can recover their passwords via email, with tasks queued and processed using BullMQ.
  3. Validation:

    • Zod ensures all incoming and outgoing data is validated for integrity and security.
  4. Queues and Redis:

    • Redis powers fast, efficient WebSocket communication and queue management.
    • BullMQ handles background tasks like sending password recovery emails.


Contributing

We welcome contributions! Please follow these steps:

  1. Fork the repository.
  2. Create a new branch.
  3. Make your changes and commit them.
  4. Submit a pull request.

License

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.

About

Clash App, a cutting-edge real-time voting platform where users can participate in polls and vote in real-time. by using Advanced Tech Stack ( Next JS , Typescript, Postgresql , Prisma, Redis, Queues )

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published