
Create a user model in a Next.js app using mongoose, defining name, email, clerk user id, isActive, and isAdmin with timestamps for CRUD operations.
Build a unified layout with a layout provider, a left sidebar, header, and page content shared by admin and user areas, plus routing via a private folder.
Create a two-part layout for the Next.js lottery app with a flex container, a sidebar, and a header, and render admin menus like home, lotteries, tickets, users, and reports.
Build a Firebase image upload UI by implementing an upload component in the media tab, managing uploaded files in state, enabling multiple image selection, and preparing image URLs.
Design a lottery info page displaying the lottery name, main and gallery images, and key details like ticket price, dates, and a countdown timer, with a Stripe-based buy ticket flow.
Select winners server action creates unique random winners for each prize by querying lottery and tickets from MongoDB, constructs winner documents, saves them, and marks the lottery as winners declared.
Welcome to the Next.js Lottery and Lucky Draw System!
Dive into the world of chance and opportunity with our feature-packed platform designed to bring the thrill of winning right to your fingertips. Here's a glimpse of what awaits:
Dynamic User Roles: Experience the platform through two distinct lenses - Administrator and Normal User - each with tailored access and capabilities.
Admin Empowerment: Admins wield the power to seamlessly manage Lotteries with full CRUD operations, ensuring smooth operation at every turn.
Multi-Prize Excitement: Picture this: a single Lottery, multiple prizes! Unleash the excitement as multiple winners are chosen at random, each vying for their coveted reward.
Cash or Collectibles: Whether it's a tempting cash prize or a sought-after item, our platform caters to every preference, adding a touch of personalization to each draw.
User-Friendly Interface: Normal Users embark on their journey from the homepage, where they can browse through an array of captivating Lotteries, effortlessly purchasing tickets using their preferred credit cards.
Secure Transactions with Stripe: Rest easy knowing that payments are securely processed through the trusted Stripe payment gateway, ensuring a seamless and safe transaction experience.
Personalized User Experience: From a dedicated Lotteries page to a curated Tickets section, users enjoy a personalized hub where they can track their purchased tickets and celebrate their wins in style.
Admin Oversight: Admins maintain a comprehensive view of user activity, with access to all user lotteries and tickets, ensuring transparency and efficient management.
Insightful Revenue Reports: Delve into the financial landscape of each Lottery with detailed revenue reports, empowering admins with valuable insights for strategic decision-making.
Randomized Winner Selection: Anticipation reaches its peak as admins randomly select winners through our seamless API, adding an element of suspense to every draw.
Streamlined Post-Draw Operations: With winners declared, the system automatically halts ticket purchases for the respective Lottery, ensuring a smooth transition to the next thrilling chapter.
Embark on your journey with us and experience the thrill of winning like never before. Welcome to the Next.js Lottery and Lucky Draw System – where every draw is a chance to dream big!