Skip to content

Backend for the Snappio, a social media / chat application built with flutter (frontend) and django rest framework (backend).

License

Notifications You must be signed in to change notification settings

Snappio/snappio_backend

Repository files navigation

Snappio Backend | DEMO

Backend for the Snappio, a social media / chat application built with flutter (frontend) and django rest framework (backend).

Features include:

  • Realtime chatting with web-sockets (django channels)
  • JWT Authentication with strict user permissions
  • Post images with captions, to be shown on user feeds
  • Event-planning and communities [WIP]

While most of the features are already up and running, this project is under development and new features would be added.

Demo

The api is hosted on Render.

To see the api in action, click here to open the hosted instance.

NOTE: Since the web service is hosted on free tier, it can take upto a minute for the first request to be fulfilled.

API Reference

For full API documentation, refer to swagger docs.

Few of the available apis are listed below:

Get all users

  GET /api/v1/users/

Get user details

  GET /api/v1/users/profile/
Authorization Type Description
token Bearer Token Required. Access token for logged in user

Get post details

  GET /api/v1/posts?username=${username}
Parameter Type Description
username string Required. Posts of user to fetch

Connect with WebSocket

  • User Chat:
  WS /ws/user/${username}/
  • Room Chat:
  WS /ws/rooms/${roomid}/
Parameter Type Description
username string Required. Valid username of existing user to chat with
roomid string Required. ID of room for more than 2 users to join

Deployment

This project uses poetry for python package management and docker for abstracting the deployment process.

For docker compose V2:

  docker compose up -d

This will start the container and the server will listen for requests on default http PORT 80.

Environment Variables

To run this project, you will need to add the following environment variables to your .env file, also stated in the .env.example file in the repository.

DJANGO_SECRET for django's cryptographic signing.

POSTGRES_URL url for the connected POSTGRESQL database.

REDIS_URL url for the connected REDIS instance used for websocket protocol.

About

Backend for the Snappio, a social media / chat application built with flutter (frontend) and django rest framework (backend).

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published