IntraChat is a real-time internal chat application built with Flask, Flask-SocketIO, and SQLite. It is designed for teams, schools, and small communities that need a lightweight self-hosted chat with moderation tools, direct messages, uploads, and simple administration.
- Real-time public rooms and private conversations
- User accounts with display names, ranks, avatars, and language preferences
- Admin moderation with bans, temporary bans, pinning, room clearing, and role changes
- File uploads, image/video/audio previews, and Tenor GIF search
- Dark mode, multi-language UI, and dynamic SVG branding driven by configuration
- Discord webhook logging for admin actions and system activity
The project is configured to run directly from the repository with the included SQLite database layout. If you keep the bundled database snapshot in instance/chat.db, the default account is:
- Username:
System - Password:
system
Change that password immediately after first login.
- Python 3.11+
- Flask
- Flask-Login
- Flask-SocketIO
- Flask-SQLAlchemy / SQLAlchemy
- eventlet
- SQLite
- Vanilla HTML, CSS, and JavaScript
- Discord Webhook API
- Tenor GIF API
- Real-time message delivery over Socket.IO
- Public chat rooms and private PM threads
- Persistent message history
- Pinned messages per public room
- Styled admin announcements using the
ANNOUNCEMENT:prefix
- Login flow with session handling
- Profile editing with display name, avatar upload, and password change
- Supported UI languages: Slovencina, English, Polski
- Light and dark theme support
- Browser notifications for incoming messages
- Permanent bans and temporary bans
- Ban reason and expiration tracking
- Admin-only room clearing
- Admin-only pin and unpin actions
Systemaccount can grant or revoke admin rights via chat commands
- Discord webhook logging for moderation and admin actions
- Tenor-powered GIF search
- Dynamic app naming and SVG logo generation from configuration
| General Room | Private Messages |
|---|---|
![]() |
![]() |
| User Profile | User Management |
|---|---|
![]() |
![]() |
.
├── intrachat.py # Main Flask application and Socket.IO handlers
├── database.py # SQLAlchemy models
├── config.json # Local configuration fallback
├── requirements.txt # Python dependencies
├── lang/ # Translation files
├── templates/ # Jinja templates
│ ├── branding/ # SVG logo templates
│ ├── chat.html
│ ├── login.html
│ ├── admin_users.html
│ └── ...
├── static/ # CSS and static assets
├── instance/ # SQLite database storage
├── propic/ # User avatars
└── uploads/ # Uploaded files
git clone https://github.com/adriansimo2008/intrachat.git
cd intrachatOr download release
pip install -r requirements.txtYou can configure the app through environment variables or config.json. Environment variables take precedence where supported.
Example config.json:
{
"app_name": "IntraChat",
"discord_webhook_url": "discord_webhook_url_HERE",
"server_id": "IntraServer1",
"tenor_api_key": "tenor_api_key_HERE",
"FLASK_SECRET_KEY": "",
"FLASK_DEBUG": "False"
}FLASK_SECRET_KEY- MANDATORY secret key for Flask sessions. The application will refuse to start without this. Generate one with:python -c 'import secrets; print(secrets.token_hex(32))'
python intrachat.pyI recomend using astral - UV then you will need to setup it like this
uv venv
uv pip install -r requirements.txtand run it with
uv run intrachat.pyThe app runs on 0.0.0.0:5000 by default.
APP_NAME: Overrides the application name used in the UI and generated SVG logosDISCORD_WEBHOOK_URL: Discord webhook for admin and moderation logsSERVER_ID: Server label used in Discord log messagesTENOR_API_KEY: Enables GIF searchFLASK_SECRET_KEY: Required secret for Flask sessions if not present inconfig.jsonFLASK_DEBUG: Set totrueto enable debug mode
app_namediscord_webhook_urlserver_idtenor_api_keyFLASK_SECRET_KEYFLASK_DEBUGchat_rooms
/and/login: Login page/logout: End session/chat: Main chat interface/user/<id>: User profile/change_password: Password change page/add_user: Admin-only user creation/admin/users: Admin-only user management/history: Conversation history JSON/pinned: Current pinned message JSON/upload: File upload endpoint/uploads/<filename>: Uploaded file access/brand/mark.svg: Monogram logo/brand/wordmark.svg: Full SVG wordmark
/version/date/time/help/rules/uptime/server-uptime
/clear/pin <message_id>/unpin <message_id>/ban <username> <reason>/unban <username>/tempban @<username> <duration> <reason>
/makeadmin <username>/deladmin <username>
ANNOUNCEMENT: your text here
- Authentication and profile data
- Admin flag
- Ban state, reason, and expiry
- Avatar path
- Preferred language
- Message content
- Timestamp
- Pinned state
- Room or PM key
- Moderation history with type, target user, admin, and reason
- Username, IP address, and timestamp for audit logging
- The application is suited for always-on environments that support WebSockets
- SQLite is the default database and is stored under
instance/chat.db - File uploads are stored in
uploads/ - Avatar uploads are stored in
propic/ - System announcements are emitted periodically in the background
- Passwords are hashed with Werkzeug security utilities
- Upload filenames are sanitized with
secure_filename - Bans are enforced on both HTTP routes and Socket.IO connections
- Admin actions can be logged externally through Discord webhooks
This project uses a custom license for personal or internal use only.
- Forking and modification are allowed for personal or internal use
- Public redistribution is not allowed
See LICENSE for the exact terms.




