Messecure is a modern, secure, and scalable web messaging application built using Next.js 14, powered by the Matrix protocol and Synapse server. It leverages the latest technology to ensure end-to-end encrypted communication, making it perfect for private and team-based messaging.
- Real-time messaging with Matrix protocol 🔄
- End-to-end encryption for secure conversations 🔐
- User-friendly web interface with dynamic UI components 🖥️
- Scalable infrastructure using Docker and Docker Compose 🐳
- Next.js 14: A React-based framework for building fast and scalable web applications ⚡
- Matrix Protocol: An open standard for secure, decentralized communication 🔗
- Synapse Server: A homeserver implementation for the Matrix protocol 🏠
- PostgreSQL 14: Used as the database backend for the Synapse server 🗄️
- Various npm packages for UI components and utility functions (e.g.,
matrix-js-sdk
,next-auth
,react-hook-form
)
Messecure is fully containerized using Docker and Docker Compose to simplify deployment and scaling. The application consists of three main services:
- Synapse: The Matrix homeserver.
- PostgreSQL: The database for Synapse.
- Messecure App: The Next.js frontend application.
Below is the docker-compose.yml
configuration:
version: '3.8'
services:
synapse:
image: matrixdotorg/synapse:latest
container_name: messecure-synapse
depends_on:
- postgres
volumes:
- ./synapse/homeserver.yaml:/data/homeserver.yaml
- ./synapse/data:/data
environment:
SYNAPSE_SERVER_NAME: localhost
SYNAPSE_REPORT_STATS: 'yes'
ports:
- "8008:8008"
restart: unless-stopped
postgres:
image: postgres:14-alpine
container_name: messecure-db
environment:
POSTGRES_USER: synapse
POSTGRES_PASSWORD: aComplexPassphraseNobodyCanGuess
volumes:
- postgres_data:/var/lib/postgresql/data
restart: unless-stopped
messecure:
build:
context: .
dockerfile: Dockerfile
target: runner
container_name: messecure-app
ports:
- "3000:3000"
depends_on:
- synapse
- postgres
environment:
NODE_ENV: production
restart: unless-stopped
volumes:
postgres_data:
driver: local
- Docker and Docker Compose installed on your system 🐳
- Node.js (v20 or higher) for local development 🌐
-
Clone the repository:
git clone https://github.com/yourusername/messecure.git cd messecure
-
Configure Synapse:
- Edit
synapse/homeserver.yaml
with your desired settings.
- Edit
-
Build and run the Docker containers:
docker-compose up --build
-
Access the application:
- Synapse Admin Interface:
http://localhost:8008
- Messecure Frontend:
http://localhost:3000
- Synapse Admin Interface:
-
Install dependencies:
npm install
-
Run the application in development mode:
npm run dev
-
Open your browser at
http://localhost:3000
.
- Replace sensitive environment variables with your own secure values.
- To deploy in production, use a reverse proxy like Nginx for SSL termination and domain setup.
Enjoy secure and modern communication with Messecure! ✉️🔒
Here is an overview of the main folders and files in the project :
messecure-frontend/
├── .env # Environment variables file
├── .eslintignore # Files ignored by ESLint
├── .eslintrc.json # ESLint configuration
├── .github/ # GitHub Action Workflow
├── .gitignore # Files ignored by Git
├── .idea/ # IDE configurations (JetBrains)
├── .next/ # Files generated by Next.js
├── Dockerfile # Dockerfile for the application
├── README.md # Project documentation
├── app/ # File of routes and Next.js pages
├── components/ # Reusable application components
├── config/ # Custom application configuration
├── contexts/ # React contexts
├── docker-compose.yml # Docker Compose configuration
├── hooks/ # React custom hooks
├── lib/ # Internal application libraries
├── package.json # JavaScript Dependencies list
├── public/ # Public files folder (images, static assets)
├── services/ # Matrix service
├── styles/ # CSS/Tailwind files for styles
├── synapse/ # Synapse media folder
└── types/ # Global types for TypeScript
app/
: Main structure of Next.js pages and routes.components/
: Modular and reusable React components.services/
: Centralised management for Matrix API calls.styles/
: Style configuration via TailwindCSS and theme management.