Skip to content

PERN stack mobile app for end to end chat, implementing jwt auth

Notifications You must be signed in to change notification settings

aymen-Dahmoun/fullStack_chatApp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

37 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ—จ๏ธ Full-Stack Chat Application

A cross-platform real-time chat app using React Native & Node.js


โœจ Features

  • ๐Ÿ” User Authentication with JWT + bcryptjs
  • โšก Real-Time Messaging using Socket.IO
  • ๐Ÿ’ฌ Private Chats (1-on-1 conversations)
  • ๐Ÿ’พ Persistent Data stored in PostgreSQL via Sequelize
  • ๐Ÿ“ฑ Cross-Platform Frontend (iOS + Android)
  • ๐ŸŽจ Tailwind CSS UI using NativeWind
  • ๐Ÿงญ Smooth Navigation with React Navigation

๐Ÿงฑ Tech Stack

๐Ÿ”ง Backend

  • Node.js, Express.js
  • PostgreSQL + Sequelize
  • Socket.IO
  • JWT + bcryptjs

๐Ÿ“ฑ Frontend

  • React Native (Expo)
  • NativeWind (Tailwind CSS for RN)
  • React Navigation
  • Axios + Socket.IO Client
  • React Native Paper

๐Ÿ—‚๏ธ Project Structure

fullstack_chatapp/
โ”‚
โ”œโ”€โ”€ backend/         # Node.js + Express API
โ”‚   โ”œโ”€โ”€ models/      # Sequelize models
โ”‚   โ”œโ”€โ”€ routes/      # API endpoints
โ”‚   โ”œโ”€โ”€ socket/      # WebSocket logic
โ”‚   โ””โ”€โ”€ .env
โ”‚
โ””โ”€โ”€ frontend/        # React Native app (Expo)
    โ”œโ”€โ”€ screens/     # Auth + Chat UI
    โ”œโ”€โ”€ components/  # UI elements
    โ””โ”€โ”€ app.json     # API link config

๐Ÿš€ Getting Started

๐Ÿ”Œ Backend Setup

cd backend
npm install

Create a .env file in the backend directory:

DB_NAME=your_db_name
DB_USER=your_db_user
DB_PASSWORD=your_db_password
DB_HOST=localhost
DB_PORT=5432
JWT_SECRET=your_jwt_secret
IP_ADDRESS_LINK="http://<YOUR_LOCAL_IP>:3000"

Start the server:

npm run dev

The backend will run at http://localhost:5000.


๐Ÿ“ฑ Frontend Setup

cd ../frontend
npm install

Edit app.json to point to your backend:

{
  "expo": {
    "extra": {
      "API_LINK": "http://<YOUR_LOCAL_IP>:5000"
    }
  }
}

Start Expo:

npx expo start

Scan the QR code with the Expo Go app on your device to run the application.


๐Ÿ“ก API Endpoints

๐Ÿ” Authentication

  • POST /api/auth/register
  • POST /api/auth/login
  • GET /api/session

๐Ÿ’ฌ Conversations

  • GET /api/conversation/:userId
  • GET /api/conversation/chat/:conversationId

๐Ÿ”Œ Socket Events

Event Description
connection User connects to the socket server
chat message Client sends a message (content, conversationId, receiverId); server broadcasts to recipient
disconnect User disconnects from the socket

๐Ÿ”ฎ Future Plans

  • ๐Ÿ“ž Voice & Video Calling (WebRTC)
  • ๐Ÿ“ File Sharing (images, PDFs, documents)
  • ๐Ÿ“ธ Screenshot Sharing

๐Ÿ–ผ๏ธ Screenshots



๐Ÿค Contributing

Contributions are welcome! Please open an issue or submit a pull request.

About

PERN stack mobile app for end to end chat, implementing jwt auth

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors