https://github.com/urpagin/natcord
A Python Flask instant messenger
https://github.com/urpagin/natcord
instant-messaging
Last synced: 3 months ago
JSON representation
A Python Flask instant messenger
- Host: GitHub
- URL: https://github.com/urpagin/natcord
- Owner: Urpagin
- License: gpl-3.0
- Created: 2024-12-06T09:11:54.000Z (7 months ago)
- Default Branch: master
- Last Pushed: 2025-02-10T01:04:45.000Z (4 months ago)
- Last Synced: 2025-02-10T01:30:03.002Z (4 months ago)
- Topics: instant-messaging
- Language: JavaScript
- Homepage: https://natcord.urpagin.net
- Size: 271 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NATCord
A simple instant messenger with a UI similar to Discord.
Public instance at [https://natcord.urpagin.net](https://natcord.urpagin.net).
# Hosting
## Quick Setup (Linux)
1. **Clone the Repo:**
```bash
git clone https://github.com/Urpagin/NATCord.git
cd NATCord
```2. **Set Up Virtual Environment:**
```bash
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
```## Running the App
### Development 🚀
- **Initialize the database:**
```
python -m src.db.deploy
```- **Manually:**
```bash
export FLASK_APP=run.py
export FLASK_ENV=development
flask run
```
- **Or with Script:**
```bash
./run/run_dev.sh
```### Production 🌍
- **Manually:**
```bash
export FLASK_APP=wsgi.py
export FLASK_ENV=production
gunicorn -w 4 wsgi:app
```
- **Or with Script:**
```bash
./run/run_prod.sh
```### Docker 🐳
- **Build & Run:**
```bash
docker compose up --build
```
The app will be available at [http://localhost:50742](http://localhost:50742).## Windows & Mac
Not tested.# Inner Workings & Technologies
We use the Python programming language and the Flask micro web framework as the backend and HTML, CSS, and JavaScript as the frontend.
The backend also has a database, which uses [Flask-SQLAlchemy](https://flask-sqlalchemy.readthedocs.io/en/stable/quickstart/) (with SQLite under the hood).
For synchronization between the client and server, we originally considered using efficient methods like WebSockets or, even better, [SSE](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events) (Server-Sent Events), but we encountered difficulties implementing them. In the end, we opted for a simple yet inefficient HTTP polling system.