Skip to content

🫧 Building the most accurate and reliable personality test

License

Notifications You must be signed in to change notification settings

modelmind/modelmind

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Building the most accurate and reliable personality test.

- Find your path -


MIT License

Project Setup and Management

This project is managed using a Makefile. The Makefile simplifies the setup and management of various tasks, including installing dependencies, linting, testing, and more.

Initial Setup

To set up the project for the first time, you need to perform some initial steps:

  1. Install Poetry: Poetry is used for dependency management. You can install it by following the instructions at https://python-poetry.org/docs/#installation.

  2. Install Google Cloud CLI: This project uses Google Cloud services (such as Firestore), so you need to install the Google Cloud CLI. Instructions can be found here.

  3. Install Make: Make sure make is installed on your system. On most Unix-based systems, it should be available by default. For Windows, you can use tools like choco or scoop to install make.

  4. Environment Variables: Create a .env file in the root directory and add the necessary environment variables. An example .env file:

    JWT__SECRET_KEY="secret"
    FIRESTORE__DATABASE="eu-dev"

Using the Makefile

Once the initial setup is complete, you can use the Makefile to manage the project.

Install Dependencies

To install all necessary dependencies and set up pre-commit hooks, run:

make install

Pre-commit Hooks

Pre-commit hooks are used to check your code before committing. By default, the following tools are configured:

  • black: Formats your code.
  • mypy: Validates types.
  • isort: Sorts imports in all files.
  • flake8: Spots possible bugs.

To install the pre-commit hooks, use the make install command as mentioned above.

Linting and Formatting

To lint and format your code, run:

make lint
make format

Running Tests

To run tests and generate a coverage report, use:

make test

Watching for Changes

To run tests automatically on every change, run:

make watch

Updating Dependencies

To update poetry dependencies and export them to requirements.txt, run:

make poetry-update

Simple export without updating dependencies:

make poetry-export

Project Structure

$ tree "persony_admin"
.
β”œβ”€β”€ bigquery
β”‚   └── schema_views               # Configuration and views for BigQuery data analysis
β”œβ”€β”€ functions
β”‚   └── src                        # Source code for serverless functions
β”œβ”€β”€ modelmind
β”‚   β”œβ”€β”€ _mocker                    # Utilities for mocking data and functionalities in tests
β”‚   β”œβ”€β”€ api                        # API endpoints, presentation, permissions, dependencies
β”‚   β”œβ”€β”€ clients                    # Integrations with third-party APIs
β”‚   β”œβ”€β”€ community                  # Domain knowledge external to core questionnaires
β”‚   β”‚   β”œβ”€β”€ engines
β”‚   β”‚   β”‚   └── persony            # Custom engine using community-based knowledge
β”‚   β”‚   └── theory
β”‚   β”‚       β”œβ”€β”€ jung               # Jungian personality theory implementation
β”‚   β”‚       └── mbti               # MBTI personality theory implementation
β”‚   β”œβ”€β”€ db                         # Persistence layer and database interactions
β”‚   β”œβ”€β”€ models                     # Core business logic and data manipulation
β”‚   β”‚   β”œβ”€β”€ analytics              # Calculations based on questionnaire results
β”‚   β”‚   β”œβ”€β”€ engines                # Logic for selecting questions from a questionnaire
β”‚   β”‚   β”œβ”€β”€ questionnaires         # (Main) Core questionnaire models
β”‚   β”‚   β”œβ”€β”€ questions              # Questions models that belong to a questionnaire
β”‚   β”‚   └── results                # Management of results from questionnaires
β”‚   β”œβ”€β”€ services                   # Auxiliary services, including event notification
β”‚   β”‚   └── event_notifier         # Service to handle event notifications within the system
β”‚   └── utils                      # Utility functions and helpers
β”œβ”€β”€ terraform                      # Infrastructure as code configurations
└── tests
    β”œβ”€β”€ endpoints                  # Tests for API endpoints
    └── models                     # Tests for core business logic and models

Infrastructure

This project uses Terraform for managing infrastructure as code on Google Cloud. We also use a Cloud Build trigger (deploy_cloud_run_prod.yml) for CI/CD to deploy our application to Google Cloud Run.

Additional Resources

  • Poetry: Read more about Poetry here.
  • Pre-commit: Learn more about pre-commit here.
  • Pydantic BaseSettings: Read more about the BaseSettings class here.

About

🫧 Building the most accurate and reliable personality test

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published