diff --git a/docs/nix_dev_env.md b/docs/nix_dev_env.md --- a/docs/nix_dev_env.md +++ b/docs/nix_dev_env.md @@ -72,7 +72,7 @@ ## Workflow specific prerequisites -On macOS, [installing Xcode](./nix_mobile_setup.md#xcode) is a prerequisite for all workflows. +On macOS, [installing Xcode](#xcode) is a prerequisite for all workflows. - [Web prerequisites](./nix_web_setup.md#nix-web-requisities) - [React Dev Tools Chrome extension](./nix_web_setup.md#react-dev-tools-chrome-extension) @@ -87,6 +87,10 @@ - [Android emulator](./nix_mobile_setup.md#android-emulator) - [Debugging tools](./nix_mobile_setup.md#debugging-tools) - [Reactotron](./nix_mobile_setup.md#reactotron) +- [Services prerequisites](./nix_services_setup.md#nix-services-prerequisites) + - [Docker](./nix_services_setup.md#docker) + - [LocalStack](./nix_services_setup.md#localstack) + - [Configuring the AWS CLI](./nix_services_setup.md#configuring-the-aws-cli) # Development environment @@ -107,6 +111,10 @@ - [Running mobile app on iOS Simulator](./nix_mobile_workflows.md#running-mobile-app-on-ios-simulator) - [Running mobile app on Android Emulator](./nix_mobile_workflows.md#running-mobile-app-on-android-emulator) - [Running mobile app on physical iOS devices](./nix_mobile_workflows.md#running-mobile-app-on-physical-ios-devices) +- [Services workflows](./nix_services_workflows.md#services-workflows) + - [Running the Identity service](./nix_services_workflows.md#running-the-identity-service) + - [Debugging](./nix_services_workflows.md#debugging) + - [AWS CLI](./nix_services_workflows.md#aws-cli) - [Shared workflows](./nix_shared_workflows.md#shared-workflows) - [Inspect database with TablePlus](./nix_shared_workflows.md#inspect-database-with-tableplus) - [Codegen](./nix_shared_workflows.md#codegen) diff --git a/docs/nix_services_setup.md b/docs/nix_services_setup.md new file mode 100644 --- /dev/null +++ b/docs/nix_services_setup.md @@ -0,0 +1,37 @@ +# Nix services prerequisites + +## Docker + +To build and run the services you need to install [Docker](https://docs.docker.com/desktop/) and [Docker Compose](https://docs.docker.com/compose/install) on your system. + +## LocalStack + +We use LocalStack to emulate AWS services, allowing us to develop and test our services locally. To start LocalStack, run: + +``` +comm-dev services start +``` + +Make sure your LocalStack resources are up to date: + +``` +cd services/terraform +./run.sh +``` + +## Configuring the AWS CLI + +To interact with the emulated AWS services on your local machine, you’ll need to configure the AWS CLI. + +From your terminal, run: + +``` +aws configure +``` + +You will be prompted to enter the following information: + +- AWS Access Key ID: Enter `test` as the Access Key ID. +- AWS Secret Access Key: Enter `test` as the Secret Access Key. +- Default region name: Enter `us-east-2`. +- Default output format: Press Enter to use the default output format or enter your preferred format (e.g., `json`, `text`, or `yaml`). diff --git a/docs/nix_services_workflows.md b/docs/nix_services_workflows.md new file mode 100644 --- /dev/null +++ b/docs/nix_services_workflows.md @@ -0,0 +1,40 @@ +# Services workflows + +## Running the Identity service + +Generate the server keypair used by the `opaque-ke` crate for registration and login. You only need to do this once. + +``` +cd services/identity +cargo run keygen +``` + +You’re now ready to run the Identity service: + +``` +cargo run server +``` + +## Debugging + +### AWS CLI + +You can use the AWS CLI to inspect tables in your LocalStack DynamoDB instance. + +To describe the table structure: + +``` +aws dynamodb describe-table --table-name your-table --endpoint-url http://localhost:4566 +``` + +Replace `your-table` with the name of the table you would like to inspect. + +To query the table and list all the items: + +``` +aws dynamodb scan --table-name your-table --endpoint-url http://localhost:4566 +``` + +Again, replace `your-table` with the name of the name of the table you would like to inspect. + +These commands will give you an overview of your table’s structure and contents in LocalStack DynamoDB.