Skip to content

End-to-end encrypted realtime chat app made using Nuxt 3, Websockets and the Web Crypto API

Notifications You must be signed in to change notification settings

IamNanjo/encrypted-chat-app

Repository files navigation

Encrypted Chat App

This chat app uses end-to-end-encryption with RSA-OAEP. The encryption is done on the client using the Web Crypto API. The encrypted messages and public keys are saved on the server and they are then sent to users.

New chats and messages are sent to clients using Websockets. This means that only the new messages need to be decrypted and there will be no need to constantly poll the server for updates. This makes the chat app far more performant efficient.

Screenshots

Login page

User profile

User search

Chat with messages

Database

This app uses Drizzle ORM with better-sqlite3 adapter for the database connection.

Database EER diagram

Setup

Make sure to install the dependencies:

# npm
npm install

# yarn
yarn install

# bun
bun install

Database Setup

# npm
npm run dbmigrate
npm run dbpush

# yarn
yarn dbmigrate
yarn dbpush

# bun
bun dbmigrate
bun dbpush

Development Server

Start the development server on http://localhost:3000:

# npm
npm run dev

# yarn
yarn dev

# bun
bun dev

Production

Build the application for production:

# npm
npm run build

# yarn
yarn build

# bun
bun run build

Locally preview production build:

# npm
npm run preview

# yarn
yarn preview

# bun
bun preview

Serve the production build using PM2:

# npm
npm run start

# yarn
yarn start

# bun
bun start