A modern, responsive frontend for a professional networking and dating platform. Built with React 18, Vite, Redux Toolkit, and styled with Tailwind CSS and DaisyUI. Features real-time chat, dynamic feed, and seamless user experience.
π Live Demo: linkdev.online
- π¨ Modern UI/UX - Clean, responsive design with Tailwind CSS and DaisyUI
- π Authentication Flow - Login, Signup, and protected routes
- π€ User Profiles - View and edit profile with photo upload
- π€ Connection System - Send, accept, or reject connection requests
- π¬ Real-time Chat - Instant messaging with Socket.io
- π Toast Notifications - Real-time feedback for user actions
- π± Fully Responsive - Mobile-first design
- β‘ Lightning-fast Vite build system
- ποΈ Redux Toolkit for state management
- π£οΈ React Router for navigation
- π Protected routes with authentication
- π‘ Axios for API communication
- π Component-based architecture
- π Auto-updating UI on state changes
- React 18
- Vite
- Redux Toolkit
- React-Redux
- React Router DOM
- Tailwind CSS
- DaisyUI
- Axios
- Socket.io Client
- Redux DevTools
- ESLint
devlink-frontend/
βββ public/ # Static assets
βββ src/
β βββ components/ # Reusable UI components
β β βββ Navbar.jsx
β β βββ Footer.jsx
β β βββ UserCard.jsx
β β βββ ...
β βββ pages/ # Route pages
β β βββ Feed.jsx
β β βββ Login.jsx
β β βββ Profile.jsx
β β βββ Connections.jsx
β β βββ Requests.jsx
β β βββ Chat.jsx
β βββ store/ # Redux store
β β βββ store.js
β β βββ userSlice.js
β β βββ feedSlice.js
β β βββ connectionSlice.js
β βββ utils/ # Utility functions
β β βββ constants.js
β β βββ api.js
β βββ App.jsx # Main app component
β βββ main.jsx # Entry point
β βββ index.css # Global styles
βββ package.json
βββ vite.config.js
/login- User login page/signup- New user registration
/- Main feed with user cards/profile- User profile view and edit/connections- All accepted connections/requests- Pending connection requests/chat/:targetUserId- Real-time chat with specific user
- User logs in via
/login - JWT token stored in HTTP-only cookie
- Token validated on protected routes
- User redirected to
/loginif unauthorized - Navbar updates based on auth state
- Logout clears token and redirects
- Node.js (v16.17.0 or higher)
- npm or yarn
# Clone the repository
git clone https://github.com/Dhruv-Raichand/devlink-frontend.git
cd devlink-frontend
# Install dependencies
npm install
# Create .env file
cp .env.example .env
# Add your environment variables
VITE_API_URL=http://localhost:7777
# Start development server
npm run devThe app will be available at http://localhost:5173
Create a .env file in the root directory:
VITE_API_URL=https://linkdev.online/api
VITE_SOCKET_URL=https://linkdev.onlinenpm run dev # Start development server with hot reload
npm run build # Build for production
npm run preview # Preview production build locally
npm run lint # Run ESLint for code quality- userSlice - Current user data, authentication state
- feedSlice - Feed data with pagination
- connectionSlice - Connections and pending requests
{
user: {
data: { id, firstName, lastName, emailId, ... },
isAuthenticated: true
},
feed: {
users: [...],
page: 1,
hasMore: true
},
connections: {
list: [...],
requests: [...]
}
}- Navbar - Navigation with conditional rendering based on auth
- Footer - Site footer
- UserCard - Display user info on feed
- Body - Main layout wrapper with Outlet for routes
- ProtectedRoute - HOC for route protection
- Toast notifications for user feedback
- Loading states for async operations
- Error handling with user-friendly messages
- Responsive design for all screen sizes
# Create optimized production build
npm run build
# Output will be in /dist folder# SSH into EC2 instance
ssh -i "your-key.pem" ubuntu@your-ec2-ip
# Navigate to project directory
cd devlink-frontend
# Pull latest changes
git pull origin main
# Install dependencies and build
npm install
npm run build
# Copy build files to Nginx
sudo cp -r dist/* /var/www/html/
# Restart Nginx
sudo systemctl restart nginxserver {
listen 80;
server_name linkdev.online;
root /var/www/html;
index index.html;
location / {
try_files $uri $uri/ /index.html;
}
location /api/ {
proxy_pass http://localhost:7777/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}import axios from 'axios';
const api = axios.create({
baseURL: import.meta.env.VITE_API_URL,
withCredentials: true, // Important for cookies
});
export default api;// Login
const login = async (email, password) => {
const response = await api.post('/login', { email, password });
return response.data;
};
// Get Feed
const getFeed = async (page = 1) => {
const response = await api.get(`/feed?page=${page}`);
return response.data;
};
// Send Connection Request
const sendRequest = async (userId, status) => {
const response = await api.post(`/request/send/${status}/${userId}`);
return response.data;
};import { io } from 'socket.io-client';
const socket = io(import.meta.env.VITE_SOCKET_URL, {
withCredentials: true,
});
// Listen for messages
socket.on('message', (data) => {
console.log('New message:', data);
});
// Send message
socket.emit('sendMessage', { targetUserId, message });- Checks for JWT token in cookies
- Redirects to
/loginif not authenticated - Updates Navbar based on auth state
- User login updates Redux store
- Navbar re-renders automatically
- Feed data cached in store for performance
- Feed loads 10 users at a time
- "Load More" button for next page
- Handles end of feed gracefully
- Success messages on profile save
- Error messages on failed operations
- Auto-dismiss after 3 seconds
Backend Repository: DevLink Backend
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License.
Dhruv Raichand
- GitHub: @Dhruv-Raichand
- Website: linkdev.online
- Vite for lightning-fast development
- Redux Toolkit for simplified state management
- DaisyUI for beautiful components
- Socket.io for real-time features
Built with β€οΈ and βοΈ by Dhruv Raichand