A minimal, internal notice board for students at Rishihood / NST to coordinate shared rides between campus (Sonipat) and nearby cities (Delhi, Gurgaon, Noida, etc.).
This app is not Uber. It does not handle payments, real-time bookings, or seat tracking. Students post a ride, others contact them on WhatsApp, and the ride owner manually marks the ride as full when seats are filled.
- Next.js 14 (App Router) + TypeScript
- NextAuth (Credentials provider, JWT sessions) + bcryptjs for password hashing
- MongoDB via Mongoose
- Tailwind CSS
Phase 1 — Authentication
- Email + password sign-in restricted to
@nst.rishihood.edu.inand@rishihood.edu.in - Self-signup at
/signup, passwords are bcrypt-hashed and stored on theUserdocument - JWT session strategy
- Protected
/dashboardand/rides/*routes via middleware
Phase 2 — Ride board
POST /api/rides— create a ride (auth required)GET /api/rides— list active / full ridesPATCH /api/rides/:id— update status (creator only)DELETE /api/rides/:id— remove a ride (creator only)- Dashboard groups rides into Leaving Campus, Coming to Campus, Other Routes
- Each ride card has a one-tap WhatsApp contact button
-
Install dependencies
npm install
-
Configure environment variables
Copy
.env.exampleto.env.localand fill in the values:cp .env.example .env.local
MONGODB_URI— connection string for your MongoDB instanceNEXTAUTH_URL—http://localhost:3000for local devNEXTAUTH_SECRET— generate withopenssl rand -base64 32
-
Run the dev server
npm run dev
Open http://localhost:3000.
src/
app/
api/
auth/[...nextauth]/route.ts # NextAuth handler
auth/signup/route.ts # Create account
rides/route.ts # GET, POST
rides/[id]/route.ts # PATCH, DELETE
dashboard/page.tsx # Ride board
login/page.tsx # Sign-in page
signup/page.tsx # Create account
rides/new/page.tsx # Create ride form page
layout.tsx
page.tsx # Redirects based on auth
components/
CreateRideForm.tsx
LoginForm.tsx
Navbar.tsx
Providers.tsx
RideCard.tsx
RideFeed.tsx
SignOutButton.tsx
SignupForm.tsx
StatusBadge.tsx
lib/
auth.ts # NextAuth options
constants.ts
db.ts # Cached Mongoose connection
format.ts
models/
Ride.ts
User.ts
middleware.ts # Protects /dashboard and /rides
- WhatsApp number is collected per ride (the form requires it). It is not pulled from Google because OAuth doesn't expose phone numbers.
- The
Rideschema also stores a denormalized snapshot of the creator (creatorName,creatorEmail,creatorImage) so the feed renders without joins. - Ride status defaults to
active. Owners can flip betweenactiveandfullfrom their card.expiredis reserved for future cleanup jobs.