Research Platform

This project is put together with turborepo and git modules.

Object storage module : https://github.com/Mahmoud-nfz/object-storage-solution

Turborepo Apps:

  • Frontend: Next.js 14
  • Backend: Nest.js

Each package/app is 100% TypeScript.

Technologies

This repository makes use of these technologies in order to run:

How do I run this?

Make sure you have Docker and Git installed. First, clone the repo and run the following command:

# (Optional)
# HTTPS is set as default way to fetch repositories.
# For SSH Users, you should run:
git config submodule.apps/object-storage-solution.url git@github.com:Mahmoud-nfz/object-storage-solution.git
git submodule sync

# if running for the first time:
git submodule update --init --recursive
# else:
git submodule update --remote --merge

Then, choose one of the following options:

Locally, using docker compose (recommended)

docker compose up

You can access the platform at http://localhost:3010/login.

When finished, clean up with this command:

docker compose down

Locally, using k8s

Make sure you have Minikube installed.

# Make sure to add metrics api support
minikube addons enable metrics-server

# Make sure to add DNS and ingress (ngnix)
minikube addons enable ingress

# Make sure that the cluster supports `managed-csi` interface for PVs
minikube addons enable volumesnapshots
minikube addons enable csi-hostpath-driver

# Create a namespace for the services
kubectl apply -f manifests/overlays/local/namespace.yaml

# (Optional)
# If you want to build the images and push them to your own docker registry,
# make sure that you override the container registry in `manifests/base/kustomization.yaml`
# and to create credentials for the k8s cluster to connect to:
kubectl create secret docker-registry efreireg \
    --namespace=efrei-dev-local
    --docker-server=<server_name> \
    --docker-username=<username> \
    --docker-password=<pwd>

kubectl apply -k manifests/overlays/local

# It may take a while for the platform to be up and running,
# you may run this to monitor the state of the cluster.
minikube dashboard

# Once all deployments are green in `efrei-dev-local` namespace, do `Ctrl + C` and run the following command:
minikube service -n efrei-dev-local frontend
# This will open up the frontend in your browser,
# navigate to `/login` to login.

When finished, clean up with this command:

minikube delete

Turborepo

Build

To build all apps and packages, run the following command:

pnpm build

Develop

To develop all apps and packages, run the following command:

pnpm dev

Remote Caching

Turborepo can use a technique known as Remote Caching to share cache artifacts across machines, enabling you to share build caches with your team and CI/CD pipelines.

By default, Turborepo will cache locally. To enable Remote Caching you will need an account with Vercel. If you don't have an account you can create one, then enter the following commands:

npx turbo login

This will authenticate the Turborepo CLI with your Vercel account.

Next, you can link your Turborepo to your Remote Cache by running the following command from the root of your Turborepo:

npx turbo link