https://github.com/ntoll/chattyapp
A world changing chat app (demonstrating PyScript as a frontend to a Python website).
https://github.com/ntoll/chattyapp
Last synced: 5 months ago
JSON representation
A world changing chat app (demonstrating PyScript as a frontend to a Python website).
- Host: GitHub
- URL: https://github.com/ntoll/chattyapp
- Owner: ntoll
- License: mit
- Created: 2025-05-10T13:52:45.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-05-22T15:11:16.000Z (8 months ago)
- Last Synced: 2025-08-14T04:48:09.672Z (5 months ago)
- Language: JavaScript
- Size: 5.41 MB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# ChattyApp 💬
A world changing chat app to be acquired for billions 💰 at some point in the
future. This is Nicholas and Paul's totally legit (and not entirely serious)
retirement plan expressed in as few lines of code as possible. 💵👴🎉😉
More seriously, this is an example of using [PyScript](https://pyscript.net/)
as a frontend to a [Flask](https://flask.palletsprojects.com/en/stable/)-ish
application (we use the async
[Quart](https://quart.palletsprojects.com/en/latest/) framework, based on the
Flask API). We also use the wonderful [RoboHash](https://robohash.org/)
service for our goofy robot avatars. 🤖
This world changing technology was first announced by our visionary founders at
[FlaskCon](https://flaskcon.com/2025/) (a conference inside a conference) at
[PyConUS 2025](https://us.pycon.org/2025/).
Next step: add AI bandwagon. ✨
## Developer setup 🖥️🐍
* Clone the repository.
* Create and activate a virtual environment.
* `pip install -r requirements.txt` (currently only `quart` is needed).
* `make run` to serve locally.
* Point your browser[s] to: [localhost:8000](http://localhost:8000/)
* Chat! 💬
All source code is in the `chatty` directory.
There is (currently) no test suite. But if there were, we'd be using the
[uPyTest](https://github.com/pyscript/upytest) and
[uMock](https://github.com/pyscript/umock) frameworks for testing Python code
in the browser with PyScript. 🛠️
PRs welcome. 🤗
## PythonAnywhere Deployment
When demonstrating this app, we host it with the lovely folks at
[PythonAnywhere](https://pythonanywhere.com). Here are the steps we use to
deploy the application. We assume you already have an account with a
`` associated with it. By the end of these steps you'll have a
version of this site running at `.pythonanywhere.com`.
* If you have not done so already, you must create a PythonAnywhere API token.
This is easy to do via
[these instructions](https://help.pythonanywhere.com/pages/GettingYourAPIToken).
* Make sure you don't already have a website running at
`.pythonanywhere.com`. If you do, delete it.
* Open a fresh Bash console from your PythonAnywhere dashboard.
* From your home directory, clone the ChattyApp from GitHub:
`git clone https://github.com/ntoll/chattyapp.git`
* In the new Bash console, install the command line tools:
`pip install --upgrade pythonanywhere` (if you see errors, ignore them).
* Create a new virtual environment: `mkvirtualenv chatty --python=python3.10`
* Change into the `chattyapp` directory that was created when you cloned the
app from GitHub: `cd chattyapp`
* Install the app's dependencies: `pip install -r requirements.txt`
* Install `uvicorn` (used to serve the app): `pip install "uvicorn[standard]"`
* Ensure you have a site _command_, used to start the server. You should use
the following command but with `` replaced with your actual
username:
`/home//.virtualenvs/chatty/bin/uvicorn --app-dir /home//chattyapp/ --uds ${DOMAIN_SOCKET} chatty.app:app`
* Create your website, and ensure `` is replaced with your actual
username. Also ensure `` is replace with the command worked out in
the previous step: `pa website create --domain .pythonanywhere.com --command ''`
* If everything was a success you should see a message like this:
```
< All done! Your site is now live at .pythonanywhere.com. >
\
~<:>>>>>>>>>
```
* To see details of your website: `pa website get --domain .pythonanywhere.com`
* To restart/reload your website: `pa website reload --domain .pythonanywhere.com`
* To delete your website: `pa website delete --domain .pythonanywhere.com`
* If you encounter any problems, please check out the log files from the
"Files" page in your PythonAnywhere console.
That's it. 🚀