Juno is Bits of Good's central infrastructure API, integrating several in-house services to simplify and streamline project development.
The project is a monorepo using a combination of NestJS, gRPC, Protobuf, Prisma, and Postgres for API endpoints, interservice communication, and object storage/modeling.
Packages are managed through Yarn Workspaces. The current packages are as follows:
As this repository contains multiple packages, Docker is used to spin up all microservices in order with their respective dependencies. For more details regarding the docker process and its internal networking mechanism, take a look at the docker-compose.yml
file.
Most of the docker-related functionality has been abstracted away into yarn commands.
All package dependencies must first be installed by using the following command in the root directory:
yarn
For spinning up the entire stack (not watching for changes):
yarn start:dev
For spinning up the stack and automatically updating as changes are made to files:
yarn start:dev:live-all
Requests can be made at the endpoint localhost:3000/some/request/path
.
Juno currently has support for E2E tests via Jest.
(In root directory)
yarn test:e2e:api-gateway
yarn test:e2e:auth-service
yarn test:e2e:db-service
If you're working on juno and wish to test with your updates in live time (watched tests), run the prior command suffixed with -live
. This looks like the following for each service:
yarn test:e2e:api-gateway-live
yarn test:e2e:auth-service-live
yarn test:e2e:db-service-live
protoc
must be installed..sh
related problems - switch line endings to LF
additional property <> is not allowed>
- update docker
db-service is unhealthy
- wget script likely failed to install, make sure all .sh
files have correct line endings and permissions (chmod)
./get_grpc_probe.sh: Permission denied
- add permission to get_grpc_probe using chmod:
chmod +x docker/get_grpc_probe.sh
chmod +x packages/db-service/entrypoint.sh