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: FE Demo / How to prep #26

Merged
merged 23 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
a30617f
fix(file-upload): refactor fileupload to use params instead of header
MattCMcCoy Feb 6, 2024
29d6371
feat: I NO LONGER NEED TO LOGIN
MattCMcCoy Feb 6, 2024
6eac1ce
feat: fe requests using transquery
MattCMcCoy Feb 7, 2024
a630f9b
feat: install clsx bc I like it w/ tailwind
MattCMcCoy Feb 7, 2024
dfba554
refactor: general cleanup for fe demo
MattCMcCoy Feb 8, 2024
6d81b3b
docs: readme changes
MattCMcCoy Feb 8, 2024
e59c123
ci: remove over complicated name
MattCMcCoy Feb 8, 2024
7c39eda
docs: readme update to remove bullets from contributing section
MattCMcCoy Feb 8, 2024
bb203ce
fix: remove extra fetch after post request for med
MattCMcCoy Feb 8, 2024
f859873
refactor: use tan stack in file and login service routes
MattCMcCoy Feb 9, 2024
7465944
test: fix test
MattCMcCoy Feb 9, 2024
8b05e75
docs(pull_request_template): revert changes
MattCMcCoy Feb 9, 2024
59ee500
refactor: general import cleanup, removing default exports, and follo…
MattCMcCoy Feb 9, 2024
b9cb683
refactor: remove unused hook stuff from the useMedication api hook
MattCMcCoy Feb 9, 2024
9a536c1
refactor: combine all three popup hooks into one
MattCMcCoy Feb 9, 2024
74e4146
refactor: revert prev commit (I didnt like it)
MattCMcCoy Feb 9, 2024
6f7af32
ci: try at separating ci stuff
MattCMcCoy Feb 9, 2024
62ca9fd
ci: replace prettier with node package, add paths to fe and be CI stu…
MattCMcCoy Feb 9, 2024
dc224da
ci: fix fe format?
MattCMcCoy Feb 9, 2024
9604e27
ci: pls work
MattCMcCoy Feb 9, 2024
049b875
Merge branch 'main' into bugfix/file-upload
MattCMcCoy Feb 10, 2024
391f7b1
feat: medlist with optimistic updating
MattCMcCoy Feb 12, 2024
ad33c40
Feature/eslint -- Dependent on FE Demo branch (#28)
MattCMcCoy Feb 12, 2024
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
15 changes: 7 additions & 8 deletions .github/workflows/BackendCI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ name: Backend CI
on:
push:
paths:
- 'backend/**'
- '.github/**'
branches: ['main']
- "backend/**"
- ".github/**"
branches: ["main"]
pull_request:
paths:
- 'backend/**'
- '.github/**'
branches: ['main']
- "backend/**"
- ".github/**"
branches: ["main"]

jobs:
lint:
Expand Down Expand Up @@ -78,8 +78,7 @@ jobs:
uses: actions/checkout@v4

- name: Import DB seed data
run:
psql -d postgresql://user:[email protected]:5432/carewallet -f init.sql
run: psql -d postgresql://user:[email protected]:5432/carewallet -f init.sql
working-directory: ./backend/db/migrations

- name: Set up Go
Expand Down
35 changes: 28 additions & 7 deletions .github/workflows/FrontendCI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ name: Frontend CI
on:
push:
paths:
- 'client/**'
- '.github/**'
branches: ['main']
- "client/**"
- ".github/**"
branches: ["main"]
pull_request:
paths:
- 'client/**'
- '.github/**'
branches: ['main']
- "client/**"
- ".github/**"
branches: ["main"]

jobs:
lint:
format:
name: Format
runs-on: ubuntu-latest
strategy:
Expand All @@ -34,6 +34,27 @@ jobs:
cd client
npm install prettier
npx prettier --check .
lint:
name: Lint
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
go-version: [1.21.x]
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}

- name: Lint Frontend
run: |
cd client
npm install
npm run lint

build:
name: Build
Expand Down
10 changes: 0 additions & 10 deletions .prettierrc

This file was deleted.

5 changes: 4 additions & 1 deletion Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@ tasks:
echo -e "Frontend Formatting..."
cd client
npm run format
echo -e "\nFrontend Linting...\n"
npm run lint:fix
echo -e "\nBackend Formatting...\n"
cd ../backend
go fmt ./...
go vet ./...
swag f
echo -e "\nBackend Linting...\n"
go vet ./...

start-dev:
- |
Expand Down
32 changes: 31 additions & 1 deletion backend/db/migrations/init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,34 @@ VALUES
(2, 'Medication B'),
(3, 'Medication C'),
(4, 'Medication D'),
(5, 'Medication E')
(5, 'Medication E');

INSERT INTO
care_group (group_id, group_name, date_created)
VALUES
(999, 'GROUP DE MATT', '2024-02-08 06:36:00');

INSERT INTO
users (
user_id,
first_name,
last_name,
email,
phone,
address,
pfp_s3_url,
device_id,
push_notification_enabled
)
VALUES
(
'fIoFY26mJnYWH8sNdfuVoxpnVnr1',
'Matt',
'McCoy',
'',
'',
'',
'',
'',
FALSE
);
53 changes: 51 additions & 2 deletions backend/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,20 @@ const docTemplate = `{
"name": "file_data",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "The userId of the uploader",
"name": "upload_by",
"in": "formData",
"required": true
},
{
"type": "integer",
"description": "The groupId of the uploader",
"name": "group_id",
"in": "formData",
"required": true
}
],
"responses": {
Expand All @@ -39,7 +53,10 @@ const docTemplate = `{
}
},
"400": {
"description": "Bad Request"
"description": "Bad Request",
"schema": {
"type": "string"
}
}
}
}
Expand All @@ -62,6 +79,38 @@ const docTemplate = `{
}
}
}
},
"post": {
"description": "add a medication to a users medlist",
"tags": [
"medications"
],
"summary": "add a medication",
"parameters": [
{
"description": "a medication",
"name": "_",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.Medication"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.Medication"
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "string"
}
}
}
}
}
},
Expand All @@ -85,7 +134,7 @@ const docTemplate = `{
"type": "integer"
},
"upload_by": {
"type": "integer"
"type": "string"
},
"upload_date": {
"type": "string"
Expand Down
53 changes: 51 additions & 2 deletions backend/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,20 @@
"name": "file_data",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "The userId of the uploader",
"name": "upload_by",
"in": "formData",
"required": true
},
{
"type": "integer",
"description": "The groupId of the uploader",
"name": "group_id",
"in": "formData",
"required": true
}
],
"responses": {
Expand All @@ -32,7 +46,10 @@
}
},
"400": {
"description": "Bad Request"
"description": "Bad Request",
"schema": {
"type": "string"
}
}
}
}
Expand All @@ -55,6 +72,38 @@
}
}
}
},
"post": {
"description": "add a medication to a users medlist",
"tags": [
"medications"
],
"summary": "add a medication",
"parameters": [
{
"description": "a medication",
"name": "_",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.Medication"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.Medication"
}
},
"400": {
"description": "Bad Request",
"schema": {
"type": "string"
}
}
}
}
}
},
Expand All @@ -78,7 +127,7 @@
"type": "integer"
},
"upload_by": {
"type": "integer"
"type": "string"
},
"upload_date": {
"type": "string"
Expand Down
35 changes: 34 additions & 1 deletion backend/docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ definitions:
task_id:
type: integer
upload_by:
type: integer
type: string
upload_date:
type: string
type: object
Expand All @@ -39,13 +39,25 @@ paths:
name: file_data
required: true
type: file
- description: The userId of the uploader
in: formData
name: upload_by
required: true
type: string
- description: The groupId of the uploader
in: formData
name: group_id
required: true
type: integer
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.File'
"400":
description: Bad Request
schema:
type: string
summary: Upload a file
tags:
- file
Expand All @@ -62,4 +74,25 @@ paths:
summary: Get All Meds
tags:
- medications
post:
description: add a medication to a users medlist
parameters:
- description: a medication
in: body
name: _
required: true
schema:
$ref: '#/definitions/models.Medication'
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.Medication'
"400":
description: Bad Request
schema:
type: string
summary: add a medication
tags:
- medications
swagger: "2.0"
2 changes: 1 addition & 1 deletion backend/models/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ type File struct {
FileID int `json:"file_id"`
FileName string `json:"file_name"`
GroupID int `json:"group_id"`
UploadBy int `json:"upload_by"`
UploadBy string `json:"upload_by"`
UploadDate string `json:"upload_date"`
FileSize int64 `json:"file_size"`
TaskID int `json:"task_id"`
Expand Down
Loading
Loading