Demo / Test Backend REST and WebSocket api for woice.me first voice messenger
Woice Backend is a demo project that implements basic REST and WebSocket API and includes Users and Chat module. It enables users to authenticate, create chat rooms, publish, edit and delete messages
To get a local copy up and running follow these simple steps.
This project heavily relies on Docker and (now built in) tool Docker Compose. It sets up a
python docker image with correct version and also a Postgres database. For Channels, this projet uses
in memory broker but should you require redis for production or any other reason, feel free to add that to
docker-compose.yml
.
This project features a couple of ready-made scripts to get you up and running quickly. Basically, scripts run bash / shell commands. Using .py scripts instead of .bat or .sh makes them non OS specific and if you have python installed, you can run them.
To start developing:
-
First scaffold docket containers by running:
python .\scripts\docker\up.py
on Windows,python ./scripts/docker/up.py
on MacOS or Linux,- or just run
docker compose up -d
.
-
Once the containers are up, 'ssh' into web container, so we can run server and migration scripts. I like to do this manually vs. specifying them in docker-compose, since by doing former gives me more control. To do this, run next script:
python .\scripts\docker\web_bash.py
on Windows,python ./scripts/docker/web_bash.py
on MacOS or Linux,- or just run
docker exec -it woice_web /bin/bash
.
-
Run migrations script by executing
python ./scripts/dev_full_migrate.py
in root in container. -
Run development server on port 8016 by executing
python ./scripts/dev_server.py
This project uses a Gitflow Workflow, so make sure you check it out. Always create a
feature branch and go from there. Never do any development on master.
After running the server, you can find API Docs under {{url}}/api/schema/swagger-ui/
and on Postman
Swagger docs (openapi) are available as a schema or schema UI when you start a development server under {{url}}/api/schema/swagger-ui/
.
Postman docs about REST Api (could be incomplete) and WebSocket are available at: https://documenter.getpostman.com/view/5623349/TzRa5NwK#a272c013-a70e-4481-af83-c055451b3528
View CHANGELOG.md for more details
log in/out (basic JWT token auth is more than ok)DONEcreate chat roomsDONE(optional) create private chat rooms with invitesDONE- (optional) add/revoke admin privileges for chat rooms
find other usersDONEnotify users that a user is typingDONEsend messages to users and chat roomsDONEedit and delete sent messagesDONE- (optional) send email notications for missed chats
Distributed under the MIT License
Miha Podplatnik - @mpodplatnik - miha.podplatnik@gmail.com
Project Link: https://github.com/podplatnikm/woice_backend_demo
Please make sure to update tests as appropriate.