This guide explains how to set up the backend, database, and admin dashboard for Snapify.
- Node.js (v18 or higher)
- MongoDB Atlas account (or local MongoDB)
Install the required dependencies:
npm installCreate a .env file in the root directory and add the following variables:
# MongoDB Connection String (Get this from MongoDB Atlas)
DATABASE_URL="mongodb+srv://<username>:<password>@cluster0.example.mongodb.net/snapify"
# NextAuth Configuration
NEXTAUTH_URL="http://localhost:3000"
NEXTAUTH_SECRET="your-super-secret-key-change-this"We have prepared scripts to populate your database with initial data.
Creates a default admin account.
npx dotenv -e .env -- node scripts/seed-admin.js- Email:
admin@snapify.com - Password:
password123
Restores the original 7 categories (University, Weddings, etc.) with default images.
npx dotenv -e .env -- node scripts/seed-data.jsStart the development server:
npm run devOpen http://localhost:3000 in your browser.
Access the admin panel at: http://localhost:3000/admin
Login with the admin credentials seeded above.
- Dashboard: Overview of total categories and products.
- Categories: Create, Edit, Delete categories.
- Products: Manage products, set prices, and update status (Available/Sold).
- Framework: Next.js 15 (App Router)
- Database: MongoDB (via Mongoose)
- Auth: NextAuth.js
- Styling: Tailwind CSS + Lucide Icons