Skip to content

Conversation

@stevensJourney
Copy link
Collaborator

Overview

This repository currently relies on some internal packages for Micro service functionality. These packages are published under a restricted scope which cannot be fetched by external users. This prevents external users from building or running the service locally (without using the precompiled Docker Image).

This PR removes the dependency for the above packages. Allowing this repository to be used without any NPM credentials.

Changes

A minimal subset of the logic and definitions from the @journeyapps-platform/micro is now present in the @powersync/lib-services-framework library package. These definitions are used as a common interface for maintaining consistency with the service APIs between the open and hosted versions of the PowerSync service.

  • Logging

    • Winston is used as a shared logger throughout the codebase. Consumers of these packages can register different transports if required.
  • Migrations

    • The Migration store logic has been moved to the @powersync/service-core package.
  • Mongo Locks

    • This logic has been moved into @powersync/service-core
  • Pluggable Interfaces

    • Error reporting, health check probes and termination handling can be registered to a Container interface. Core logic will fetch the implementation from the Container and use the registered implementation.
      • Error Reporting: Defaults to a No-Op reporter. A Sentry reporter has been added to the service project and Docker Image.
      • Health probes: An improved version of the FileSystem probing logic has been implemented in the @powersync/lib-services-framework package. This addresses some of the previous KLUDGE comments. Users could register HTTP probes etc in future.
  • Routing

    • Route definitions use a familiar (modified) syntax for declaring endpoints. This is achieved by using common interfaces from @powersync/lib-services-framework. These definitions are strictly not coupled to a specific router implementation, but do provide some plugins for use in Fastify. A small helper function is provided for connecting these route definitions to a Fastify instance. Note that this Fastify router does not support tracing. Concurrent connections are limited via a registered hook.

Developing

Running this repository is now possible. Instructions for local development have been added.

Copy link
Contributor

@rkistner rkistner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't check the details of the routers & routes, but the overall structure looks good to me.

How will we trigger publishing now without the journey-micro tooling?

@stevensJourney
Copy link
Collaborator Author

I didn't check the details of the routers & routes, but the overall structure looks good to me.

How will we trigger publishing now without the journey-micro tooling?

Thanks! This repository has it's Docker Image published to DockerHub via a manual Github action. The hosted version in the other repository still uses the Journey Micro deploy tooling. The project there just imports and extends these packages.

Local development of the hosted service can use our linking tooling to link core packages from this repository. Staging deploys can use development packages which can be published here from a manual Github action.

@stevensJourney stevensJourney marked this pull request as ready for review June 24, 2024 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants