Skip to content

podplatnikm/woice_backend_demo

Repository files navigation

Stargazers LinkedIn


Woice Backend Demo

Demo / Test Backend REST and WebSocket api for woice.me first voice messenger

Table of Contents

  1. About The Project
  2. Getting Started
  3. Usage
  4. Docs
  5. Changelog
  6. Todo
  7. License
  8. Contact
  9. Contributing

About The Project

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

Built With

Getting Started

To get a local copy up and running follow these simple steps.

Prerequisites

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.

Local Development

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:

  1. 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.
  2. 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.
  3. Run migrations script by executing python ./scripts/dev_full_migrate.py in root in container.

  4. Run development server on port 8016 by executing python ./scripts/dev_server.py

Usage

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

Docs

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

Changelog

View CHANGELOG.md for more details

Todo

  • log in/out (basic JWT token auth is more than ok) DONE
  • create chat rooms DONE
  • (optional) create private chat rooms with invites DONE
  • (optional) add/revoke admin privileges for chat rooms
  • find other users DONE
  • notify users that a user is typing DONE
  • send messages to users and chat rooms DONE
  • edit and delete sent messages DONE
  • (optional) send email notications for missed chats

License

Distributed under the MIT License

Contact

Miha Podplatnik - @mpodplatnik - miha.podplatnik@gmail.com

Project Link: https://github.com/podplatnikm/woice_backend_demo

Contributing

Please make sure to update tests as appropriate.

About

Demo backend REST and WebSocket Api for project woice

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published