Skip to content

tpSpace/Social_project

ย 
ย 

Repository files navigation

๐ŸŒŸ Social Media Platform - Frontend

A modern, responsive social media application built with React, TypeScript, and Tailwind CSS. This frontend provides a Twitter-like interface with real-time interactions, image uploads, and user authentication.

๐Ÿ“ธ Screenshots

๐Ÿ  Home Feed

Home Feed Main timeline showing posts from all users with modern Twitter-like interface

โœ๏ธ Post Creation

Create Post Post composer with image upload functionality and rich text editing

๐Ÿ‘ค User Profile

User Profile User profile page with customizable avatar and personal information

๐Ÿ“ Profile Editing

Profile Edit Profile editing interface with bio, location, and personal details

๐Ÿ” Authentication

Login User login page with clean, modern design

Register User registration page with form validation

๐Ÿ“š Bookmarks

Bookmarks Bookmarked posts and saved content management

๐Ÿ” Explore

Explore Discover new content and trending topics

๐Ÿ’ฌ Messages

Messages Direct messaging interface

๐Ÿ”” Notifications

Notifications Real-time notifications and activity feed

๐Ÿซ UTH Integration

UTH University of Technology Ho Chi Minh City integration

๐ŸŽจ Background Customization

Background Customizable profile background images

๐Ÿ“ Location Services

Location Location-based features and services

๐Ÿš€ Features

โœจ Core Features

  • ๐Ÿ“ฑ Responsive Design: Mobile-first approach with Tailwind CSS
  • ๐Ÿ” User Authentication: Secure login/register with JWT tokens
  • ๐Ÿ“ Post Creation: Create posts with text and image support
  • ๐Ÿ–ผ๏ธ Image Upload: Cloudinary integration for image storage
  • ๐Ÿ‘ฅ User Profiles: Customizable profiles with avatars and backgrounds
  • ๐Ÿ”„ Real-time Updates: React Query for efficient data fetching
  • ๐Ÿ“ฑ Modern UI: Clean, Twitter-inspired interface

๐Ÿ› ๏ธ Technical Features

  • TypeScript: Full type safety across the application
  • React Query: Efficient data fetching and caching
  • React Router: Client-side routing and navigation
  • Tailwind CSS: Utility-first CSS framework
  • Vite: Fast build tool and development server
  • Error Handling: Comprehensive error handling and user feedback
  • Toast Notifications: User-friendly notification system

๐Ÿ—๏ธ Architecture

src/
โ”œโ”€โ”€ components/          # Reusable UI components
โ”‚   โ”œโ”€โ”€ Post.tsx        # Post display component
โ”‚   โ”œโ”€โ”€ PostComposer.tsx # Post creation component
โ”‚   โ”œโ”€โ”€ Timeline.tsx    # Timeline display
โ”‚   โ”œโ”€โ”€ Sidebar.tsx     # Navigation sidebar
โ”‚   โ”œโ”€โ”€ RightSidebar.tsx # Right sidebar with suggestions
โ”‚   โ””โ”€โ”€ ...
โ”œโ”€โ”€ pages/              # Page components
โ”‚   โ”œโ”€โ”€ Home.tsx        # Home feed page
โ”‚   โ”œโ”€โ”€ Profile.tsx     # User profile page
โ”‚   โ”œโ”€โ”€ Login.tsx       # Authentication pages
โ”‚   โ”œโ”€โ”€ Register.tsx    # User registration
โ”‚   โ””โ”€โ”€ ...
โ”œโ”€โ”€ services/           # API service layer
โ”‚   โ”œโ”€โ”€ api.ts         # Base API configuration
โ”‚   โ”œโ”€โ”€ auth.service.ts # Authentication services
โ”‚   โ”œโ”€โ”€ posts.service.ts # Post management
โ”‚   โ””โ”€โ”€ ...
โ”œโ”€โ”€ hooks/              # Custom React hooks
โ”œโ”€โ”€ contexts/           # React contexts
โ”œโ”€โ”€ types/              # TypeScript type definitions
โ””โ”€โ”€ lib/                # Utility functions

๐Ÿ› ๏ธ Tech Stack

Frontend

  • React 18 - UI library
  • TypeScript - Type safety
  • Vite - Build tool
  • Tailwind CSS - Styling
  • React Query - Data fetching
  • React Router - Navigation
  • React Hot Toast - Notifications
  • Lucide React - Icons

๐Ÿš€ Getting Started

Prerequisites

  • Node.js (v18 or higher)
  • npm or pnpm

Installation

  1. Clone the repository

    git clone https://github.com/Huc06/Social_project.git
    cd Social_project
  2. Install dependencies

    npm install
    # or
    pnpm install
  3. Environment Setup Create a .env file in the root directory:

    VITE_API_BASE_URL=http://localhost:4000/api/v1
  4. Start the development server

    npm run dev
    # or
    pnpm dev

The application will start on http://localhost:5173

๐Ÿ“ฑ Usage

Authentication

  1. Register a new account or login with existing credentials
  2. JWT tokens are automatically managed for session persistence

Creating Posts

  1. Click the compose button on the home page
  2. Write your post content
  3. Optionally upload an image
  4. Click "Post" to publish

Profile Management

  1. Navigate to your profile
  2. Upload avatar and background images
  3. Edit your bio and personal information

Navigation

  • Home: View timeline of all posts
  • Explore: Discover trending content
  • Bookmarks: View saved posts
  • Messages: Direct messaging
  • Notifications: Activity updates
  • Profile: Manage your profile

๐Ÿ”ง Available Scripts

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

๐Ÿ“ฆ Build & Deployment

Development Build

npm run dev

Production Build

npm run build

Preview Production Build

npm run preview

Deploy to Vercel/Netlify

npm run build
# Deploy dist/ folder to your hosting platform

๐ŸŽจ Design System

Color Palette

  • Primary: Blue tones for main actions
  • Secondary: Gray tones for secondary elements
  • Success: Green for positive actions
  • Warning: Yellow for warnings
  • Error: Red for errors

Typography

  • Headings: Bold, clear hierarchy
  • Body: Readable, comfortable line height
  • Code: Monospace for technical content

Components

  • Buttons: Consistent styling and hover states
  • Forms: Clear validation and error states
  • Cards: Clean, modern post cards
  • Navigation: Intuitive sidebar and top navigation

๐Ÿ”’ Security Features

  • JWT Authentication: Secure token-based authentication
  • Input Validation: Client-side form validation
  • XSS Protection: React's built-in XSS protection
  • HTTPS: Secure communication with backend
  • Environment Variables: Sensitive data protection

๐Ÿ“ฑ Responsive Design

The application is fully responsive and optimized for:

  • Desktop: 1920x1080 and above
  • Tablet: 768x1024
  • Mobile: 375x667 and above

๐Ÿงช Testing

# Linting
npm run lint

# Build testing
npm run build
npm run preview

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ‘ฅ Team

  • Frontend Development: React + TypeScript
  • UI/UX Design: Modern, responsive interface
  • State Management: React Query integration
  • Styling: Tailwind CSS implementation

๐Ÿ”ฎ Future Enhancements

  • Real-time notifications
  • Post likes and comments
  • User following system
  • Advanced search functionality
  • Dark mode theme
  • PWA support
  • Offline functionality

๐Ÿ“ž Support

If you have any questions or need help, please:

  • Open an issue on GitHub
  • Contact the development team
  • Check the documentation

Made with โค๏ธ by the development team

Last updated: January 2025

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 98.3%
  • Other 1.7%