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

Cleanup #7

Open
wants to merge 10 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
51 changes: 0 additions & 51 deletions .github/workflows/deploy.yml

This file was deleted.

4 changes: 0 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,15 @@ FROM node:18 as build-deps

EXPOSE 3000

# ENV DIRPATH /opt/app
ENV NODE_ENV production

WORKDIR /opt/app

COPY . .
RUN npm clean-install --include=dev

COPY ./fix-popper.sh .
RUN sed -i '/2\.11\.6/a \ \ "type": "module",' node_modules/@popperjs/core/package.json

RUN npm run build

RUN cp build/404.html build/index.html

CMD ["sh", "-c", "npm run build && cp build/404.html build/index.html && npm run start"]
78 changes: 53 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,52 +1,80 @@
# create-svelte
# SHL Sharing for Let's Talk Tech

Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte).
## Setup

## Creating a project

If you're seeing this, you've probably already done this step. Congrats!
Install the project libraries

```bash
# create a new project in the current directory
npm create svelte@latest

# create a new project in my-app
npm create svelte@latest my-app
npm install
```
(or `pnpm install` or `yarn`)

## Developing
### Environment

Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
Copy the `.env` file default:

```bash
npm run dev
cp default.env .env
```

# or start the server and open the app in a new browser tab
npm run dev -- --open
Modify any `.env` files as necessary. Non-comment variables are required, commented lines are optional.

## Docker

Starting the docker container

```bash
docker-compose build && docker-compose up --detach
```

## Building
### Docker development

To create a production version of your app:
Update the `.env` file to use the development compose file

```bash
npm run build
COMPOSE_FILE=docker-compose.yaml:docker-compose.dev.yaml
```
(On windows, separate compose files with `;` instead of `:`.)

You can preview the production build with `npm run preview`.
The docker image will reflect any local changes to the `/lib` and `/static` folders.

> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.
## Local Development

## Docker
Start a local development server with

```bash
npm run dev

Environment
# or start the server and open the app in a new browser tab
npm run dev -- --open
```

### Debugging
To debug in VS Code, create a launch.json file with the following configuration:
```bash
cp default.env .env
{
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}"
}
]
}
```
With the development server running, start the debugger.

Starting the docker container
## Building

To build a production version:

```bash
docker-compose build && docker-compose up --detach
npm run build
```

You can also preview the production build with `npm run preview`.

> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.
33 changes: 23 additions & 10 deletions default.env
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,35 @@ COMPOSE_PROJECT_NAME=
# COMPOSE_FILE=docker-compose.yaml:docker-compose.traefik-ingress.yaml

# Enable to use static ingress overrides
COMPOSE_FILE=docker-compose.yaml:docker-compose.static-ingress.yaml
# COMPOSE_FILE=docker-compose.yaml:docker-compose.static-ingress.yaml

# Fully qualified domain name; used to configure ingress
# SERVER_NAME=foo.cirg.uw.edu

# Enable to use development overrides
# Enable to use docker development image
# COMPOSE_FILE=docker-compose.yaml:docker-compose.dev.yaml

VITE_EPIC_CLIENT_ID=
VITE_CERNER_CLIENT_ID=
# Fully qualified domain name; used to configure ingress
# SERVER_NAME=foo.cirg.uw.edu

# SHL Server API endpoint url
VITE_API_BASE=

# SHL Viewer url
VITE_VIEWER_BASE=
# VITE_VIEWER_BASE=

# Value of identifier.system needed to query Patients based on KC id
VITE_FHIR_R4_EXTERNAL_ID_SYSTEM=

# SOF client configuration
VITE_SOF_CLIENT_ID=
VITE_SOF_ISS=

# Url for the back button
VITE_BACK_URL=

# OIDC session management endpoints
VITE_OIDC_SERVER_BASE=
VITE_OIDC_CHECK_SESSION_IFRAME=
VITE_OIDC_LOGOUT_ENDPOINT=
VITE_POST_LOGOUT_REDIRECT_URI=

# FHIR Server endpoint url
VITE_INTERMEDIATE_FHIR_SERVER_BASE=
# VITE_INACTIVITY_TIMEOUT=04:00:00
# VITE_BACKUP_INACTIVITY_TIMEOUT=00:15:00
38 changes: 0 additions & 38 deletions docker-entrypoint.sh

This file was deleted.

7 changes: 3 additions & 4 deletions src/lib/AddFileLTT.svelte → src/lib/AddFile.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import {
Alert
} from 'sveltestrap';
import FetchSoFLTT from './FetchSoFLTT.svelte';
import FetchSoF from './FetchSoF.svelte';
import type { Writable } from 'svelte/store';
import type { SHLAdminParams, SHLClient } from '$lib/managementClient';
import type { SOFClient } from './sofClient';
Expand All @@ -22,8 +22,7 @@
let sofClient: SOFClient = getContext('sofClient');

const shlReadyDispatch = createEventDispatcher<{ 'shl-ready': boolean }>();
const shlDispatch = createEventDispatcher<{ 'shl-submitted': SHLSubmitEvent }>();
let submitting = false;

let fetchError = "";
let createSHL = false;
let updatedShl = false;
Expand Down Expand Up @@ -306,7 +305,7 @@
/>

<!-- Retrieves SOF resources on mount -->
<FetchSoFLTT
<FetchSoF
on:updateResources={ async ({ detail }) => { handleNewResources(detail) } }
/>

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/lib/HealthLinkLTT.svelte → src/lib/HealthLink.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import QRCode from 'qrcode';
import { getContext, setContext } from 'svelte';
import { getContext } from 'svelte';
import {
Accordion,
AccordionItem,
Expand Down
1 change: 0 additions & 1 deletion src/lib/SessionStatus.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
// Listen for messages from OP iframe
window.addEventListener('message', processStatus);
// Check session on load
// checkSessionStatus();
let iframe = document.getElementById('opIframe');
iframe?.addEventListener('load', () => {
// Poll the iframe on load
Expand Down
Loading