setup.md
December 17, 2024 ยท View on GitHub
Building and Running Locally
-
Clone the Repository:
git clone <repository-url> cd <repository-folder> -
Install Poetry and Docker: Install Poetry >= 1.7.1 Install Docker Install Docker Compose >= 2.22
-
Set Up with Make: Run:
make first-runThis generates the necessary configuration files and applies database migrations.
-
Manual Configuration: If you prefer:
- Create a
configuration.yamlfile based onconfiguration.template.yaml. - Replace the placeholders with your actual values.
- Create a
Environment Setup for Windows/MacOS
- Windows: Follow the detailed setup provided for PowerShell and conda environment.
- MacOS: Ensure you have Xcode, Homebrew, and follow the steps to create the virtual environment.
Environment Variables
Ensure your configuration.yaml and secrets.yaml file are properly generated and have valid values, especially for the following:
cohere_platform.api_key(in the secrets file): Your API key for Cohere.database.url(in the config file): Connection string for PostgreSQL.redis.url(in the config file): Connection string for Redis.
Local Database Setup
-
Migrate the Database: After setting up, run:
make migrate -
Resetting the Database: If needed, reset and migrate again:
make reset-db make migrate
Testing and Development
-
Install Development Dependencies:
make install -
Run Tests: Spin up the test DB and run tests:
make test-db make run-tests -
Database Model Changes: To make changes to the database models:
- Create a migration with:
make migration message="Your migration message" - Then migrate:
make migrate
- Create a migration with:
Additional Tips
- Linting and Formatting: Use
make lintandmake lint-fixfor maintaining code quality. - VSCode Setup: Install extensions for Ruff and set up your environment as per the provided recommendations.