Link: https://campus-connect-amber.vercel.app/
CampusConnect is a robust, AI-driven marketplace designed specifically for university students. Whether you are looking to buy a secondhand textbook or sell your old dorm equipment, CampusConnect makes it effortless.
Powered by Gemini Vector Embeddings, our search engine doesn't just look for exact text matches—it understands the intent and context of what you are searching for, delivering highly relevant results instantly.
- 🧠 AI-Powered Semantic Search: Utilizes Gemini embeddings and PostgreSQL
pgvectorto perform highly accurate nearest-neighbor searches. - 🔐 Secure Authentication: Frictionless Google Sign-In powered by
NextAuth.js. - 🖼️ Seamless Image Handling: Blazing fast image uploads and edge delivery powered by
UploadThing. - ⚡ Next.js App Router: Built with the latest Next.js 15 features, including React Server Components and Server Actions.
- 🎨 Beautiful UI: Highly responsive and accessible design crafted with
Tailwind CSS. - 🗄️ Type-Safe Database: Fully robust database interactions securely typed with
Prisma ORM.
| Category | Technology | Description |
|---|---|---|
| Frontend | Next.js App Router | React framework for production. |
| Styling | Tailwind CSS v4 | Utility-first CSS framework. |
| Database | PostgreSQL | Relational database (requires pgvector). |
| ORM | Prisma | Next-generation Node.js and TypeScript ORM. |
| Auth | NextAuth.js | Authentication for Next.js. |
| AI/ML | Google Generative AI | Using Gemini models for vector embeddings. |
| Storage | UploadThing | File uploads for modern web apps. |
Follow these instructions to get a copy of the project up and running on your local machine for development and testing purposes.
- Node.js 18+ (Recommended)
- PostgreSQL Database with the
pgvectorextension enabled (e.g., Neon, Supabase).
git clone https://github.com/yourusername/campus-connect.git
cd campus-connectnpm installCreate a .env file at the root of your project and populate it with the following variables:
# 🐘 Database Configuration (Must support pgvector)
DATABASE_URL="postgresql://USER:PASSWORD@HOST:PORT/DB"
# 🔐 NextAuth Configuration
NEXTAUTH_URL="http://localhost:3000"
NEXTAUTH_SECRET="generate_a_strong_secret_using_openssl"
# 👤 Google OAuth Credentials
GOOGLE_CLIENT_ID="your_google_client_id"
GOOGLE_CLIENT_SECRET="your_google_client_secret"
# 🧠 Gemini AI Configuration
GEMINI_API_KEY="your_gemini_api_key"
# ☁️ UploadThing Credentials
UPLOADTHING_SECRET="your_uploadthing_secret"
UPLOADTHING_APP_ID="your_uploadthing_app_id"Note: You can generate a strong
NEXTAUTH_SECRETby runningopenssl rand -base64 32in your terminal.
Push the Prisma schema to your PostgreSQL database and generate the client:
npx prisma generate
npx prisma db push(Optional) Seed the database with dummy data to test the platform:
npx prisma db seednpm run devOpen http://localhost:3000 with your browser to see the application!
npm run dev- Starts the development server.npm run build- Builds the application for production deployment.npm run start- Runs the compiled application in production mode.npm run lint- Runs ESLint to catch and fix issues.
Traditional searches rely on exact keyword matches. CampusConnect is smarter:
- Embedding Generation: Every time a user creates a product listing, the title and description are parsed through Gemini (
gemini-embedding-001) to generate a 768-dimensional vector mathematical representation. - Vector Storage: This array is stored natively in PostgreSQL using the
pgvectorextension. - Semantic Querying: When a user types a search term, the term itself is converted into an embedding. The database then performs a blazing-fast "nearest-neighbor" calculation (
<=>) to fetch products that are contextually and semantically similar, even if exact keywords aren't used!
Contributions, issues, and feature requests are welcome! Feel free to open an issue or submit a pull request if you want to contribute.