Skip to content

Commit

Permalink
chore: rename backend to api
Browse files Browse the repository at this point in the history
  • Loading branch information
SverreNystad committed Nov 28, 2024
1 parent d11e94b commit 2a45f43
Show file tree
Hide file tree
Showing 43 changed files with 10 additions and 11 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ jobs:
id: git_sha
run: echo "GIT_SHA=$(git rev-parse --short $GITHUB_SHA)" >> $GITHUB_ENV

- name: Build and Push Docker Backend Image
- name: Build and Push Docker AI API Image
run: |
docker build -t ghcr.io/kartai/ntnu-kpro-ai-assistant-backend:${{ env.GIT_SHA }} ./backend
docker push ghcr.io/kartai/ntnu-kpro-ai-assistant-backend:${{ env.GIT_SHA }}
docker build -t ghcr.io/kartai/ntnu-kpro-ai-assistant-api:${{ env.GIT_SHA }} ./api
docker push ghcr.io/kartai/ntnu-kpro-ai-assistant-api:${{ env.GIT_SHA }}
- name: Build and Push Docker Webapp Image
run: |
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,17 +99,17 @@ Before you start, make sure the following tools are installed on your system:

## Setup

Start by going into the `/webapp` folder, making a copy of the `.env.example` file and renaming it to `.env`. This file contains the environment variables that the application needs to run. Open the `.env` file and update the environment variables according to your local or production setup.
Start by going into the `/webapp` and `/api` folder, making a copy of the `.env.example` file and renaming it to `.env`. This file contains the environment variables that the application needs to run. Open the `.env` file and update the environment variables according to your local or production setup.

## Usage

To run the project, you can use the following commands:

```bash
docker compose --env-file ./webapp/.env --env-file ./backend/.env up --build -d
docker compose --env-file ./webapp/.env --env-file ./api/.env up --build -d
```

This command will build the Docker images (if necessary) and run the containers in the background. You can access the clientside code at [http://localhost:3000](http://localhost:3000) and the API at [http://localhost:8000](http://localhost:8000).
This command will build the Docker images (if necessary) and run the containers in the background. You can access the client side code at [http://localhost:3000](http://localhost:3000) and the API at [http://localhost:8000](http://localhost:8000).
The Swagger documentation for the API is available at [http://localhost:8000/docs](http://localhost:8000/docs).

To stop the containers, you can use the following command:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ services:
api:
platform: "linux/amd64"
build:
context: ./backend
context: ./api
dockerfile: Dockerfile
ports:
- "8000:8000"
volumes:
- ./backend:/code
- ./api:/code
environment:
- AZURE_OPENAI_API_KEY=${AZURE_OPENAI_API_KEY}
- AZURE_OPENAI_API_BASE=${AZURE_OPENAI_API_BASE}
Expand Down
5 changes: 2 additions & 3 deletions scripts/pre-commit.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#!/bin/sh
# Run linter on staged JavaScript, TypeScript files
cd webapp
npm run lint --fix

cd backend

cd api
black .

# mypy
Expand Down

0 comments on commit 2a45f43

Please sign in to comment.