A professional networking platform designed for startup founders, entrepreneurs, and innovators. Connect with like-minded people, showcase your startup, share projects, and build real professional relationships.
- What This Project Does
- Tech Stack
- How It's Built
- Project Structure
- Data Models
- Core Features
- Setup Guide
- Environment Configuration
- Running the App
- How Everything Works
- API Endpoints
- Authentication
This web application lets startup founders and entrepreneurs:
- Build professional profiles with skills and experience
- Register and showcase startups with complete details
- Share updates and posts about their journey
- Create and display projects
- Connect with others by following them
- Message other members directly
- Search for startups, projects, and people
- Network and collaborate within the startup ecosystem
- Next.js 15.5.4: React framework handling both frontend and backend. Think of it as the foundation.
- React 19.2.0: JavaScript library for building the user interface.
- Tailwind CSS: Utility-first styling system.
- Shadcn UI Components: Pre-built UI elements.
- Framer Motion: Smooth animations and transitions.
- Next Themes: Dark/light mode support.
- Next.js API Routes: Backend functionality built into Next.js.
- MongoDB: Database storing all application data.
- Mongoose: MongoDB object modeling tool.
- NextAuth.js: Handles authentication and sessions.
- NextAuth.js v5: Modern authentication system.
- bcryptjs: Password encryption.
- JWT: Secure session tokens.
- Google Generative AI: Powers AI features like message reply suggestions.
- Zod: Data validation.
- React Hook Form: Form handling.
- date-fns: Date formatting.
- Lucide React: Icon library.
This is a full-stack application combining:
- Frontend: What users see in their browser
- Backend: Server logic processing requests
- Database: Permanent data storage
Next.js combines frontend and backend:
-
Pages/Routes: Files in app folder become web pages
- app/page.js → homepage
- app/home/page.jsx → /home
- app/profile/page.jsx → /profile
-
API Routes: Files in app/api become backend endpoints
- app/api/posts/route.js → handles posts
- app/api/users/[id]/route.js → handles user data
-
Server Components: Some components render on the server first, making the app faster.
hackathon/ ├── app/ # Main application │ ├── page.js # Landing page │ ├── layout.js # App wrapper │ ├── globals.css # Global styles │ │ │ ├── (main)/ # Protected pages (login required) │ │ ├── home/ # Dashboard/feed │ │ ├── messages/ # Messaging │ │ ├── network/ # Connections │ │ ├── profile/ # User profiles │ │ ├── post/[id]/ # Post details │ │ ├── project/[id]/ # Project details │ │ ├── startup/[id]/ # Startup pages │ │ ├── startups/ # Browse startups │ │ └── search/ # Search │ │ │ ├── auth/ # Authentication │ │ ├── login/ # Login page │ │ └── register/ # Sign up page │ │ │ └── api/ # Backend endpoints │ ├── auth/ # Auth APIs │ ├── posts/ # Post management │ ├── projects/ # Project management │ ├── startups/ # Startup management │ ├── users/ # User operations │ ├── conversations/ # Messaging │ └── upload/ # File uploads │ ├── components/ # Reusable UI components │ ├── ui/ # Basic elements │ ├── auth/ # Auth forms │ ├── layout/ # Header/footer │ ├── project/ # Project components │ └── startup/ # Startup components │ ├── lib/ # Utilities │ ├── models/ # Database schemas │ │ ├── user.model.js │ │ ├── post.model.js │ │ ├── startup.model.js │ │ ├── project.model.js │ │ └── message.model.js │ ├── mongoose.js # Database connection │ └── utils.js # Helper functions │ ├── contexts/ # React state management ├── auth.js # Auth configuration ├── middleware.js # Route protection └── package.json # Dependencies
- app/: All pages and API routes
- components/: Reusable UI pieces
- lib/models/: Database data structure definitions
- lib/mongoose.js: Database connection
- auth.js: Authentication setup
- middleware.js: Checks login status before page access
Data models define how information is structured in the database.
User account information.
Fields:
- name: Full name
- email: Email (unique, used for login)
- username: Unique username
- password: Encrypted password
- bio: User description
- skills: Array of skills
- avatar: Profile picture
- coverImage: Banner image
- location: City/country
- position: Job title
- company: Current company
- website: Personal website
- social: Social media links
- followers: Array of follower IDs
- following: Array of following IDs
- createdAt: Account creation date
Company information.
Fields:
- name: Startup name
- slug: URL-friendly name
- description: Company description
- logo: Company logo
- coverImage: Banner image
- industry: Business sector
- stage: Funding stage
- location: Company location
- website: Company website
- foundedDate: Launch date
- founder: Founder user ID
- team: Team members and roles
- showcase: Featured projects
- social: Social media links
- followers: Follower IDs
- projects: Project IDs
Social media posts.
Fields:
- content: Post text
- author: Author user ID
- startup: Related startup (optional)
- images: Image URLs
- likes: User IDs who liked
- comments: Array of comments
- shares: Share information
- createdAt: Post timestamp
Startup projects.
Fields:
- title: Project name
- description: Project details
- startup: Parent startup ID
- creator: Creator user ID
- status: Current status
- tags: Keywords
- links: Related URLs
- images: Screenshots
- startDate: Start date
- endDate: End date (optional)
- likes: User IDs who liked
- comments: Project comments
Direct messaging.
Message Fields:
- conversation: Conversation ID
- sender: Sender user ID
- content: Message text
- read: Read status
- createdAt: Timestamp
Conversation Fields:
- participants: User IDs in conversation
- lastMessage: Most recent message
- updatedAt: Last activity
- Email and password registration
- Encrypted password storage
- Secure login with session management
- Automatic redirects based on auth status
- Protected routes
- Create and edit profiles
- Add skills, bio, location, social links
- Upload profile and cover images
- View other profiles
- Follow/unfollow system
- Register startups with complete details
- Upload logos and covers
- Add team members
- Display showcase projects
- Track followers
- Edit information
- Create posts with text and images
- Like and comment
- Share posts
- View feed from followed accounts
- Search posts
- Create projects linked to startups
- Add descriptions, images, links
- Tag with keywords
- Track status
- Get likes and comments
- Follow users and startups
- Browse connections
- Search by name, skills, location
- View mutual connections
- Direct messages to users
- Real-time delivery
- Conversation history
- AI-powered reply suggestions
- Search startups by name or industry
- Search users by name or skills
- Search projects by title or tags
- Filter and sort results
- Toggle light/dark themes
- Saved per user
Have .env.local with MongoDB configured?
- Yes + Have Node.js/pnpm: Run pnpm install → pnpm dev (5 min)
- Yes + Fresh device: Install Node.js/pnpm → pnpm install → pnpm dev (20 min)
- No: Follow complete setup below (40 min)
1.1 Install Node.js
- Download from https://nodejs.org/ (LTS version)
- Run installer with default settings
- Verify: node --version
1.2 Install pnpm powershell npm install -g pnpm
Verify: pnpm --version
Option A: Clone bash git clone https://github.com/Adil027/NSCP-SPADES.git cd NSCP-SPADES
Option B: Download ZIP Extract to Desktop, open terminal in folder.
powershell cd C:\Users\YourUsername\Desktop\NSCP-SPADES-main pnpm install
This downloads all required packages (3-5 minutes).
4.1 Create Account
- Go to https://www.mongodb.com/cloud/atlas
- Sign up (free tier)
- Create cluster (M0 Sandbox, AWS, closest region)
4.2 Create Database User
- Database Access → Add New Database User
- Username: admin
- Password: Autogenerate (save it!)
- Privileges: Read and write to any database
4.3 Whitelist IP
- Network Access → Add IP Address
- Allow Access from Anywhere
4.4 Get Connection String
- Database → Connect → Connect your application
- Copy connection string
- Replace with your actual password
Example:
mongodb+srv://admin:[email protected]/?retryWrites=true&w=majority
Create .env.local in project root:
env
MONGODB_URL="mongodb+srv://admin:[email protected]/?retryWrites=true&w=majority&appName=Cluster0"
NEXTAUTH_URL="http://localhost:3000" NEXTAUTH_SECRET="generate-random-32-character-string"
GEMINI_API_KEY="your-key-here"
Generate NEXTAUTH_SECRET: powershell node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
Get GEMINI_API_KEY (optional): Visit https://makersuite.google.com/app/apikey
powershell
Remove-Item -Recurse -Force .next -ErrorAction SilentlyContinue
pnpm dev
Wait for "Ready" message, then visit http://localhost:3000
- Click "Sign Up"
- Fill in details
- Register
- Login
Done!
All variables go in .env.local in project root.
MONGODB_URL env MONGODB_URL="mongodb+srv://username:[email protected]/?retryWrites=true&w=majority"
Your MongoDB Atlas connection string.
NEXTAUTH_URL env NEXTAUTH_URL="http://localhost:3000"
Base URL (use http://localhost:3000 for development).
NEXTAUTH_SECRET env NEXTAUTH_SECRET="your-random-32-character-secret"
Random secret for encrypting sessions. Generate with: powershell node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
GEMINI_API_KEY env GEMINI_API_KEY="your-api-key"
For AI-powered features. Get from https://makersuite.google.com/app/apikey
env MONGODB_URL="mongodb+srv://admin:[email protected]/?retryWrites=true&w=majority&appName=Cluster0" NEXTAUTH_URL="http://localhost:3000" NEXTAUTH_SECRET="a8f5f167f44f4964e6c998dee827110c" GEMINI_API_KEY="AIzaSyAZIlbFjSPa3q2hyFcSvtjw2d3iUGUX4w0"
Never commit .env.local to Git.
powershell pnpm dev
Starts server at http://localhost:3000 with hot reload.
powershell pnpm dev -- -p 3001
bash pnpm build pnpm start
Command | Purpose |
---|---|
pnpm install | Install dependencies |
pnpm dev | Start dev server |
pnpm build | Build for production |
pnpm start | Run production build |
pnpm lint | Check code quality |
Press Ctrl + C in terminal.
- User fills registration form
- Data sent to /api/auth/register
- Email checked for duplicates
- Password encrypted with bcryptjs
- User saved to MongoDB
- Redirect to login
- User enters credentials
- NextAuth validates
- Database queried for user
- Password compared
- JWT token created
- Token stored in secure cookie
- Redirect to /home
- User types content, uploads images
- Images uploaded to /api/upload
- Saved in public/uploads/
- Post data sent to /api/posts
- Validated and saved to MongoDB
- Appears in feed
- User fills startup form
- Images uploaded
- Data sent to /api/startups
- Unique slug generated
- Startup saved with user as founder
- Accessible at /startup/[id]
- Click "Follow"
- Request to /api/users/[id]/follow
- Your ID added to their followers
- Their ID added to your following
- Button updates to "Unfollow"
- User sends message
- Check for existing conversation
- Create conversation if needed
- Message saved with conversation ID
- Recipient sees in inbox
- AI suggests replies
- User enters query
- Request to appropriate API
- MongoDB text search performed
- Results filtered
- Matches returned
- Request goes through middleware.js
- Checks for valid session
- Logged in + accessing auth pages → redirect to /home
- Not logged in + accessing protected pages → redirect to /auth/login
- Public routes accessible to everyone
- POST /api/auth/register - Register
- POST /api/auth/[...nextauth] - Login/logout
- GET /api/users/[id] - Get user
- PUT /api/users/[id] - Update profile
- POST /api/users/[id]/follow - Follow/unfollow
- GET /api/users/search - Search users
- GET /api/startups - List startups
- POST /api/startups - Create startup
- GET /api/startups/[id] - Get startup
- PUT /api/startups/[id] - Update startup
- DELETE /api/startups/[id] - Delete startup
- POST /api/startups/[id]/follow - Follow startup
- GET /api/startups/search - Search startups
- GET /api/posts - Get feed
- POST /api/posts - Create post
- GET /api/posts/[id] - Get post
- POST /api/posts/[id]/like - Like/unlike
- POST /api/posts/[id]/comments - Comment
- GET /api/posts/search - Search posts
- GET /api/projects - List projects
- POST /api/projects - Create project
- GET /api/projects/[id] - Get project
- PUT /api/projects/[id] - Update project
- POST /api/projects/[id]/like - Like project
- GET /api/conversations - Get conversations
- POST /api/conversations - Create conversation
- GET /api/conversations/[id]/messages - Get messages
- POST /api/conversations/[id]/messages - Send message
- POST /api/upload - Upload files
- POST /api/ai/suggest-replies - AI suggestions
Session-Based with JWT:
- User logs in
- Credentials validated
- JWT created with user info
- Stored in secure HTTP-only cookie
- Cookie sent with every request
- Server validates token
Token Contains:
- User ID
- Name
- Profile image
- Expiration (30 days)
Protected Routes: Routes under app/(main) require login. Middleware checks and redirects if needed.
Server Components: javascript import { auth } from "@/auth";
export default async function Page() { const session = await auth(); const user = session?.user; }
Client Components: javascript import { useSession } from "next-auth/react";
export default function Component() { const { data: session } = useSession(); const user = session?.user; }
- Set environment variables on hosting platform
- Ensure MongoDB accessible from production
- Run pnpm build
- Test with pnpm start
- Vercel (recommended for Next.js)
- Netlify
- Railway
- Push to GitHub
- Connect repo to Vercel
- Add environment variables
- Auto-deploy on push
Built for educational purposes as part of a hackathon.
For issues:
- Open GitHub issue
- Contact development team
- Check documentation above