Skip to content

gotech-io/api-device-sync-test

Repository files navigation

YouCC Test API

The Stack

Install NVM

This project uses nvm to manage node versions.

Mac / Linux:

https://github.com/nvm-sh/nvm?tab=readme-ov-file#installing-and-updating

Windows:

https://github.com/coreybutler/nvm-windows

Getting Started

First activate the node version via nvm

# Install node version specified in .nvmrc file
$ nvm install

# Use the version in the current terminal
$ nvm use

We will use pnpm as a package manager (instead of npm)

# Install pnpm
$ npm install -g pnpm

# Install all dependencies
$ pnpm i

Docker Compose

Via docker compose we have postgres db and pgAdmin here:

http://localhost:8888
username: [email protected]
password: Aa123456

Start the docker compose

$ docker compose up -d

Running the services

# Run the API
$ pnpm dev:api

# Run the data synchronizer
$ pnpm dev:synchronizer

in vscode, you have settings for a debugger of both

Swagger

http://127.0.0.1:8000/docs

Working with Drizzle ORM

All existing DB migrations run on API startup, no need to run it manually

# Generate a new migration
$ pnpm db:generate

# Run existing migrations
$ pnpm db:migrate

# Starts a studio to view and edit data
$ pnpm db:studio

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published