A digital loyalty card management system for small businesses, built with Next.js 14, React, and PostgreSQL.
- Multi-business support: Owners can manage multiple businesses
- Loyalty programs: Create stamp cards or points-based rewards
- Customer self-registration: QR codes for easy customer sign-up
- Digital cards: Mobile-friendly card view with progress tracking
- Staff rostering: Employee scheduling and auto-assignment
- Wallet integration: Google Pay pass generation (Apple Wallet requires certificates)
- Framework: Next.js 14 with App Router
- Database: PostgreSQL with Prisma ORM
- Auth: NextAuth.js with credentials provider
- Styling: Tailwind CSS
- Deployment: Vercel
- Node.js 18+
- PostgreSQL database (or use Vercel Postgres / Neon)
-
Install dependencies:
cd shifty-next npm install -
Set up environment variables:
cp .env.example .env
Edit
.envwith your database credentials:DATABASE_URL="postgresql://..." DIRECT_URL="postgresql://..." NEXTAUTH_SECRET="your-secret-key" NEXTAUTH_URL="http://localhost:3000" NEXT_PUBLIC_APP_URL="http://localhost:3000" -
Set up the database:
npx prisma db push
-
Run the development server:
npm run dev
-
Push to GitHub:
git init git add . git commit -m "Initial commit" git remote add origin https://github.com/yourusername/shifty-next.git git push -u origin main
-
Import to Vercel:
- Go to vercel.com/new
- Import your repository
- Vercel will auto-detect Next.js
-
Add environment variables in Vercel dashboard:
DATABASE_URL- Your Postgres connection string (pooled)DIRECT_URL- Your Postgres connection string (direct)NEXTAUTH_SECRET- Generate withopenssl rand -base64 32NEXTAUTH_URL- Your Vercel domain (e.g.,https://shifty.vercel.app)NEXT_PUBLIC_APP_URL- Same as NEXTAUTH_URL
-
Set up database:
- Use Vercel Postgres or Neon
- Run migrations:
npx prisma db push
- Go to your Vercel project → Storage → Create Database
- Select Postgres
- Copy the connection strings to your environment variables
- Create account at neon.tech
- Create a new project
- Copy the connection string
- Create project at supabase.com
- Go to Settings → Database
- Use the "Connection string" with your password
shifty-next/
├── app/
│ ├── api/ # API routes
│ ├── card/[cardId]/ # Customer card view
│ ├── join/[businessId]/ # Customer registration
│ └── owner/ # Owner dashboard pages
├── components/ # React components
├── lib/ # Utilities (auth, db, utils)
├── prisma/ # Database schema
└── public/ # Static assets
MIT