-
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 #162 from UAlberta-CMPUT401/sprint-5
Sprint 5
- Loading branch information
Showing
96 changed files
with
3,846 additions
and
1,020 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -6,3 +6,4 @@ venv | |
|
||
node_modules/ | ||
|
||
backend/firebase-credentials.json |
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 @@ | ||
FROM node:20 as frontend-build | ||
WORKDIR /usr/app/frontend | ||
COPY frontend/package.json ./ | ||
RUN npm install | ||
COPY frontend/ ./ | ||
RUN npm run build | ||
FROM node:20 | ||
WORKDIR /usr/app/backend | ||
COPY backend/package.json ./ | ||
RUN npm install | ||
COPY backend/ ./ | ||
RUN npm run build | ||
COPY --from=frontend-build /usr/app/frontend/dist ./dist/src/dist/ | ||
ENV NODE_ENV=production | ||
ENV DOTENV_CONFIG_PATH=/usr/app/backend/.env.production.local | ||
CMD ["node", "-r", "dotenv/config", "dist/src/server.js"] |
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 |
---|---|---|
@@ -1,7 +1,8 @@ | ||
# port to run service on | ||
# port to run backend service on | ||
PORT=3000 | ||
|
||
# the lowest priority of logs that is displayed (usually `debug` for development and `warn` in production) | ||
# log levels - error: 0, warn: 1, info: 2, http: 3, verbose: 4, debug: 5, silly: 6 | ||
LOG_LEVEL=debug | ||
|
||
# database host name (usually `localhost` for development and `db` in production) | ||
|
@@ -21,3 +22,7 @@ DB_PASSWORD=password | |
|
||
# path to firebase credentials json file | ||
GOOGLE_APPLICATION_CREDENTIALS=path/to/bleeding-heart-art-space-firebase-adminsdk.json | ||
|
||
# sengrid email api | ||
SENDGRID_API_KEY=SG.aBcDeFgHiJkLmNoPqRsTuVwXyZ | ||
SENDGRID_FROM_EMAIL=[email protected] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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
29 changes: 29 additions & 0 deletions
29
backend/src/common/database/migrations/20241126221247_user_event_roles.ts
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,29 @@ | ||
import { Kysely } from 'kysely' | ||
|
||
export async function up(db: Kysely<any>): Promise<void> { | ||
|
||
// Used to give permissions to users for a specific event (giving artist admin access for an event) | ||
await db.schema | ||
.createTable('user_event_roles') | ||
.addColumn('user_id', 'integer', (col) => col | ||
.references('users.id').onDelete('cascade') | ||
.notNull() | ||
) | ||
.addColumn('event_id', 'integer', (col) => col | ||
.references('events.id').onDelete('cascade') | ||
.notNull() | ||
) | ||
.addColumn('role_id', 'integer', (col) => col | ||
.references('roles.id').onDelete('cascade') | ||
.notNull() | ||
) | ||
.addPrimaryKeyConstraint('user_event_roles_pkey', ['user_id', 'event_id', 'role_id']) | ||
.execute(); | ||
|
||
} | ||
|
||
export async function down(db: Kysely<any>): Promise<void> { | ||
|
||
await db.schema.dropTable('user_event_roles').execute(); | ||
|
||
} |
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 |
---|---|---|
|
@@ -19,10 +19,11 @@ export const EventRequestsService = jest.fn().mockImplementation(() => ({ | |
start: new Date(eventData.start), | ||
end: new Date(eventData.end), | ||
requester_id: 1, | ||
status: 2, | ||
} | ||
return ret; | ||
}), | ||
getAllEventRequests: jest.fn().mockResolvedValue([ | ||
getPendingEventRequests: jest.fn().mockResolvedValue([ | ||
{ | ||
id: 1, | ||
start: new Date('2024-10-15T09:00:00.000Z'), | ||
|
@@ -34,6 +35,8 @@ export const EventRequestsService = jest.fn().mockImplementation(() => ({ | |
uid: 'test_uid', | ||
first_name: 'first', | ||
last_name: 'last', | ||
email: '[email protected]', | ||
status: 2, | ||
}, | ||
]), | ||
getEventRequestById: jest.fn().mockImplementation(async ( | ||
|
@@ -50,6 +53,7 @@ export const EventRequestsService = jest.fn().mockImplementation(() => ({ | |
address: 'Test Addr', | ||
title: 'Test Title', | ||
requester_id: 1, | ||
status: 2, | ||
} | ||
return ret; | ||
}), | ||
|
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
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
Oops, something went wrong.