Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/use envs for endpoint #40

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.6.4
current_version = 0.7.0
commit = True
tag = True

Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v22.9.0
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ RUN --mount=type=cache,target=/root/.cache/uv \
# Then, use a final image without uv
FROM python:3.12-slim-bookworm

# Install system dependencies, including libexpat1 and clean up the cache
RUN apt-get update && apt-get install -y --no-install-recommends \
libexpat1 \
Copy link
Owner

Choose a reason for hiding this comment

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

While we are at it can you please add the libsndfile1 library?

  • Also, can you please add this lines in the back/Dockerfile too?

This other Dockerfile is for dev development but also needs these dependencies.

&& rm -rf /var/lib/apt/lists/*

# Copy the application from the builder
COPY --from=builder --chown=app:app /app /app

Expand Down
2 changes: 1 addition & 1 deletion back/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "Whombat"
version = "0.6.4"
version = "0.7.0"
description = "Audio Annotation Tool"
authors = [{ name = "Santiago Martinez", email = "santiago.mbal@gmail.com" }]
dependencies = [
Expand Down
2 changes: 1 addition & 1 deletion back/src/whombat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

__author__ = """Santiago Martinez Balvanera"""
__email__ = "santiago.balvanera.20@ucl.ac.uk"
__version__ = "0.6.4"
__version__ = "0.7.0"
1 change: 1 addition & 0 deletions front/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NEXT_PUBLIC_BACKEND_HOST=http://localhost:5000
4 changes: 2 additions & 2 deletions front/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion front/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "whombat-front",
"version": "0.6.4",
"version": "0.7.0",
"private": true,
"scripts": {
"dev": "next dev",
Expand Down
2 changes: 1 addition & 1 deletion front/src/app/api.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import createAPI from "@/lib/api";

const api = createAPI({
Copy link
Owner

Choose a reason for hiding this comment

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

  • Can you please add something like the following:
const baseURL =
  process.env.NODE_ENV === "development"
    ? process.env.NEXT_PUBLIC_BACKEND_HOST || ""
    : "";

This way the environment variable is used in development (when the backend and frontend are separated) but not in production (when the backend serves the frontend in the same domain).

baseURL: "http://localhost:5000",
baseURL: `${process.env.NEXT_PUBLIC_BACKEND_HOST}`,
withCredentials: true,
});

Expand Down
2 changes: 1 addition & 1 deletion front/src/lib/api/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { z } from "zod";

import { GetManySchema } from "@/lib/schemas";

export const HOST = "http://localhost:5000";
export const HOST = `${process.env.NEXT_PUBLIC_BACKEND_HOST}`;
export const BASE_ROUTE = `/api/v1`;

export const instance = axios.create({
Expand Down
2 changes: 1 addition & 1 deletion front/src/lib/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type APIConfig = {
};

const DEFAULT_CONFIG: APIConfig = {
baseURL: "http://localhost:5000",
baseURL: `${process.env.NEXT_PUBLIC_BACKEND_HOST}`,
withCredentials: true,
};

Expand Down