Skip to content

Repository files navigation

NetNuggets 🌐

A beautiful website directory for discovering and sharing cool websites across the web. Built with React, TypeScript, Node.js, Express, and MongoDB.

Features ✨

User Features

  • πŸ” Authentication: Separate login/register pages with role selection (User/Admin)
  • 🎨 Beautiful UI: Pink & black themed interface with Aceternity UI 3D card animations
  • πŸ” Search & Filter: Find websites by name, description, or category
  • ⭐ Rating System: Rate your favorite websites (1-5 stars)
  • πŸ”– Bookmarks: Save websites to your personal collection
  • πŸ“ Submit Websites: Suggest new websites for admin review
  • πŸ“± Responsive Design: Works perfectly on mobile, tablet, and desktop

Admin Features

  • πŸ‘‘ Admin Panel: Comprehensive dashboard for managing the platform
  • βœ… Approve Submissions: Review and approve user-submitted websites
  • βž• Add Websites: Manually add new websites
  • ✏️ Edit Websites: Update existing website information
  • πŸ—‘οΈ Delete Websites: Remove websites from the directory
  • ⭐ Feature Websites: Mark websites as featured for prominence
  • πŸ‘₯ User Management: View and manage registered users

Tech Stack πŸ’»

Frontend

  • React with TypeScript
  • Vite for fast development
  • React Router for navigation
  • Tailwind CSS for styling
  • Aceternity UI for 3D card animations
  • Lucide React for icons

Backend

  • Node.js with Express
  • MongoDB with Mongoose
  • JWT for authentication
  • bcryptjs for password hashing

Project Structure πŸ“

NetNuggets/
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”‚   β”œβ”€β”€ ui/                  # Aceternity UI components
β”‚   β”‚   β”‚   β”œβ”€β”€ Header.tsx           # Main header with search
β”‚   β”‚   β”‚   β”œβ”€β”€ WebsiteCard.tsx      # 3D card for websites
β”‚   β”‚   β”‚   β”œβ”€β”€ SubmitForm.tsx       # Website submission form
β”‚   β”‚   β”‚   └── ProtectedRoute.tsx   # Route protection
β”‚   β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”‚   β”œβ”€β”€ LoginPage.tsx        # Login with role selection
β”‚   β”‚   β”‚   β”œβ”€β”€ RegisterPage.tsx     # Register with admin code
β”‚   β”‚   β”‚   β”œβ”€β”€ HomePage.tsx         # Main website directory
β”‚   β”‚   β”‚   └── AdminPanel.tsx       # Admin dashboard
β”‚   β”‚   β”œβ”€β”€ context/
β”‚   β”‚   β”‚   └── AuthContext.tsx      # Global auth state
β”‚   β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”‚   └── api.ts               # API service layer
β”‚   β”‚   └── types/
β”‚   β”‚       └── index.ts             # TypeScript interfaces
β”‚   └── package.json
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ models/
β”‚   β”‚   β”‚   β”œβ”€β”€ User.js              # User model with roles
β”‚   β”‚   β”‚   β”œβ”€β”€ Website.js           # Website model
β”‚   β”‚   β”‚   └── Submission.js        # Submission model
β”‚   β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”‚   β”œβ”€β”€ auth.js              # Authentication routes
β”‚   β”‚   β”‚   β”œβ”€β”€ websites.js          # Website CRUD routes
β”‚   β”‚   β”‚   β”œβ”€β”€ user.js              # User-specific routes
β”‚   β”‚   β”‚   └── admin.js             # Admin-only routes
β”‚   β”‚   β”œβ”€β”€ middleware/
β”‚   β”‚   β”‚   β”œβ”€β”€ auth.js              # JWT verification
β”‚   β”‚   β”‚   └── admin.js             # Admin role check
β”‚   β”‚   β”œβ”€β”€ server.js                # Express server
β”‚   β”‚   └── seed.js                  # Database seeding
β”‚   └── package.json
└── README.md

Setup Instructions πŸš€

Prerequisites

  • Node.js (v16 or higher)
  • MongoDB (local or Atlas)
  • npm or yarn

1. Clone the Repository

git clone <your-repo-url>
cd NetNuggets

2. Backend Setup

# Navigate to backend folder
cd backend

# Install dependencies
npm install

# Create .env file
# Copy the following and update MongoDB URI if needed:

Create backend/.env:

MONGODB_URI=mongodb://localhost:27017/netnuggets
JWT_SECRET=your_super_secret_jwt_key_change_this_in_production
ADMIN_SECRET_CODE=admin123secret
PORT=5000
# Seed the database with sample data
npm run seed

# Start the backend server
npm run dev

The backend will run on http://localhost:5000

3. Frontend Setup

# Navigate to frontend folder (from project root)
cd frontend

# Install dependencies
npm install

# Create .env file

Create frontend/.env:

VITE_API_URL=http://localhost:5000/api
VITE_ADMIN_CODE=admin123secret
# Start the frontend development server
npm run dev

The frontend will run on http://localhost:5173

4. Add Background Image

Place your custom background image at:

frontend/public/login-bg.jpg

Recommended size: 1920x1080 or higher

5. Install MongoDB (if not already installed)

Windows:

# Download from: https://www.mongodb.com/try/download/community
# Or use MongoDB Atlas (cloud): https://www.mongodb.com/cloud/atlas

Mac:

brew tap mongodb/brew
brew install mongodb-community
brew services start mongodb-community

Linux:

sudo apt-get install mongodb
sudo systemctl start mongodb

Default Credentials πŸ”‘

After running npm run seed:

Admin Account:

  • Email: admin@netnuggets.com
  • Password: admin123

User Account:

  • Email: user@example.com
  • Password: user123

Admin Registration Code:

  • Code: admin123secret (required when registering as admin)

Usage Guide πŸ“–

For Users:

  1. Register/Login: Choose "User" and create an account
  2. Browse Websites: Explore the curated collection
  3. Search & Filter: Use search bar and category filters
  4. Bookmark: Click bookmark icon on any website
  5. Rate: Click stars to rate (1-5)
  6. Submit: Click "Submit Site" to suggest new websites

For Admins:

  1. Register/Login: Choose "Admin" and enter admin code
  2. Access Admin Panel: Click "Admin Panel" in header
  3. Review Submissions: Approve or reject user submissions
  4. Add Websites: Manually add new websites with custom details
  5. Manage Websites: Edit, feature, or delete existing websites
  6. View Users: See all registered users

API Endpoints πŸ› οΈ

Authentication

  • POST /api/auth/register - Register new user
  • POST /api/auth/login - Login user
  • GET /api/auth/me - Get current user

Websites

  • GET /api/websites - Get all approved websites
  • GET /api/websites/:id - Get website by ID
  • POST /api/websites - Create website (admin)
  • PUT /api/websites/:id - Update website (admin)
  • DELETE /api/websites/:id - Delete website (admin)
  • POST /api/websites/:id/rate - Rate website (auth)

User

  • POST /api/user/bookmark - Toggle bookmark (auth)
  • GET /api/user/bookmarks - Get bookmarks (auth)
  • POST /api/user/submit - Submit website (auth)

Admin

  • GET /api/admin/submissions - Get all submissions (admin)
  • POST /api/admin/submissions/:id/approve - Approve submission (admin)
  • POST /api/admin/submissions/:id/reject - Reject submission (admin)
  • GET /api/admin/users - Get all users (admin)
  • DELETE /api/admin/users/:id - Delete user (admin)

Environment Variables πŸ”

Backend (.env)

MONGODB_URI=mongodb://localhost:27017/netnuggets
JWT_SECRET=your_super_secret_jwt_key_change_this_in_production
ADMIN_SECRET_CODE=admin123secret
PORT=5000

Frontend (.env)

VITE_API_URL=http://localhost:5000/api
VITE_ADMIN_CODE=admin123secret

Development Scripts πŸ“

Backend

npm run dev      # Start with nodemon (auto-restart)
npm start        # Start production server
npm run seed     # Seed database with sample data

Frontend

npm run dev      # Start development server
npm run build    # Build for production
npm run preview  # Preview production build

Features Roadmap πŸ—ΊοΈ

  • Email verification for registration
  • Password reset functionality
  • User profiles with submission history
  • Comments and discussions on websites
  • Social sharing features
  • Website screenshots/previews
  • Advanced search with tags
  • Newsletter subscription
  • Analytics dashboard for admins

Contributing 🀝

Contributions are welcome! Please feel free to submit a Pull Request.

License πŸ“„

MIT License - feel free to use this project for personal or commercial purposes.

Support πŸ’¬

For issues or questions, please open an issue on GitHub.


Made with ❀️ and lots of β˜•

Happy discovering! 🌐✨ "# NetNuggets"

About

NetNuggets Curated directory aggregating the internet's coolest websites by category for tech enthusiasts.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages