Skip to content

Commit

Permalink
Merge pull request #151 from InspiredAccessFoundation/new-map-page
Browse files Browse the repository at this point in the history
New map page
  • Loading branch information
zendern committed Feb 8, 2023
2 parents da11da2 + 426275b commit b1af0fa
Show file tree
Hide file tree
Showing 37 changed files with 2,235 additions and 596 deletions.
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
"search.exclude": {
"**/.git": true,
"**/node_modules": true,
"**/bower_components": true,
"**/tmp": true
},
"sqltools.connections": [
{
"previewLimit": 50,
Expand Down
7 changes: 5 additions & 2 deletions Dockerfile-frontend
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# stage1 - build react app first
FROM node:18-alpine as build-frontend

ARG API_KEY
ENV REACT_APP_GOOGLE_MAPS_API_KEY=$API_KEY
ARG DEV_REACT_APP_GOOGLE_MAPS_API_KEY
ARG PROD_REACT_APP_GOOGLE_MAPS_API_KEY

ENV DEV_REACT_APP_GOOGLE_MAPS_API_KEY=$DEV_REACT_APP_GOOGLE_MAPS_API_KEY
ENV PROD_REACT_APP_GOOGLE_MAPS_API_KEY=$PROD_REACT_APP_GOOGLE_MAPS_API_KEY

WORKDIR /app
COPY . .
Expand Down
4 changes: 3 additions & 1 deletion Setup/StartupLearning/Deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ The project is being deployed to [AWS](https://aws.amazon.com/). We are using a

### Words for the pictures

Github actions is setup to utilize OIDC to gain access to the configured roles for each deployment branch. There is a branch for development and one for production. To do a deployment to an environment, simply open an MR into those branches and on merge it'll deploy to the environment.
Github actions is setup to utilize OIDC to gain access to the configured roles for each deployment environment as well as the build step to push the docker containers. To do a deployment to an environment, simply create a new release and corresponding tag using the `vx.x.x` convention for naming.

Once build to kick off any cdk diff or cdk deployment you must approve the run to execute. Approvers are added to the github environments.

Development and Production even though seperate are living in the same VPC again to save cost on resources like ALB and RDS. Once we grow those can easily be split out and should live in their own accounts.

Expand Down
14 changes: 14 additions & 0 deletions back-end/config/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,20 @@ module.exports = {
idle: 10000
}
},
migratelocal: {
username: 'uct-user',
password: 'uct-password',
database: "developmentdb",
host: '127.0.0.1',
port: 5432,
dialect: "postgres",
pool: {
max: 1,
min: 1,
acquire: 30000,
idle: 10000
}
},
development: {
username: process.env.POSTGRES_USERNAME,
password: process.env.POSTGRES_PASSWORD,
Expand Down
185 changes: 185 additions & 0 deletions back-end/migrations/3-table-updates.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
'use strict';

var Sequelize = require('sequelize');

/**
* Actions summary:
*
* changeColumn "streetAddress" on table "tables"
* changeColumn "city" on table "tables"
* changeColumn "state" on table "tables"
* changeColumn "zipcode" on table "tables"
* changeColumn "zipcode" on table "tables"
* changeColumn "restroomType" on table "tables"
* changeColumn "tableStyle" on table "tables"
* changeColumn "tableNotes" on table "tables"
* changeColumn "publicAccessibility" on table "tables"
* changeColumn "hours" on table "tables"
* changeColumn "additionalInfo" on table "tables"
*
**/

var info = {
"revision": 3,
"name": "table-updates",
"created": "2023-01-25T13:42:02.665Z",
"comment": ""
};

var migrationCommands = [{
fn: "changeColumn",
params: [
"tables",
"streetAddress",
{
"type": Sequelize.STRING,
"field": "streetAddress",
"allowNull": false
}
]
},
{
fn: "changeColumn",
params: [
"tables",
"city",
{
"type": Sequelize.STRING,
"field": "city",
"allowNull": false
}
]
},
{
fn: "changeColumn",
params: [
"tables",
"state",
{
"type": Sequelize.STRING,
"field": "state",
"allowNull": false
}
]
},
{
fn: "changeColumn",
params: [
"tables",
"zipcode",
{
"type": Sequelize.INTEGER,
"field": "zipcode",
"max": 5,
"allowNull": false
}
]
},
{
fn: "changeColumn",
params: [
"tables",
"zipcode",
{
"type": Sequelize.INTEGER,
"field": "zipcode",
"max": 5,
"allowNull": false
}
]
},
{
fn: "changeColumn",
params: [
"tables",
"restroomType",
{
"type": Sequelize.ENUM('men', 'women', 'family', 'other'),
"field": "restroomType",
"allowNull": false
}
]
},
{
fn: "changeColumn",
params: [
"tables",
"tableStyle",
{
"type": Sequelize.ENUM('fixed-height', 'adjustable', 'portable'),
"field": "tableStyle",
"allowNull": false
}
]
},
{
fn: "changeColumn",
params: [
"tables",
"tableNotes",
{
"type": Sequelize.TEXT,
"field": "tableNotes",
"allowNull": true
}
]
},
{
fn: "changeColumn",
params: [
"tables",
"publicAccessibility",
{
"type": Sequelize.ENUM('Patrons/Patients Only', 'Accessible to the Public'),
"field": "publicAccessibility",
"allowNull": false
}
]
},
{
fn: "changeColumn",
params: [
"tables",
"hours",
{
"type": Sequelize.TEXT,
"field": "hours",
"allowNull": true
}
]
},
{
fn: "changeColumn",
params: [
"tables",
"additionalInfo",
{
"type": Sequelize.TEXT,
"field": "additionalInfo",
"allowNull": true
}
]
}
];

module.exports = {
pos: 0,
up: function (queryInterface, Sequelize) {
var index = this.pos;
return new Promise(function (resolve, reject) {
function next() {
if (index < migrationCommands.length) {
let command = migrationCommands[index];
console.log("[#" + index + "] execute: " + command.fn);
index++;
queryInterface[command.fn].apply(queryInterface, command.params).then(next, reject);
}
else
resolve();
}
next();
});
},
info: info
};

31 changes: 31 additions & 0 deletions back-end/migrations/4-id-consistency.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
'use strict';

var Sequelize = require('sequelize');

/**
* Actions summary:
*
* addColumn "authorId" to table "comments"
* addColumn "tableId" to table "comments"
* addColumn "uploaderId" to table "pictures"
* addColumn "tableId" to table "pictures"
*
**/

var info = {
"revision": 4,
"name": "id-consistency",
"created": "2023-01-25T13:44:31.776Z",
"comment": ""
};

module.exports = {
pos: 0,
up: function (queryInterface, Sequelize) {
queryInterface.renameColumn('pictures', 'tableID', 'tableId')
queryInterface.renameColumn('pictures', 'uploaderID', 'uploaderId')
queryInterface.renameColumn('comments', 'tableID', 'tableId')
queryInterface.renameColumn('comments', 'authorID', 'authorId')
},
info: info
};

0 comments on commit b1af0fa

Please sign in to comment.