Skip to content

jonorl/messaging-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 

Repository files navigation

📝 Messaging app (monorepo)

A messaging application built with Node.js, Express and PostgreSQL. Developed as part of The Odin Project's Node.js curriculum, this app demonstrates full-stack capabilities including authentication, real-time communication, and structured database interactions via Prisma ORM.

🚀 Features

  • User registration and authentication
  • PostgreSQL database integration via Prisma
  • Secure password handling (hasing + salting) with bcrypt
  • Timestamps for messages
  • Profile customisation
  • Image attachments using Cloudinary's hosting
  • Basic group chat functionality
  • Display of online users
  • Real time simulation

🧱 Tech Stack

Backend

  • Node.js
  • Express.js
  • PostgreSQL
  • Prisma ORM
  • dotenv
  • bcrypt/uuid
  • Multer middleware
  • JWT strategy
  • CORS

Frontend libraries

  • React
  • Tailwind
  • Shadcn/UI
  • Lucide-react

📁 Project Structure

messaging-app/
│
├── server/               # Express backend
│   ├── assets/           # Image folder
│   ├── controllers/      # Middleware folder
│   ├── db/               # Prisma/SQL queries
│   ├── routes/           # Route definitions
│   ├── prisma/           # Prisma schema and migrations
│   ├── utils/            # Helper js functions
│   ├── app.js            # Express app setup
│   └── .env              # Environment variables
│
├── client/               # React + Tailwind + Shadcn/UI frontend
│
└── README.md             # Project overview

🛠️ Getting Started

Prerequisites

Setup (Backend)

# Clone the repo
git clone https://github.com/jonorl/messaging-app.git
cd messaging-app

# Navigate to backend
cd server

# Install dependencies
npm install

# Set up database and run migrations
npx prisma migrate dev --name init

# Start the server
node --watch app.js

Server runs at: http://localhost:3000

Setup (frontend)

# Navigate to frontend
cd client

# Install dependencies
npm install

# Start the client
npm run dev

Setup (database)

# Initiate db
npx prisma migrate dev --name init

Client runs at: http://localhost:5173

Add Robot (optional, but good for testing)

INSERT INTO "User" (
  id,
  email,
  name,
  profilePicture,
  passwordHash,
  createdAt
) VALUES (
  '8d7118e1-0f6c-466c-9c17-e7c8bc42af8e',
  '[email protected]',
  'Robot',
  'https://res.cloudinary.com/dqqdfeuo1/image/upload/v1748510935/SystemShock2-Shodan_acqa9v.png',
  '$2b$10$9LRDo5nLio4zVN6XTyp4JOrLpU.guTWlW8TEkuVelPK0RN5TtW2jC',
  NOW()
);

.env file (backend)

DATABASE_URL="postgresql://USER:PASSWORD@HOST:PORT/DATABASE_NAME"
JWT_SECRET="yourSecretWord"
PORT="3000"
ROBOT="8d7118e1-0f6c-466c-9c17-e7c8bc42af8e"
CLOUDINARY_CLOUD_NAME=yourCloudName
CLOUDINARY_API_KEY=yourCloudinaryAPIKey
CLOUDINARY_API_SECRET=yourCloudinaryAPISecret

.env file (frontend)

VITE_LOCALHOST=http://localhost:3000

🚀 Deployment

Blog App Screenshot

🧱 To-do

  • Group Chat Enhancements: Group titles, admin roles, and better user management
  • Message editing and deletion support

👨‍💻 Author

Jonathan Orlowski *GitHub *LinkedIn

📚 This project is part of The Odin Project, a free and open-source curriculum for aspiring full-stack web developers.

About

Messaging App for The Odin Project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published