Code Monkey home page Code Monkey logo

aiohttp-nextjs-demo-chat's Introduction

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 :)

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/

aiohttp-nextjs-demo-chat's People

Contributors

messa avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.