# Giveaway Site A modern web application for hosting and managing giveaways, built with [Next.js](https://nextjs.org), [TypeScript](https://www.typescriptlang.org/), and [Tailwind CSS](https://tailwindcss.com/). ## Features - ⚡ **Next.js App Router** for fast, scalable routing and SSR/SSG. - 🛠️ **TypeScript** for type safety and better developer experience. - 🎨 **Tailwind CSS** for utility-first, responsive UI design. - 🗂️ **App Directory Structure** for modular, maintainable code. - 🔤 **next/font** for optimized font loading (Geist). - 🔒 **Environment Variables** for secure configuration. - 🔑 **Google Authentication** for secure user sign-in and account management. - 📺 **YouTube API Integration** to interact with YouTube data for giveaway requirements or validation. - 🗄️ **PostgreSQL Database** managed with **Prisma ORM** and hosted on **Railway** for scalable, reliable data storage. - 🚀 **Ready for Vercel Deployment** with zero-config. ## Getting Started ### Prerequisites Ensure you have the following installed: - [Node.js](https://nodejs.org/) (v16 or later) - [npm](https://www.npmjs.com/) or [yarn](https://yarnpkg.com/) - [PostgreSQL](https://www.postgresql.org/) ### Installation 1. Clone the repository: ```bash git clone https://github.com/your-username/giveaway-app.git cd giveaway-app ``` 2. Install dependencies: ```bash npm install # or yarn install ``` 3. Set up environment variables: Create a `.env` file in the root directory and add the following: ```env DATABASE_URL=your_postgresql_connection_string GOOGLE_CLIENT_ID=your_google_client_id GOOGLE_CLIENT_SECRET=your_google_client_secret NEXTAUTH_SECRET=your_nextauth_secret GOOGLE_YOUTUBE_API_KEY=your_youtube_api_key ``` 4. Apply database migrations: ```bash npx prisma migrate dev ``` 5. Run the development server: ```bash npm run dev # or yarn dev ``` 6. Open [http://localhost:3000](http://localhost:3000) in your browser. ## Project Structure - `app/` — Main application pages and routes. - `admin/` — Admin-specific pages and components for managing giveaways. - `api/` — API routes for server-side logic. - `giveaways/` — Public-facing pages for active giveaways. - `profile/` — User profile pages. - `components/` — Reusable UI components. - `lib/` — Utility libraries (e.g., database client). - `prisma/` — Prisma schema and migrations. - `public/` — Static assets (e.g., images, icons). ## Key Scripts - `npm run dev` — Start the development server. - `npm run build` — Build the application for production. - `npm start` — Start the production server. - `npx prisma studio` — Open Prisma Studio to manage the database. ## Deployment This project is ready for deployment on [Vercel](https://vercel.com/): 1. Push your code to a GitHub repository. 2. Connect the repository to Vercel. 3. Add the required environment variables in the Vercel dashboard. 4. Deploy the application. ## Contributing Contributions are welcome! Please follow these steps: 1. Fork the repository. 2. Create a new branch (`git checkout -b feature/your-feature-name`). 3. Commit your changes (`git commit -m 'Add some feature'`). 4. Push to the branch (`git push origin feature/your-feature-name`). 5. Open a pull request. ## License This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details. ## Acknowledgments - [Next.js](https://nextjs.org/) - [Tailwind CSS](https://tailwindcss.com/) - [Prisma](https://www.prisma.io/) - [Vercel](https://vercel.com/)