https://github.com/messa/aiohttp-nextjs-demo-chat
Simple chat application using Python 3 asyncio with aiohttp, Next.js, Websocket and OAuth2 login
https://github.com/messa/aiohttp-nextjs-demo-chat
aiohttp-server asyncio demo-app example nextjs oauth2 python3 websockets
Last synced: 10 months ago
JSON representation
Simple chat application using Python 3 asyncio with aiohttp, Next.js, Websocket and OAuth2 login
- Host: GitHub
- URL: https://github.com/messa/aiohttp-nextjs-demo-chat
- Owner: messa
- Created: 2018-07-29T19:43:56.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-08-31T10:45:47.000Z (almost 8 years ago)
- Last Synced: 2025-04-13T17:44:22.918Z (about 1 year ago)
- Topics: aiohttp-server, asyncio, demo-app, example, nextjs, oauth2, python3, websockets
- Language: Python
- Homepage: https://20180721chat.now.sh/
- Size: 71.3 KB
- Stars: 9
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Chat demo web app created with aiohttp and next.js
==================================================
Requirements:
- Python 3.6
- aiohttp, requests_oauthlib etc. – Python dependencies managed by `setup.py`
- node.js, npm
See `Dockerfile` or `Makefile` how to run this example.
See also my [`aiohttp.web` tips](https://github.com/messa/tips/blob/master/Python%20-%20aiohttp%20server.md) :)
Architecture
------------
### Production
Build phase:
Next.js app Static files (prerendered)
~~~~~~~~~~~~~~~~ next export ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pages/*.js --------------> out/_next/…/page/*.js
components/*.js out/_next/static/commons/main-….js
util/*.js out/index.html
out/chat/index.html <-+
out/login/index.html | serve
| HTML & JS
| as static
| files
Deployed: request |
path | /*
User HTTPS, WSS nginx or other HTTP, WS aiohttp routing |
Web browser -------------> load balancer -----------> web app ----------+
| /api/*
| /auth/*
v
JSON API with
live data
### Development
Using `npm run dev` that runs `next` with HMR etc.
/api/*
/auth/*
+---------> aiohttp web app
Developer HTTP, WS nginx with proxy_pass |
Web browser -----------> dev configuration -------------+
(see nginx.conf) |
| /*
+--------> Next.js development server
Links
-----
Similar projects etc., not directly related to this repo
https://steelkiwi.com/blog/an-example-of-a-simple-chat-written-in-aiohttp/