Skip to content

A modern full-stack social media application built with React Native (Expo) for mobile and Node.js/Express for the backend. This app provides a Twitter-like experience with features for posting, commenting, liking, and real-time notifications.

Notifications You must be signed in to change notification settings

amanhaidry/X-App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

47 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

X-App - Full-Stack Social Media Application

X-App Banner

A modern full-stack social media application built with React Native (Expo) for mobile and Node.js/Express for the backend. This app provides a Twitter-like experience with features for posting, commenting, liking, and real-time notifications.

React Native Expo TypeScript TailwindCSS NativeWind React Query Clerk Expo Router Node.js Express MongoDB Cloudinary Arcjet CORS

πŸš€ Features

X-App Banner

Mobile App (React Native/Expo)

  • Authentication: Social login with Google and Apple using Clerk
  • Post Creation: Create posts with text and images
  • Social Interactions: Like, comment, and delete posts
  • User Profiles: View and edit user profiles
  • Real-time Updates: Live notifications and feed updates
  • Cross-platform: Runs on iOS, Android, and Web

Backend API (Node.js/Express)

  • RESTful API: Clean and organized API endpoints
  • Authentication: Secure authentication with Clerk integration
  • Database: MongoDB with Mongoose ODM
  • File Upload: Image handling with Cloudinary
  • Security: Rate limiting with Arcjet
  • Notifications: Real-time notification system

πŸ“± Tech Stack

Frontend (Mobile)

  • React Native React Native with Expo
  • TypeScript TypeScript for type safety
  • TailwindCSS TailwindCSS with NativeWind for styling
  • React Query React Query for data fetching and caching
  • Clerk Clerk for authentication
  • Expo Router Expo Router for navigation

Backend

  • Node.js Node.js with Express
  • MongoDB MongoDB with Mongoose
  • Clerk Clerk for authentication
  • Cloudinary Cloudinary for image storage
  • Arcjet Arcjet for security and rate limiting
  • CORS CORS enabled for cross-origin requests

πŸ› οΈ Installation & Setup

Prerequisites

  • Node.js (v16 or higher)
  • npm or yarn
  • MongoDB
  • Expo CLI CLI (for mobile development)
  • Android Studio / Xcode (for device testing)

Backend Setup

  1. Navigate to backend directory: cd backend

  2. Install dependencies: npm install

  3. Environment Configuration - Create a .env file in the backend directory: MONGODB_URI=your_mongodb_connection_string CLERK_SECRET_KEY=your_clerk_secret_key CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name CLOUDINARY_API_KEY=your_cloudinary_api_key CLOUDINARY_API_SECRET=your_cloudinary_api_secret ARCJET_KEY=your_arcjet_key PORT=5000

  4. Start the development server: npm run dev

Mobile App Setup

  1. Navigate to mobile directory: cd mobile

  2. Install dependencies: npm install

  3. Environment Configuration - Update the API base URL in mobile/utils/api.ts to point to your backend server.

  4. Start the Expo development server: npx expo start

  5. Run on device/simulator:

    • Android: npx expo start --android
    • iOS: npx expo start --ios
    • Web: npx expo start --web

πŸ”§ API Endpoints

Authentication

  • All protected routes require authentication via Clerk

Posts

  • GET /posts - Get all posts
  • POST /posts - Create a new post
  • DELETE /posts/:id - Delete a post
  • POST /posts/:id/like - Like/unlike a post

Comments

  • GET /comments/post/:postId - Get comments for a post
  • POST /comments/post/:postId - Create a comment
  • DELETE /comments/:commentId - Delete a comment

Users

  • GET /users/me - Get current user
  • POST /users/sync - Sync user with Clerk
  • PUT /users/profile - Update user profile

πŸš€ Deployment

Backend (Vercel)

The backend is configured for Vercel deployment with vercel.json. Simply connect your repository to Vercel and deploy.

Mobile App

  • Expo Application Services (EAS): For building and distributing the app
  • App Store/Google Play: For production releases

πŸ” Environment Variables

Backend

MONGODB_URI=mongodb://localhost:27017/xapp CLERK_SECRET_KEY=your_clerk_secret_key CLOUDINARY_CLOUD_NAME=your_cloud_name CLOUDINARY_API_KEY=your_api_key CLOUDINARY_API_SECRET=your_api_secret ARCJET_KEY=your_arcjet_key PORT=5000

Mobile

Update the API base URL in mobile/utils/api.ts based on your environment:

πŸ§ͺ Development

Running Tests

Backend: cd backend && npm test Mobile: cd mobile && npm test

Linting

Mobile: cd mobile && npm run lint

πŸ“± Features in Detail

Authentication

  • Seamless social login with Google and Apple
  • Secure token-based authentication
  • Automatic user synchronization

Post Management

  • Rich text posts with image support
  • Real-time like/unlike functionality
  • Post deletion with proper authorization

Comments System

  • Threaded comments on posts
  • Real-time comment notifications
  • Comment deletion by author

User Profiles

  • Profile viewing and editing
  • User post history
  • Avatar and bio management

Built with ❀️ using React Native, Node.js, and modern web technologies.

About

A modern full-stack social media application built with React Native (Expo) for mobile and Node.js/Express for the backend. This app provides a Twitter-like experience with features for posting, commenting, liking, and real-time notifications.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published