Skip to content

amangupta20/auctify

Repository files navigation

Auctify

Auctify is a modern online auction platform built with Next.js, allowing users to create, bid on, and manage auctions.

Features

  • User Authentication (Sign up, Log in)
  • Create and manage auctions
  • View active auctions
  • Place bids on auctions
  • User profiles
  • Email notifications (e.g., for invoices)
  • Automated processing of finished auctions

Technologies Used

  • Next.js
  • React
  • TypeScript
  • Prisma (for database interaction)
  • NextAuth.js (for authentication)
  • Tailwind CSS (for styling)
  • Resend (for emails)

Getting Started

Follow these steps to set up and run the project locally.

Prerequisites

  • Node.js (v18 or later)
  • npm or yarn or pnpm or bun
  • A database (e.g., PostgreSQL, MySQL) compatible with Prisma
  • Environment variables configured (database URL, NextAuth secret, Resend API key, etc.)

Installation

  1. Clone the repository:
git clone [repository_url]
cd auctify
  1. Install dependencies:
npm install
# or
yarn install
# or
pnpm install
# or
bun install
  1. Set up your database and apply migrations:
npx prisma migrate dev --name initial_migration # Or the name of your first migration
  1. Generate Prisma client:
npx prisma generate

Running the Development Server

npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev

Open http://localhost:3000 with your browser to see the result.

You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.

This project uses next/font to automatically optimize and load Geist, a new font family for Vercel.

Docker Setup

This project includes Docker configuration for easy deployment and development.

Prerequisites

  • Docker and Docker Compose installed
  • Environment variables configured

Quick Start with Docker

  1. Set up environment variables:
cp .env.example .env

Edit .env with your actual values:

# Database credentials
usermysql=user
passwordmysql=password123
passwordmysqlroot=rootpassword123

# NextAuth secret (generate with: openssl rand -base64 32)
NEXTAUTH_SECRET=your-nextauth-secret-here

# Resend API key for emails
RESEND_API_KEY=your-resend-api-key-here
  1. Build and run with Docker Compose:
docker-compose up --build

This will:

  • Build the Next.js application
  • Start MySQL database
  • Set up database with migrations
  • Run the application on http://localhost:3000

Docker Services

  • main_app: Next.js application (port 3000)
  • db: MySQL 8 database (internal network only)
  • auctify_net: Internal Docker network for service communication

Environment Variables

The application uses these environment variables:

  • DATABASE_URL: MySQL connection string
  • NEXTAUTH_SECRET: Secret for NextAuth.js authentication
  • RESEND_API_KEY: API key for email sending

Development vs Production

  • Development: Use npm run dev for local development with hot reload
  • Production: Docker setup uses npm run build and npm start for optimized production build

Database Migrations

When running with Docker, the database is automatically created. To run migrations manually:

docker-compose exec main_app npx prisma migrate deploy

Stopping Services

docker-compose down

To remove database data:

docker-compose down -v

Learn More

To learn more about Next.js, take a look at the following resources:

You can check out the Next.js GitHub repository - your feedback and contributions are welcome!

Deploy on Vercel

The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.

Check out our Next.js deployment documentation for more details.

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages