Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
fe17dfd
GI: Initial commit
Oct 29, 2023
538c2e9
GI: Initial commit
Oct 29, 2023
2e46be1
GI: Adding in recent changes
Oct 29, 2023
6b02325
GI: Commented out database import
Oct 29, 2023
8469828
Removed unnecessary files
Nov 5, 2023
da4b2c9
changes
dli85 Nov 7, 2023
cbf867d
dependency updates?
hams7504 Nov 9, 2023
1de10ea
Merge branch 'GI-transfer-from-old-repo' of https://github.com/Code-4…
hams7504 Nov 9, 2023
0919212
Merge pull request #3 from Code-4-Community/Dl-gi-13-match-styles
hams7504 Nov 9, 2023
059b10b
Added in recent PRs
Nov 9, 2023
34b4074
Added missing dependency
Nov 9, 2023
ec4e329
Merge branch 'main' of https://github.com/Code-4-Community/green-infr…
Nov 9, 2023
ed19ee5
Merge pull request #4 from Code-4-Community/GI-transfer-from-old-repo
JamesColesanti Nov 9, 2023
fe0db8c
Removing backend-e2e
Jan 13, 2024
79a140e
trying to fix check
hams7504 Feb 23, 2024
5045588
more changes
hams7504 Feb 23, 2024
b122d0a
changed import for flippable tile
hams7504 Feb 23, 2024
23ea1cb
Merge pull request #9 from Code-4-Community/main-branch-fix
hams7504 Feb 23, 2024
d35db4b
Changed tile backgrounds and icons
lphan48 Mar 1, 2024
76b03fe
Fixed icons and background images
lphan48 Mar 2, 2024
9adac06
Merge pull request #11 from Code-4-Community/lp-gib-97-update-feature…
hams7504 Mar 11, 2024
1c7d426
all functionality
dli85 Mar 18, 2024
1aa77be
First commit
lphan48 Mar 18, 2024
76964e8
basic box
jarenadams21 Mar 18, 2024
ca79961
exact styling
jarenadams21 Mar 18, 2024
18b83b6
header centered
jarenadams21 Mar 18, 2024
df58826
removed .env + added .env files to gitignore
hams7504 Mar 18, 2024
580532e
Merge pull request #12 from Code-4-Community/hm-fix-gitignore
hams7504 Mar 18, 2024
ee93a74
signup figma work
jarenadams21 Mar 23, 2024
f76f3c1
Linked signup page to popup boxes, and matched popups to figma
lphan48 Mar 25, 2024
7f4a8ed
Merge pull request #15 from Code-4-Community/dl-match-navbar-styles
hams7504 Mar 29, 2024
9ef6ab3
added volunteer dashboard page
lphan48 Mar 30, 2024
e149617
Delete .env
hams7504 Apr 1, 2024
f7dfbbf
Cleaned up styling code
lphan48 Apr 3, 2024
6ab5696
Added submit and delete buttons to signup popup, and removed unnecess…
lphan48 Apr 3, 2024
c0cd31b
Merge branch 'lp-gib-21-sign-up-frontend' after resolving conflicts
lphan48 Apr 3, 2024
8d9d186
built adopted gi page
lphan48 Apr 16, 2024
aab41fa
Merge pull request #14 from Code-4-Community/lp-gib-21-sign-up-frontend
mahekagg Apr 18, 2024
4465ca6
Merge pull request #16 from Code-4-Community/lp-gib-volunteer-dashboard
mahekagg Apr 18, 2024
66f7ce6
Merge branch 'main' into lp-my-adopted-gi-page
jarenadams21 Apr 18, 2024
31e8ed3
Merge pull request #18 from Code-4-Community/lp-my-adopted-gi-page
jarenadams21 Apr 18, 2024
e868dde
volunteer links back to main
jarenadams21 Apr 18, 2024
77fa367
Merge pull request #19 from Code-4-Community/ja-demo-day-1
mahekagg Apr 18, 2024
a50e96f
route updates and volunteer links to my gi page
jarenadams21 Apr 18, 2024
c2cc209
only show adoption link if site is available
hams7504 Apr 18, 2024
db27540
50-50
jarenadams21 Apr 18, 2024
c484a8f
added sign up popup
hams7504 Apr 18, 2024
0df97b3
added success page
mahekagg Apr 18, 2024
0519210
Merge pull request #21 from Code-4-Community/ja-demo-day-2point5
hams7504 Apr 18, 2024
0fe0f1e
Merge pull request #22 from Code-4-Community/hm-link-button-to-page
mahekagg Apr 18, 2024
f3be44b
Merge branch 'main' into ma-signup-update
mahekagg Apr 18, 2024
c36f2f5
added sidepanel
mahekagg Apr 18, 2024
7b38cfd
added search bar + filter
hams7504 Apr 18, 2024
eae6ddc
Merge pull request #20 from Code-4-Community/hm-fix-adoption-link
hams7504 Apr 18, 2024
6a4f43d
Merge pull request #23 from Code-4-Community/ma-signup-update
mahekagg Apr 18, 2024
9b8fe32
Merge pull request #24 from Code-4-Community/hm-add-gi-site-page-func…
mahekagg Apr 18, 2024
c309cbb
demo styles
jarenadams21 Apr 18, 2024
9b493c2
Merge branch 'main' into ja-demo-day-3-login
jarenadams21 Apr 18, 2024
4bf8daa
Update main.tsx
mahekagg Apr 18, 2024
60f9d52
add content to cards
hams7504 Apr 18, 2024
29236aa
Merge pull request #25 from Code-4-Community/ja-demo-day-3-login
mahekagg Apr 18, 2024
1705792
Merge pull request #26 from Code-4-Community/hm-add-content-to-cards
mahekagg Apr 18, 2024
ca1a200
link login
mahekagg Apr 18, 2024
3e3a950
Merge pull request #27 from Code-4-Community/ma-demo-fix
mahekagg Apr 18, 2024
d20b4b2
Change LogIn and SignUp button to turn red on hover
neetidesai Sep 24, 2024
cf366ad
Fixed login button link
nourshoreibah Sep 27, 2024
f168ef3
stlye changes
dli85 Sep 29, 2024
46a9648
example endpoint setup for sites
hams7504 Sep 30, 2024
3064299
add additional files
hams7504 Sep 30, 2024
7d1344e
add final file
hams7504 Sep 30, 2024
4a7d294
add dependencies for backend
hams7504 Sep 30, 2024
9e14132
Merge pull request #34 from Code-4-Community/hm-add-leftover-dependen…
hams7504 Sep 30, 2024
3d0a241
set up sites endpoint
hams7504 Oct 6, 2024
00b922b
remove unused methods
hams7504 Oct 6, 2024
5c5c21d
Update dynamodb.ts
hams7504 Oct 6, 2024
0ffbdcb
Merge branch 'hm-add-sites-endpoint'
hams7504 Oct 7, 2024
7fcae8f
Merge pull request #29 from Code-4-Community/gl-33-red-text-on-hover
neetidesai Oct 13, 2024
b9c81af
Merge pull request #32 from Code-4-Community/dl-success-page-figma
dli85 Oct 14, 2024
f38d827
change backend site table name and column names
ItsEricSun Oct 20, 2024
b2ccd4e
add scanTable function to dynamodb module
nourshoreibah Oct 20, 2024
84cb463
Merge pull request #31 from Code-4-Community/ns-fix-login-link
nourshoreibah Oct 20, 2024
ff7916a
Add getSitesByStatus endpoint
nourshoreibah Oct 21, 2024
fbe0eca
Merge remote-tracking branch 'origin/GI-45-Fix-GET-site-by-ID' into n…
nourshoreibah Oct 21, 2024
55ffcd1
Add error handling for each site mapping
nourshoreibah Oct 21, 2024
ca6b368
change endpoint name
nourshoreibah Oct 21, 2024
8b7815d
create get all sites by symbol type endpoint and combine with status …
ItsEricSun Oct 21, 2024
8de6a34
make get sites work when no filters are provided - all sites will be …
ItsEricSun Oct 21, 2024
261310c
Merge pull request #40 from Code-4-Community/GI-42-GET-all-sites-by-s…
SushiS1ay3r Oct 21, 2024
c680f4f
fixed get user status by endpoint
SushiS1ay3r Oct 28, 2024
35a067f
testing
SushiS1ay3r Nov 4, 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
17 changes: 17 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"presets": [
[
"@nx/react/babel",
{
"runtime": "automatic"
}
]
],
"plugins": [
["babel-plugin-root-import", {
"rootPathSuffix": "./node_modules/",
"rootPathPrefix": "@"
}]
]
}

4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.

apps/backend/.env
apps/frontend/.env

# compiled output
dist
tmp
Expand Down Expand Up @@ -33,6 +36,7 @@ npm-debug.log
yarn-error.log
testem.log
/typings
.nx

# System Files
.DS_Store
Expand Down
4 changes: 2 additions & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
# . "$(dirname -- "$0")/_/husky.sh"

npx lint-staged --concurrent false --relative
# npx lint-staged --concurrent false --relative
4 changes: 2 additions & 2 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
# . "$(dirname -- "$0")/_/husky.sh"

yarn run prepush:fix
# yarn run prepush:fix
3 changes: 3 additions & 0 deletions Line 7.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 0 additions & 18 deletions apps/backend-e2e/.eslintrc.json

This file was deleted.

19 changes: 0 additions & 19 deletions apps/backend-e2e/jest.config.ts

This file was deleted.

23 changes: 0 additions & 23 deletions apps/backend-e2e/project.json

This file was deleted.

10 changes: 0 additions & 10 deletions apps/backend-e2e/src/apps/backend/apps/backend.spec.ts

This file was deleted.

10 changes: 0 additions & 10 deletions apps/backend-e2e/src/support/global-setup.ts

This file was deleted.

7 changes: 0 additions & 7 deletions apps/backend-e2e/src/support/global-teardown.ts

This file was deleted.

10 changes: 0 additions & 10 deletions apps/backend-e2e/src/support/test-setup.ts

This file was deleted.

13 changes: 0 additions & 13 deletions apps/backend-e2e/tsconfig.json

This file was deleted.

9 changes: 0 additions & 9 deletions apps/backend-e2e/tsconfig.spec.json

This file was deleted.

22 changes: 22 additions & 0 deletions apps/backend/src/app/app.controller.spec.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 5 additions & 17 deletions apps/backend/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,13 @@ import { TypeOrmModule } from '@nestjs/typeorm';

import { AppController } from './app.controller';
import { AppService } from './app.service';
import { PluralNamingStrategy } from '../strategies/plural-naming.strategy';
import { SiteModule } from '../site/site.module';
import { UserModule } from '../user/user.module'; // Import UserModule
import { DynamoDbService } from '../dynamodb';

@Module({
imports: [
TypeOrmModule.forRoot({
type: 'mongodb',
host: '127.0.0.1',
port: 27017,
database: 'scaffoldingTest',
// username: 'root',
// password: 'root',
autoLoadEntities: true,
// entities: [join(__dirname, '**/**.entity.{ts,js}')],
// Setting synchronize: true shouldn't be used in production - otherwise you can lose production data
synchronize: true,
namingStrategy: new PluralNamingStrategy(),
}),
],
imports: [SiteModule, UserModule], // Add UserModule here
controllers: [AppController],
providers: [AppService],
providers: [AppService, DynamoDbService],
})
export class AppModule {}
20 changes: 20 additions & 0 deletions apps/backend/src/app/app.service.spec.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

58 changes: 58 additions & 0 deletions apps/backend/src/dynamodb.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import { DynamoDBClient, GetItemCommand, ScanCommand } from "@aws-sdk/client-dynamodb";
import { Injectable } from "@nestjs/common";

@Injectable()
export class DynamoDbService {
private readonly dynamoDbClient: DynamoDBClient;

constructor() {
this.dynamoDbClient = new DynamoDBClient({
region: process.env.AWS_REGION,
credentials: {
accessKeyId: process.env.AWS_ACCESS_KEY_ID,
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
},
});
}

public async scanTable(tableName: string, filterExpression?: string, expressionAttributeValues?: { [key: string]: any }, expressionAttributeNames?: { [key: string]: any }): Promise<any[]> {
// By default, scan the entire table
const params: any = {
TableName: tableName,
};
// Conditionally add FilterExpression and ExpressionAttributeValues if they exist
if (filterExpression) {
params.FilterExpression = filterExpression;
}
if (expressionAttributeValues) {
params.ExpressionAttributeValues = expressionAttributeValues;
}
if (expressionAttributeNames) {
params.ExpressionAttributeNames = expressionAttributeNames;
}
try {
const data = await this.dynamoDbClient.send(new ScanCommand(params));
return data.Items || [];
} catch (error) {
console.error('DynamoDB Scan Error:', error);
throw new Error(`Unable to scan table ${tableName}`);
}
}


public async getItem(tableName: string, key: { [key: string]: any }): Promise<any> {
const params = {
TableName: tableName,
Key: key,
};

try {
const data = await this.dynamoDbClient.send(new GetItemCommand(params));
return data.Item || null;
} catch (error) {
console.error('DynamoDB GetItem Error:', error);
throw new Error(`Unable to get item from ${tableName}`);
}
}

}
11 changes: 3 additions & 8 deletions apps/backend/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/**
* This is not a production server yet!
* This is only a minimal backend to get started.
*/

import { Logger } from '@nestjs/common';
import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';
import { NestFactory } from '@nestjs/core';
Expand All @@ -14,11 +9,11 @@ async function bootstrap() {
app.enableCors();

const globalPrefix = 'api';
app.setGlobalPrefix(globalPrefix);
app.setGlobalPrefix('');

const config = new DocumentBuilder()
.setTitle('Scaffolding API Docs')
.setDescription('Documentation for the scaffolding REST API routes')
.setTitle('Green Infrastructure API Docs')
.setDescription('Documentation for the Green Infrastructure REST API routes')
.setVersion('1.0')
.build();
const document = SwaggerModule.createDocument(app, config);
Expand Down
33 changes: 33 additions & 0 deletions apps/backend/src/site/site.controller.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import {
Controller,
Get,
Param,
Query
} from "@nestjs/common";
import { SiteService } from "./site.service";
import { SiteModel } from "./site.model";
import { ApiQuery } from "@nestjs/swagger";

@Controller("sites")
export class SiteController {
constructor(private siteService: SiteService) {}

@Get(":id")
public async getSite(
@Param("id") siteId: number
): Promise<SiteModel> {
return this.siteService.getSite(siteId);
}

@Get()
@ApiQuery({ name: 'status', required: false }) // makes query parameter optional
@ApiQuery({ name: 'symbol-type', required: false })
public async getSites(
@Query("status") status?: string,
@Query("symbol-type") symbolType?: string
): Promise<SiteModel[]> {
return this.siteService.getFilteredSites({ status, symbolType });
}


}
Loading