A community sharing platform where BYU-Idaho students can post items they no longer need and help fellow students by allowing them to claim items for free.
- User Authentication: Sign up, sign in, and manage your profile
- Item Listings: Post, edit, and delete item listings
- Search & Filter: Browse items by category and search keywords
- Comments: Comment on listings and coordinate pickup
- Pickup Scheduling: Propose and confirm pickup times
- Status Management: Track items as available, pending, or claimed
- Framework: Next.js 14 (App Router)
- Language: TypeScript
- Styling: Tailwind CSS
- Database: MongoDB with Mongoose
- Authentication: NextAuth.js
- Validation: Zod
- Notifications: React Hot Toast
- Node.js 18+ installed
- MongoDB installed and running locally, or a MongoDB Atlas account
- Clone the repository:
git clone <repository-url>
cd BYUI_Pantry- Install dependencies:
npm install- Create a
.env.localfile in the root directory:
cp .env.local.example .env.local- Update the
.env.localfile with your configuration:
MONGODB_URI=mongodb://localhost:27017/byui-pantry
NEXTAUTH_SECRET=your-secret-key-here
NEXTAUTH_URL=http://localhost:3000
To generate a secure NEXTAUTH_SECRET, run:
openssl rand -base64 32Development mode:
npm run devOpen http://localhost:3000 in your browser.
npm run build
npm startBYUI_Pantry/
├── src/
│ ├── app/ # Next.js app directory
│ │ ├── api/ # API routes
│ │ ├── auth/ # Authentication pages
│ │ ├── items/ # Item pages
│ │ ├── profile/ # Profile page
│ │ ├── layout.tsx # Root layout
│ │ └── page.tsx # Home page
│ ├── components/ # React components
│ ├── lib/ # Utility functions
│ ├── models/ # Mongoose models
│ └── types/ # TypeScript types
├── public/ # Static files
└── package.json
POST /api/auth/signup- Create new user accountPOST /api/auth/[...nextauth]- NextAuth endpoints
GET /api/items- Get all items (with filters)POST /api/items- Create new itemGET /api/items/[id]- Get single itemPUT /api/items/[id]- Update itemDELETE /api/items/[id]- Delete itemPATCH /api/items/[id]/status- Update item status
GET /api/comments?itemId=[id]- Get comments for itemPOST /api/comments- Create commentPUT /api/comments/[id]- Update commentDELETE /api/comments/[id]- Delete comment
GET /api/users/[id]- Get user profilePUT /api/users/[id]- Update user profile
- Sign in to your account
- Click "Post Item" in the navigation
- Fill out the item details (title, description, category, location)
- Submit the form
- Browse available items
- Click on an item to view details
- Leave a comment with a proposed pickup time
- Wait for the owner to confirm
- Go to your Profile page
- View all your posted items
- Update status or delete items as needed
MONGODB_URI: MongoDB connection stringNEXTAUTH_SECRET: Secret key for NextAuth.jsNEXTAUTH_URL: Application URL
This is a student project for BYU-Idaho. Feel free to fork and modify for your own use.
MIT License - feel free to use this project as a template for your own community sharing platform.