Skip to content

Latest commit

 

History

History
91 lines (57 loc) · 3.11 KB

File metadata and controls

91 lines (57 loc) · 3.11 KB

Real-Time-Chat-Application-Python


Server

Install Python and setup the virtual environment

Install ariadne and uvicorn libraries

pip install ariadne "uvicorn[standard]"

To activate the virtual environment, type the following command in the terminal.

.\real-time\Scripts\Activate.ps1

If you want to leave the virtual environment, type deactivate


Client

If yarn package is not yet installed, refer the this link to install it.

Create new package:

yarn init -y 

Apollo Client:

yarn add @apollo/client graphql 

Chakra UI:

yarn add @chakra-ui/react @emotion/react@^11 @emotion/styled@^11 framer-motion@^5 

WebSocket:

yarn add subscriptions-transport-ws 

Shrads React:

yarn add shards-react 

Guide

Enter to the server folder and activate the virtual environment if you haven't.

.\real-time\Scripts\Activate.ps1

run the server

uvicorn app:app

While the server running, create another terminal and enter to the client folder and start the React app

yarn start 

References


https://www.twilio.com/blog/graphql-api-subscriptions-python-asyncio-ariadne

https://www.apollographql.com/blog/graphql/python/complete-api-guide

https://ariadnegraphql.org/docs/intro#completed-code

https://github.com/mirumee/ariadne