-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from magicalpuffin/sst-refactor
Refactor to use SST, Drizzle, and SvelteKit
- Loading branch information
Showing
125 changed files
with
13,087 additions
and
8,821 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: SST Deploy | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
|
||
# Concurrency group name ensures concurrent workflow runs wait for any in-progress job to finish | ||
concurrency: | ||
group: merge-${{ github.ref }} | ||
|
||
permissions: | ||
id-token: write # This is required for requesting the JWT | ||
contents: read # This is required for actions/checkout | ||
|
||
jobs: | ||
DeployApp: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Git clone the repository | ||
uses: actions/checkout@v3 | ||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v2 | ||
with: | ||
role-to-assume: ${{ secrets.IAM_ROLE }} | ||
# role-to-assume: arn:aws:iam::1234567890:role/GitHub | ||
role-duration-seconds: 3600 #adjust as needed for your build time | ||
aws-region: us-west-1 | ||
- name: Install frontend dependencies | ||
run: | | ||
npm i | ||
working-directory: ./packages/frontend | ||
- name: Deploy app | ||
run: | | ||
npm i && npx sst deploy --stage prod |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,5 @@ __pycache__ | |
|
||
# local env files | ||
.env*.local | ||
|
||
.env |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
{ | ||
"vpc-provider:account=024589853840:filter.vpc-id=vpc-05aced05d1ac8c50a:region=us-west-1:returnAsymmetricSubnets=true": { | ||
"vpcId": "vpc-05aced05d1ac8c50a", | ||
"vpcCidrBlock": "10.0.0.0/16", | ||
"ownerAccountId": "024589853840", | ||
"availabilityZones": [], | ||
"subnetGroups": [ | ||
{ | ||
"name": "Isolated", | ||
"type": "Isolated", | ||
"subnets": [ | ||
{ | ||
"subnetId": "subnet-001b7130c14307d1e", | ||
"cidr": "10.0.128.0/20", | ||
"availabilityZone": "us-west-1a", | ||
"routeTableId": "rtb-0d7180153fc3846be" | ||
}, | ||
{ | ||
"subnetId": "subnet-0186b876a2538fe39", | ||
"cidr": "10.0.144.0/20", | ||
"availabilityZone": "us-west-1c", | ||
"routeTableId": "rtb-052068b961004a5d1" | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "Public", | ||
"type": "Public", | ||
"subnets": [ | ||
{ | ||
"subnetId": "subnet-0025cbd970cd02cdb", | ||
"cidr": "10.0.0.0/20", | ||
"availabilityZone": "us-west-1a", | ||
"routeTableId": "rtb-057911d634c755b22" | ||
}, | ||
{ | ||
"subnetId": "subnet-042be59640c119864", | ||
"cidr": "10.0.16.0/20", | ||
"availabilityZone": "us-west-1c", | ||
"routeTableId": "rtb-057911d634c755b22" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import type { Config } from "drizzle-kit"; | ||
import * as dotenv from "dotenv"; | ||
dotenv.config(); | ||
|
||
const { DB_URL } = process.env; | ||
if (!DB_URL) { | ||
throw new Error("No url"); | ||
} | ||
export default { | ||
schema: "./packages/core/src/schema.ts", | ||
driver: "pg", | ||
out: "./drizzle", | ||
dbCredentials: { | ||
connectionString: DB_URL, | ||
}, | ||
} satisfies Config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
CREATE TABLE IF NOT EXISTS "location" ( | ||
"id" "smallserial" PRIMARY KEY NOT NULL, | ||
"name" varchar(256) NOT NULL, | ||
"sequence" smallint DEFAULT 0 | ||
); | ||
--> statement-breakpoint | ||
CREATE TABLE IF NOT EXISTS "part" ( | ||
"id" "smallserial" PRIMARY KEY NOT NULL, | ||
"name" varchar(256) NOT NULL, | ||
"description" text | ||
); | ||
--> statement-breakpoint | ||
CREATE TABLE IF NOT EXISTS "workOrder" ( | ||
"id" "smallserial" PRIMARY KEY NOT NULL, | ||
"name" varchar(256) NOT NULL, | ||
"location_id" smallint NOT NULL, | ||
"part_id" smallint NOT NULL | ||
); | ||
--> statement-breakpoint | ||
DO $$ BEGIN | ||
ALTER TABLE "workOrder" ADD CONSTRAINT "workOrder_location_id_location_id_fk" FOREIGN KEY ("location_id") REFERENCES "location"("id") ON DELETE no action ON UPDATE no action; | ||
EXCEPTION | ||
WHEN duplicate_object THEN null; | ||
END $$; | ||
--> statement-breakpoint | ||
DO $$ BEGIN | ||
ALTER TABLE "workOrder" ADD CONSTRAINT "workOrder_part_id_part_id_fk" FOREIGN KEY ("part_id") REFERENCES "part"("id") ON DELETE no action ON UPDATE no action; | ||
EXCEPTION | ||
WHEN duplicate_object THEN null; | ||
END $$; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
ALTER TABLE "location" ALTER COLUMN "sequence" SET NOT NULL;--> statement-breakpoint | ||
ALTER TABLE "workOrder" ADD COLUMN "priority" smallint DEFAULT 0 NOT NULL; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
{ | ||
"id": "fe0dc9be-702f-4372-8d6c-31503eff311a", | ||
"prevId": "00000000-0000-0000-0000-000000000000", | ||
"version": "5", | ||
"dialect": "pg", | ||
"tables": { | ||
"location": { | ||
"name": "location", | ||
"schema": "", | ||
"columns": { | ||
"id": { | ||
"name": "id", | ||
"type": "smallserial", | ||
"primaryKey": true, | ||
"notNull": true | ||
}, | ||
"name": { | ||
"name": "name", | ||
"type": "varchar(256)", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"sequence": { | ||
"name": "sequence", | ||
"type": "smallint", | ||
"primaryKey": false, | ||
"notNull": false, | ||
"default": 0 | ||
} | ||
}, | ||
"indexes": {}, | ||
"foreignKeys": {}, | ||
"compositePrimaryKeys": {}, | ||
"uniqueConstraints": {} | ||
}, | ||
"part": { | ||
"name": "part", | ||
"schema": "", | ||
"columns": { | ||
"id": { | ||
"name": "id", | ||
"type": "smallserial", | ||
"primaryKey": true, | ||
"notNull": true | ||
}, | ||
"name": { | ||
"name": "name", | ||
"type": "varchar(256)", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"description": { | ||
"name": "description", | ||
"type": "text", | ||
"primaryKey": false, | ||
"notNull": false | ||
} | ||
}, | ||
"indexes": {}, | ||
"foreignKeys": {}, | ||
"compositePrimaryKeys": {}, | ||
"uniqueConstraints": {} | ||
}, | ||
"workOrder": { | ||
"name": "workOrder", | ||
"schema": "", | ||
"columns": { | ||
"id": { | ||
"name": "id", | ||
"type": "smallserial", | ||
"primaryKey": true, | ||
"notNull": true | ||
}, | ||
"name": { | ||
"name": "name", | ||
"type": "varchar(256)", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"location_id": { | ||
"name": "location_id", | ||
"type": "smallint", | ||
"primaryKey": false, | ||
"notNull": true | ||
}, | ||
"part_id": { | ||
"name": "part_id", | ||
"type": "smallint", | ||
"primaryKey": false, | ||
"notNull": true | ||
} | ||
}, | ||
"indexes": {}, | ||
"foreignKeys": { | ||
"workOrder_location_id_location_id_fk": { | ||
"name": "workOrder_location_id_location_id_fk", | ||
"tableFrom": "workOrder", | ||
"tableTo": "location", | ||
"columnsFrom": [ | ||
"location_id" | ||
], | ||
"columnsTo": [ | ||
"id" | ||
], | ||
"onDelete": "no action", | ||
"onUpdate": "no action" | ||
}, | ||
"workOrder_part_id_part_id_fk": { | ||
"name": "workOrder_part_id_part_id_fk", | ||
"tableFrom": "workOrder", | ||
"tableTo": "part", | ||
"columnsFrom": [ | ||
"part_id" | ||
], | ||
"columnsTo": [ | ||
"id" | ||
], | ||
"onDelete": "no action", | ||
"onUpdate": "no action" | ||
} | ||
}, | ||
"compositePrimaryKeys": {}, | ||
"uniqueConstraints": {} | ||
} | ||
}, | ||
"enums": {}, | ||
"schemas": {}, | ||
"_meta": { | ||
"columns": {}, | ||
"schemas": {}, | ||
"tables": {} | ||
} | ||
} |
Oops, something went wrong.