mirror of
https://github.com/EdiFarcas/Giveaway-app.git
synced 2026-06-22 01:00:52 +03:00
master
Giveaway Site
A modern web application for hosting and managing giveaways, built with Next.js, TypeScript, and Tailwind CSS.
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 (v16 or later)
- npm or yarn
- PostgreSQL
Installation
-
Clone the repository:
git clone https://github.com/your-username/giveaway-app.git cd giveaway-app -
Install dependencies:
npm install # or yarn install -
Set up environment variables: Create a
.envfile in the root directory and add the following: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 -
Apply database migrations:
npx prisma migrate dev -
Run the development server:
npm run dev # or yarn dev -
Open 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:
- Push your code to a GitHub repository.
- Connect the repository to Vercel.
- Add the required environment variables in the Vercel dashboard.
- Deploy the application.
Contributing
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature/your-feature-name). - Commit your changes (
git commit -m 'Add some feature'). - Push to the branch (
git push origin feature/your-feature-name). - Open a pull request.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Acknowledgments
Description
A React-based giveaway management app with features for creating, managing, and selecting winners for giveaways.
Languages
TypeScript
96.8%
JavaScript
2.2%
CSS
1%