This repo contains a service that, upon request, synchronizes Hubspot Contacts and Stripe Customers to the PostgreSQL database for all user accounts stored in that database. For convenience, the database is initialized with a couple of dummy Hubspot and Stripe accounts that have some contacts and customers in them.
The service also exposes an API to browse user accounts and search through their data, like Hubspot Contacts and Stripe Customers.
Docker and Node.js are required.
- Download the repo.
cd
to the root directory.- Run
docker compose up -d --build
to build the app Docker image and spin up the postgres and app services. - Run
npm install
. We need this becausets-node
is required to run the 6th step. - Run
npx prisma migrate deploy
to roll out the db schema. - Run
npx prisma db seed
to seed the database with initial data like user accounts and access tokens. - The engine service is ready!
Send a post request to this URL: http://localhost:8080/engine/sync
. It should return {"ok":true}
JSON response. It means it successfully synchronized all data available in Hubspot and Stripe for all user accounts stored in the database.
CURL example: curl -X POST http://localhost:8080/engine/sync
The app uses Node.js, TypeScript, Express, Prisma, and Zod. In addition, it's built adhering to the Clean Architecture pattern.
Since this project is a prototype, it's not production ready, and there are many "Improvement" comments scattered across the codebase. It would make sense to implement them in a more mature setup.