Skip to content

A simple backend service for the Ark POC frontend project.

Notifications You must be signed in to change notification settings

thaboRach/ark-poc-api

Repository files navigation

ARK POC API

About the project

A simple backend service for the Ark POC frontend project.

Built with

  • Typescript
  • Express
  • Prisma

Prerequisites

  • Node and NPM
  • Yarn
  • Docker & Kubernetes

Getting started

To get a local copy up and running follow these simple example steps.

  • Clone the repository

     git clone https://github.com/thaboRach/ark-poc-api.git
  • Ensure you create a .env file with the following environment variables

     POSTGRES_USER=arkpoc
     POSTGRES_PASSWORD=supersecret
     POSTGRES_DB=arkpoc
     DATABASE_URL=postgres://arkpoc:supersecret@localhost:5432/arkpoc
     NODE_ENV=development

Docker (optional but recommended)

  1. Start the container

       docker compose up

Without Docker

Ensure you have postgresql installed on your machine.

Yarn

   npm install --global yarn
  1. Install the required packages

       yarn
  2. Run the database migrations (This will allow the database to sync with the schema)

       npx prisma migrate dev

Usage

Start the server locally:

   yarn dev

Local Kubernetes cluster

Ensure you have installed Kind on your machine.

  1. Create the cluster:

       kind create cluster --config=./k8s/config.yaml
  2. Use the cluster:

       kubectl cluster-info --context kind-ark-poc-cluster
  3. Apply the deployment configuration:

       kubectl apply -f ./k8s/deployment.yaml
  4. Check that the namespace has been created:

        kubectl get namespaces
  5. Set the namespace as the active

       kubectl config set-context --current --namespace=ark-app-ns
  6. Show the contexts:

       kubectl config get-contexts
  7. Check the status of your pods:

       kubectl get pods
  • To stop and delete the cluster

        kind delete cluster --name ark-poc-cluster

About

A simple backend service for the Ark POC frontend project.

Topics

Resources

Stars

Watchers

Forks