This is the backend (api) for an app I am making for a school programming assessment and to present at an open evening for our school.
The app is a chat app and will use web sockets to let users communicate in real time.
It will also use oauth2 authentication, hashing and end to end encryption to ensure the user data is stored securely and that the app is secure.
This api is written in python which is my main and favorite language whereas the frontend will be written in JS using Electron to make a desktop app.
Structure:
βββ src # all code for the api
βββ api # actual routes and endpoints
β βββ auth
β β βββ __init__.py
β β βββ authentication.py # authentication and authorization system code
β βββ routes # api rest / websocket routes
β βββ __init__.py
β βββ rooms # room endpoints (http/s and ws/s)
β β βββ chatroom_api.py
β β βββ chatroom_ws.py
β βββ user # user endpoints (http/s)
β βββ deleteuser.py
β βββ getuser.py
β βββ modify_user.py
β βββ reset_password_email.py
β βββ signup.py
βββ cert.pem # ssl certificate file for https
βββ core # this has utils, classes/models, database functions etc
β βββ database
β β βββ __init__.py
β β βββ context.py
β β βββ fetch.py
β β βββ tables.py
β βββ models
β β βββ __init__.py
β β βββ base_models.py
β β βββ chatapp.py
β β βββ room.py
β βββ utils
β βββ __init__.py
β βββ hash.py
βββ html # html files for pages like the demo page
β βββ demo.html
β βββ imagine_forgeting.html
βββ key.pem # ssl keyfile for https
βββ main.py # file to start the api and actually run it
βββ requirements.txt # package / library requirements