Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
bb03b8b
:hammer: Update dev command with newer variant.
klondikemarlen May 27, 2025
381ac9d
:mute: Remove docker compose version to silence deprecation warning.
klondikemarlen May 27, 2025
3a1cd90
:pencil: Update readme setup instructions.
klondikemarlen May 27, 2025
c55d211
:pencil: Update readme with newer docker compose commands.
klondikemarlen May 27, 2025
f347859
:bug: Ensure that the Burial schema is created if it doesn't exist be…
klondikemarlen May 27, 2025
1f65667
:bug: Ensure that the Security schema is created if it doesn't exist …
klondikemarlen May 27, 2025
c8ed0f6
:bug: Ensure that the AirCrash schema is created if it doesn't exist …
klondikemarlen May 27, 2025
171d49e
:bug: Ensure that the Boat schema is created if it doesn't exist befo…
klondikemarlen May 27, 2025
32cb45d
:bug: Ensure that the InterpretiveSite schema is created if it doesn'…
klondikemarlen May 27, 2025
c8d33c3
:bug: Ensure that the Person schema is created if it doesn't exist be…
klondikemarlen May 27, 2025
e863c78
:bug: Ensure that the Place schema is created if it doesn't exist bef…
klondikemarlen May 27, 2025
3fada88
:bug: Ensure that the YHIS schema is created if it doesn't exist befo…
klondikemarlen May 27, 2025
d8b079e
:bug: Add create_date to User creation service.
klondikemarlen May 27, 2025
952440d
:pencil: Update readme to include new development setup instructions.
klondikemarlen May 27, 2025
8e212d1
:hammer: Update github issue, bug report and pull request templates t…
klondikemarlen May 27, 2025
f723c65
:heavy_plus_sign: Add better prettier plugins for embeded sql pretifi…
klondikemarlen May 27, 2025
e41f8a4
:loud_sound: Add eslint config and update prettier config.
klondikemarlen May 27, 2025
e0af859
:bug: Unignore package-lock.json files.
klondikemarlen May 27, 2025
0db6454
:heavy_plus_sign: Add tsconfig paths helper package.
klondikemarlen May 27, 2025
30cffd4
:heavy_minus_sign: Remove api/ prettier install and instead rely on r…
klondikemarlen May 27, 2025
c49b0a3
:hammer: Set up `dev migrate` commands.
klondikemarlen May 27, 2025
5c37889
:butterfly: Add dbo.Photo table missed in existing migrations.
klondikemarlen May 28, 2025
d105b00
:seedling: Seed the database with some places.
klondikemarlen May 28, 2025
e032fc8
Merge pull request #40 from icefoganalytics/issue-39/add-ability-for-…
burkkyy Sep 12, 2025
cce51be
ignore envrc
burkkyy Sep 12, 2025
03e47be
moved api and web out of src/
burkkyy Sep 12, 2025
cad9901
changes from api and web folder change
burkkyy Sep 12, 2025
a67d795
Merge pull request #42 from icefoganalytics/caleb/dev
burkkyy Sep 12, 2025
5132f3a
First draft at pushing data into descripton section
burkkyy Sep 17, 2025
2690a2f
Merge remote-tracking branch 'origin/main' into caleb/dev
burkkyy Sep 17, 2025
b8a05b6
Formatted file
burkkyy Sep 17, 2025
fec06fe
Better return type defn
burkkyy Sep 17, 2025
3883348
Formatted file
burkkyy Sep 17, 2025
7128806
Cleaner file naming
burkkyy Sep 17, 2025
ce389f5
Formatted file
burkkyy Sep 17, 2025
201823a
conditional sections
burkkyy Sep 17, 2025
abe7769
handlebars update
burkkyy Sep 23, 2025
bb1c32e
added more sections
burkkyy Sep 23, 2025
5700215
moved print site to seperate service and finished new section
burkkyy Sep 24, 2025
0647f7e
Finished sections, photo section remaining
burkkyy Sep 24, 2025
228d3fb
Updates to print site service
burkkyy Sep 24, 2025
8f48231
Merge pull request #43 from icefoganalytics/caleb/dev
burkkyy Sep 24, 2025
7d1a67f
Adding tool versions for dev command users
burkkyy Oct 3, 2025
246c846
removing old console log
burkkyy Oct 7, 2025
b47124d
Formatted file
burkkyy Oct 7, 2025
f89a36a
eslint rc
burkkyy Oct 7, 2025
caac721
unused func
burkkyy Oct 7, 2025
738d839
Formatting
burkkyy Oct 8, 2025
101ac94
destroy service for place
burkkyy Oct 8, 2025
8e35264
new delete endpoint for places, only for site admin and system admin
burkkyy Oct 8, 2025
f4257d8
Attempt at place delete frontend code
burkkyy Oct 8, 2025
5933610
Confirms with user before attempting to delete place (site)
burkkyy Oct 8, 2025
a04211e
Merge pull request #44 from icefoganalytics/caleb/dev
burkkyy Oct 8, 2025
7e74d69
Brute force search for min available key,
burkkyy Oct 9, 2025
34be1ae
Front and backend changes to allowing edit of yhsiid for ONLY system …
burkkyy Oct 10, 2025
88ad780
Merge pull request #45 from icefoganalytics/caleb/dev
burkkyy Oct 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 4 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
src/*/node_modules
src/*/dist
api/node_modules
api/dist
web/node_modules
web/dist
npm-debug.log
11 changes: 11 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
env:
browser: true
es2021: true
node: true
extends:
- prettier
overrides: []
parserOptions:
ecmaVersion: latest
sourceType: module
rules: {}
40 changes: 40 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

# Context

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

Relates to:
- TODO

# Context

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
29 changes: 0 additions & 29 deletions .github/issue_template.md

This file was deleted.

43 changes: 12 additions & 31 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,24 @@
Please replace the following example with your own content.
Fixes TODO

Fixes [#25](https://github.com/icefoganalytics/yhsi/issues/25)
Relates to:

# User Story
- TODO

See https://github.com/icefoganalytics/yhsi/issues/3
As an edit level user I can edit the /sites Themes & Function form and it will create a site change request for admin approval.
# Context

# Details
TODO

Now that I have a working example in the form of the Summary, Location, and Dates & Conditions sections, this task is simply a port of the existing patterns to include an additional sub-form.
# Implementation

# Implementation Details

- Tweaked PlaceEdit saving and serialization to hopefully reduce developer errors.
- Dockerize the test suite and update the README.
- add a `dev ts-node` to get access to a local node repl that runs typescript.
TODO

# Screenshots

![image](https://user-images.githubusercontent.com/23045206/163441939-d889fb77-1b78-40e6-b59d-c3a386cc3a5d.png)
TODO

# Testing Instructions

1. Update your user roles to include `Site Admin` via the database console.
2. Go to the /sites table and select a site.
3. In the Themes & Function form, make an edit and press save.
4. The site will refresh and your edits will be saved.
5. Update your user roles so that they _do not include_ `Site Admin` or `Administrator` via the database console. Something like `Site Viewer` would probably be best.
6. Go to the /sites table and select a site.
7. In the summary form, make and edit (or two) and press save.
8. The page will refresh and all Themes & Function fields will become readonly. The save button on the Themes & Function form will be disabled with an appropriate tooltip.
9. Make yourself an `Site Admin` again and go to the /sites-change-requests table.
10. The new change request will be at the top of the list. Click on it to review.
11. Note the various features:

- "accept/reject" toggle buttons
- accept/reject all
- save button is locked until all changes are approved/rejected

12. Reject and accept some changes and press Save.
13. Go back to the /sites table and check that you can now edit the site and that the changes have been applied or rejected correctly.
1. Run the test suite via `dev test` (or `dev test_api`)
2. Boot the app via `dev up`
3. Log in to the app at http://localhost:8080
4.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ typings/

# dotenv environment variables file
.env
src/api/.env
.envrc
api/.env
.env.development
.env.test
.env.production
Expand Down Expand Up @@ -114,5 +115,4 @@ db/photo_data.sql
db/place_data.sql

# Other
package-lock.json
.DS_Store
11 changes: 9 additions & 2 deletions .prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# .prettierrc or .prettierrc.yaml
embeddedLanguageFormatting: "auto"
$schema: 'https://json.schemastore.org/prettierrc'
embeddedLanguageFormatting: 'auto'
jsxSingleQuote: true
pugAttributeSeparator: 'as-needed'
pugSingleQuote: false
Expand All @@ -8,5 +9,11 @@ semi: true
singleAttributePerLine: true
singleQuote: true
tabWidth: 2
trailingComma: "es5"
trailingComma: 'es5'
useTabs: true
printWidth: 100
plugins:
- prettier-plugin-embed
- prettier-plugin-sql
language: 'tsql'
paramTypes: "{ named: [':'] }"
2 changes: 2 additions & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
nodejs 20.18.0
ruby 3.3.5
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,29 @@ ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \
RUN mkdir /home/node/app && chown -R node:node /home/node/app
RUN mkdir /home/node/web && chown -R node:node /home/node/web

COPY --chown=node:node src/web/package*.json /home/node/web/
COPY --chown=node:node src/api/package*.json /home/node/app/
COPY --chown=node:node web/package*.json /home/node/web/
COPY --chown=node:node api/package*.json /home/node/app/

RUN npm install -g npm@8.5.5
USER node

WORKDIR /home/node/app
RUN npm install && npm cache clean --force --loglevel=error
COPY --chown=node:node src/api/.env* ./
COPY --chown=node:node api/.env* ./

WORKDIR /home/node/web

RUN npm install && npm cache clean --force --loglevel=error
COPY --chown=node:node src/api /home/node/app/
COPY --chown=node:node src/web /home/node/web/
COPY --chown=node:node api /home/node/app/
COPY --chown=node:node web /home/node/web/

RUN npm run build:docker

EXPOSE 3000

WORKDIR /home/node/app

COPY src/api/templates /home/node/app/dist/templates
COPY api/templates /home/node/app/dist/templates

ENV NODE_ENV=production
#RUN npm install --platform=linux --arch=x64 sharp@0.29.1
Expand Down
55 changes: 37 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,38 @@
Writing code and developing in this application requires running three services:

- A local Microsoft SQL Server (2019 Linux) database running in Docker
- The server-side Node.js application written in TypeScript: `/src/api`
- The Vue.js and Vuetify based front-end: `/src/web`
- The server-side Node.js application written in TypeScript: `/api`
- The Vue.js and Vuetify based front-end: `/web`

---

Boot the three app services:
1. Create a the `yhsi_sqlvolume` volume in docker to hold the app database.

```bash
docker-compose -f docker-compose.development.yml up
```
```bash
docker volume create yhsi_sqlvolume
```

Or if you have `ruby` installed
2. Boot the three app services:

```bash
bin/dev up
```
```bash
dev build
dev up

# Or
docker compose -f docker-compose.development.yml build
docker compose -f docker-compose.development.yml up
```

3. Run the database migrations by going to http://localhost:3000/migrate/latest

4. Create a new user account and log in to http://localhost:8080.

5. Once you are logged in, open a database console with `dev sqlcmd` and run the following command to give your user admin permissions:

```sql
UPDATE [Security].[User] SET [roles] = 'Administrator', [status] = 'Active' WHERE [email] = 'some-user@some-host.com';
GO
```

### Legacy Development Setup

Expand All @@ -33,7 +49,10 @@ docker-compose -f docker-compose.dev.yml up -d
This command will start SQL Server and bind it to your local machine's port 1433. When it starts the first time, the database will be empty. To load it with data, you must obtain a database backup and put it into `/db/backups/yhsi.bak` then run the follow commands:

```
docker exec -it yhsi_sql_1 bash
dev exec db bash

# or
docker compose -f docker-compose.development.yml exec db bash
```

This connects you to the running SQL Server container. Once in, run the following commands to create and restore the database from the backup:
Expand All @@ -46,7 +65,7 @@ cd /opt/mssql-tools/bin
You will now have a local database with data ready for the API. To run the API, run the following commands:

```
cd src/api
cd api
npm install
cp .env .env.development
```
Expand All @@ -62,17 +81,17 @@ The API will bind to your local machines port 3000 and be available at http://lo
Last to start is the the Vue.js web front-end. To run this, open a second terminal window at this directory and run the following commands:

```
cd src/web
cd web
npm install
npm run start
```

You will now have the Vue CLI server hosting the application at http://localhost:8080 and you can begin editing the API or front-end code. **All changes to the files in the `src/api` and `src/web` will automatically reload theie respective applications.**
You will now have the Vue CLI server hosting the application at http://localhost:8080 and you can begin editing the API or front-end code. **All changes to the files in the `api` and `web` will automatically reload theie respective applications.**

## Local Testing

Currently there is very minimal support for testing.
Only `src/api` has a test suite.
Only `api` has a test suite.
**The development and test databases are shared, so don't write tests that change database state yet.**

To boot the test suite go to the top level of the app and run:
Expand All @@ -84,7 +103,7 @@ bin/dev test up
docker-compose -f docker-cmpose.test.yml up

# or if you don't have docker
cd src/api
cd api
npm install
npm run test
```
Expand Down Expand Up @@ -138,8 +157,8 @@ the appropriate environment variables set using the following commands:
1. Set the environment variables for the back-end.

```
cp /src/api/.env /src/api/.env.production
vi /src/api/.env.production
cp /api/.env /api/.env.production
vi /api/.env.production
```

2. Set the global host port.
Expand Down
File renamed without changes.
28 changes: 28 additions & 0 deletions api/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/* eslint-env node */

// https://github.com/typescript-eslint/typescript-eslint/issues/251
module.exports = {
root: true,
env: {
es2020: true,
node: true,
},
extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier"],
overrides: [],
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint"],
rules: {
"@typescript-eslint/no-unused-vars": [
"error",
{
args: "all",
argsIgnorePattern: "^_",
caughtErrors: "all",
caughtErrorsIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_",
varsIgnorePattern: "^_",
ignoreRestSiblings: true,
},
],
},
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
Loading