Skip to content

Project Structure

├── actions
│   ├── account.py
│   ├── authentication.py
│   ├── group.py
│   ├── members.py
│   ├── permissions.py
│   ├── policy.py
│   ├── poll.py
│   ├── superuser.py
│   └── workspace.py
├── exceptions
│   ├── account.py
│   ├── authentication.py
│   ├── group.py
│   ├── policy.py
│   ├── poll.py
│   ├── resource.py
│   └── workspace.py
├── routes
│   ├── account.py
│   ├── authentication.py
│   ├── group.py
│   ├── poll.py
│   ├── websocket.py
│   └── workspace.py
├── schemas
│   ├── account.py
│   ├── authentication.py
│   ├── group.py
│   ├── member.py
│   ├── policy.py
│   ├── poll.py
│   ├── question.py
│   └── workspace.py
├── utils
│   ├── auth_strategy.py
│   ├── auth_transport.py
│   ├── cli_args.py
│   ├── colored_dbg.py
│   ├── permissions.py
│   └── token_db.py
├── account_manager.py
├── app.py
├── config.py
├── dependencies.py
├── documents.py
├── mongo_db.py
├── __version__.py
└── websocket_manager.py

Main files

app.py - Contains the main app. The app is responsible for starting the server and loading the configuration.

config.py - Contains the configuration class. The configuration class is used to load the configuration from the environment variables.

dependencies.py - Contains the dependencies class. The dependencies class is used to load the dependencies.

documents.py - Contains the document classes. The document classes are used to define the structure of the documents in the database.

mongo_db.py - Contains the database class. The database class is used to connect to the database and perform operations on the database.

__version__.py - Contains the version of the API. The version is used to identify the API, in case the project metadata is not available.

websocket_manager.py - Contains the websocket manager class. The websocket manager class is used to manage the websocket connections.

Actions

This directory contains all the actions that can be performed on the resources. Each action is a function that takes a request and returns a response. The actions are called from the routes.

Exceptions

This directory contains all the exceptions that can be raised by the actions. Each exception is a class that inherits from the base exception class. The exceptions are raised by the actions and handled by the routes.

Routes

This directory contains all the HTTP routes. Each route is a function that takes a HTTP request and returns a response. The routes are called from the main app.

Schemas

This directory contains all the schemas that are used to validate the request body and response body. Each schema is a class that inherits from the base schema class. The schemas are used by the actions.

Utils

This directory contains all the utility functions and classes. The functions and classes are used by the actions and routes.

auth_strategy.py - Contains the authentication strategy class. The strategy class is used by the authentication action to authenticate the user.

auth_transport.py - Contains the authentication transport class. The transport class is used by the authentication action to send the authentication request to the authentication server.

cli_args.py - Contains the command line arguments parser class. The parser class is used by the main app to parse the command line arguments.

colored_dbg.py - Contains the colored debug class. The debug class is used by the main app to print colored debug messages.

permissions.py - Contains the permissions class. The permissions class is used by the actions to check if the user has the required permissions. It contains definitions of all the permissions as well as functionality to check if the user has the required permissions.

token_db.py - Contains the token database class. The token database class is used by the authentication action to store the access tokens and refresh tokens.