A full-stack social networking platform built with modern web technologies, featuring user authentication, post management, admin dashboard, and real-time interactions.
- React 19.1.0 - Modern UI library with hooks and context
- Vite 7.0.4 - Lightning-fast build tool and dev server
- React Router DOM 7.7.1 - Client-side routing and navigation
- Axios 1.11.0 - HTTP client for API communications
- CSS3 - Custom styling with responsive design
- ESLint - Code linting and quality assurance
- Node.js - JavaScript runtime environment
- Express.js 4.18.2 - Web application framework
- MongoDB - NoSQL document database
- Mongoose 8.0.0 - ODM for MongoDB and Node.js
- JWT (jsonwebtoken 9.0.2) - Token-based authentication
- bcryptjs 2.4.3 - Password hashing and security
- CORS 2.8.5 - Cross-Origin Resource Sharing
- express-validator 7.0.1 - Input validation and sanitization
- dotenv 16.3.1 - Environment variable management
- Nodemon 3.0.1 - Auto-restart server during development
- Concurrently 8.2.2 - Run multiple npm scripts simultaneously
- VS Code - Development environment with extensions
- User registration and login
- JWT-based authentication
- Protected routes and middleware
- Role-based access control (User/Admin)
- Secure password hashing with bcrypt
- User profiles with personal information
- View other users' profiles
- User activity tracking
- Account creation date display
- Create, read, and delete posts
- Character limit validation (1-1000 characters)
- Author attribution and timestamps
- Chronological post ordering
- Like/Unlike posts functionality
- Real-time like count updates
- Optimistic UI updates
- Persistent like storage in database
- Platform statistics overview
- User management (promote/demote/delete)
- Post moderation and deletion
- Admin-only protected routes
- Comprehensive user and content analytics
- Responsive design for all screen sizes
- Modern dark theme interface
- Intuitive navigation with React Router
- Modal popups with React Portals
- Loading states and error handling
- Smooth animations and transitions
- RESTful API design
- Input validation and sanitization
- Error handling and logging
- Environment-based configuration
- CORS enabled for cross-origin requests
- Modular component architecture
Community-Platform/
├── frontend/ # React frontend application
│ ├── src/
│ │ ├── components/ # Reusable UI components
│ │ │ ├── Navbar.jsx # Navigation component
│ │ │ ├── PostForm.jsx # Post creation form
│ │ │ ├── PostList.jsx # Posts display with likes
│ │ │ └── ProtectedRoute.jsx # Route protection
│ │ ├── context/ # React Context providers
│ │ │ └── AuthContext.jsx # Authentication state
│ │ ├── pages/ # Page components
│ │ │ ├── Home.jsx # Main feed page
│ │ │ ├── Login.jsx # User login
│ │ │ ├── Register.jsx # User registration
│ │ │ ├── Profile.jsx # User profile
│ │ │ ├── UserProfile.jsx # Other users' profiles
│ │ │ └── AdminDashboard.jsx # Admin panel
│ │ ├── App.jsx # Main app component
│ │ └── main.jsx # App entry point
│ ├── public/ # Static assets
│ └── package.json # Frontend dependencies
├── backend/ # Node.js backend application
│ ├── middleware/ # Custom middleware
│ │ ├── auth.js # JWT authentication
│ │ └── adminAuth.js # Admin role verification
│ ├── models/ # Mongoose data models
│ │ ├── User.js # User schema with roles
│ │ └── Post.js # Post schema with likes
│ ├── routes/ # API route handlers
│ │ ├── auth.js # Authentication routes
│ │ ├── users.js # User management routes
│ │ ├── posts.js # Post and like routes
│ │ └── admin.js # Admin dashboard routes
│ ├── server.js # Express server setup
│ └── package.json # Backend dependencies
└── package.json # Root package with scripts
- Node.js (v14 or higher)
- MongoDB (local installation or MongoDB Atlas)
- npm or yarn package manager
-
Clone the repository:
git clone <repository-url> cd Community-Platform
-
Install all dependencies:
npm run install-deps
-
Configure environment variables:
cd backend cp .env.example .envUpdate the
.envfile with your configuration:MONGODB_URI=mongodb://localhost:27017/get-linked JWT_SECRET=your-secret-key PORT=5000
-
Start MongoDB:
- Local MongoDB: Start your local MongoDB service
- MongoDB Atlas: Ensure your cluster is running and update the connection string
-
Start the application:
npm run dev
-
Access the application:
- Frontend: https://get-linked-ebon.vercel.app/
- Backend API: https://community-platform-x95s.onrender.com/api/
- Please wait a few seconds after opening the vercel link (render backend takes time to initialize)
For testing purposes, you can use these pre-configured accounts:
- Email: [email protected]
- Password: 12345678
- Permissions: Full admin access to dashboard, user management, and all features
- Email: [email protected]
- Password: 12345678
- Permissions: Standard user access to create posts, like content, and view profiles
POST /auth/register- User registrationPOST /auth/login- User loginGET /auth/me- Get current user
GET /posts- Get all postsPOST /posts- Create new postGET /posts/user/:userId- Get posts by userPOST /posts/:id/like- Like/unlike postGET /posts/:id/like-status- Get like status
GET /users/profile- Get user profilePUT /users/profile- Update user profileGET /users/:id- Get user by ID
GET /admin/stats- Platform statisticsGET /admin/users- All users listDELETE /admin/users/:id- Delete userPUT /admin/users/:id/promote- Promote to adminPUT /admin/users/:id/demote- Demote to userGET /admin/users/:id/posts- Get user's postsDELETE /admin/posts/:id- Delete any post
- Create and manage their own posts
- Like/unlike any posts
- View their own and others' profiles
- Access home feed and user profiles
- All regular user permissions
- Access admin dashboard
- View platform statistics
- Manage all users (promote/demote/delete)
- Delete any posts
- View detailed user analytics
Initial Admin Creation:
- Register a new user account normally
- Manually update the database to change role to 'admin':
db.users.updateOne( { email: "[email protected]" }, { $set: { role: "admin" } } )
- Or have an existing admin promote the user via the dashboard
- Full CRUD Operations for posts and users
- JWT Authentication with protected routes
- Role-based Authorization (User/Admin)
- Like System with persistent storage
- Admin Dashboard with comprehensive management
- Responsive Design for mobile and desktop
- Real-time Updates with optimistic UI
- Input Validation and error handling
- Modal Components with React Portals
- RESTful API design patterns
# Start both frontend and backend in development mode
npm run dev
# Start only frontend
npm run frontend
# Start only backend
npm run backend
# Build frontend for production
npm run build
# Install all dependencies (root, frontend, backend)
npm run install-deps