diff --git a/.github/workflows/deploy_backend.yml b/.github/workflows/deploy_backend.yml index 7a32546c..da36a4c8 100644 --- a/.github/workflows/deploy_backend.yml +++ b/.github/workflows/deploy_backend.yml @@ -1,4 +1,4 @@ -name: Deploy DurianPy Events Service +name: Deploy SPARCS Events Service on: push: paths: diff --git a/backend/controller/pycon_registration_controller.py b/backend/controller/pycon_registration_controller.py index 5d774a58..3d0daf3a 100644 --- a/backend/controller/pycon_registration_controller.py +++ b/backend/controller/pycon_registration_controller.py @@ -79,7 +79,7 @@ def register_pycon( 'lastName': 'Dela Cruz', 'nickname': 'Juan', 'pronouns': 'he/him', - 'email': 'durianpy.davao+juan.delacruz@gmail.com', + 'email': 'sparcsup+juan.delacruz@gmail.com', 'eventId': 'pycon-davao-2024', 'contactNumber': '+639171234567', 'organization': 'Tech Company Inc', diff --git a/backend/main.py b/backend/main.py index 6d010ecb..7207c568 100644 --- a/backend/main.py +++ b/backend/main.py @@ -12,10 +12,10 @@ app = FastAPI( root_path=root_path, - title='DURIANPY Event Service', + title='SPARCS Event Service', contact={ 'name': 'Society of Programmers and Refined Computer Scientists', - 'email': 'contact@durianpy.org', + 'email': 'sparcsup@gmail.com', }, ) diff --git a/backend/resources/api.yml b/backend/resources/api.yml index 339addf9..8efb244e 100644 --- a/backend/resources/api.yml +++ b/backend/resources/api.yml @@ -17,7 +17,7 @@ app: path: /docs method: get authorizer: - arn: arn:aws:lambda:${self:provider.region}:${aws:accountId}:function:durianpy-auth-service-${self:custom.stage}-basicAuthAuthorizer + arn: arn:aws:lambda:${self:provider.region}:${aws:accountId}:function:sparcs-auth-service-${self:custom.stage}-basicAuthAuthorizer resultTtlInSeconds: 0 iamRoleStatements: - Effect: Allow @@ -31,51 +31,51 @@ app: Resource: - { "Fn::GetAtt": [Evaluations, Arn] } - "Fn::Join": - - "/" - - - "Fn::GetAtt": [ Evaluations, Arn ] - - "index" - - "*" + - "/" + - - "Fn::GetAtt": [Evaluations, Arn] + - "index" + - "*" - Effect: Allow Action: - "dynamodb:*" Resource: - { "Fn::GetAtt": [Events, Arn] } - "Fn::Join": - - "/" - - - "Fn::GetAtt": [ Events, Arn ] - - "index" - - "*" + - "/" + - - "Fn::GetAtt": [Events, Arn] + - "index" + - "*" - Effect: Allow Action: - "dynamodb:*" Resource: - { "Fn::GetAtt": [Registrations, Arn] } - "Fn::Join": - - "/" - - - "Fn::GetAtt": [ Registrations, Arn ] - - "index" - - "*" + - "/" + - - "Fn::GetAtt": [Registrations, Arn] + - "index" + - "*" - Effect: Allow Action: - "dynamodb:*" Resource: - { "Fn::GetAtt": [PreRegistrations, Arn] } - "Fn::Join": - - "/" - - - "Fn::GetAtt": [ PreRegistrations, Arn ] - - "index" - - "*" + - "/" + - - "Fn::GetAtt": [PreRegistrations, Arn] + - "index" + - "*" - Effect: Allow Action: - ssm:GetParameter Resource: - - arn:aws:ssm:*:*:parameter/durianpy-auth-secret-key-${self:custom.stage} + - arn:aws:ssm:*:*:parameter/sparcs-auth-secret-key-${self:custom.stage} - Effect: Allow Action: - "sqs:*" Resource: - - !Sub arn:aws:sqs:ap-southeast-1:${AWS::AccountId}:${self:custom.stage}-durianpy-events-email-queue.fifo - - !Sub arn:aws:sqs:ap-southeast-1:${AWS::AccountId}:${self:custom.stage}-durianpy-events-certificate-queue.fifo + - !Sub arn:aws:sqs:ap-southeast-1:${AWS::AccountId}:${self:custom.stage}-sparcs-events-email-queue.fifo + - !Sub arn:aws:sqs:ap-southeast-1:${AWS::AccountId}:${self:custom.stage}-sparcs-events-certificate-queue.fifo - Effect: Allow Action: - s3:PutObject diff --git a/backend/resources/functions.yml b/backend/resources/functions.yml index 826c4974..da2f9428 100644 --- a/backend/resources/functions.yml +++ b/backend/resources/functions.yml @@ -23,13 +23,13 @@ paymentHandler: events: - sqs: arn: - "Fn::GetAtt": [ PaymentQueue, Arn ] + "Fn::GetAtt": [PaymentQueue, Arn] iamRoleStatements: - Effect: Allow Action: - "sqs:*" Resource: - - "Fn::GetAtt": [ PaymentQueue, Arn ] + - "Fn::GetAtt": [PaymentQueue, Arn] - Effect: Allow Action: - "dynamodb:PutItem" @@ -48,4 +48,4 @@ paymentHandler: - "sqs:SendMessage" - "sqs:ReceiveMessage" - "sqs:DeleteMessage" - Resource: "arn:aws:sqs:${self:provider.region}:${aws:accountId}:${self:custom.stage}-durianpy-events-email-queue.fifo" + Resource: "arn:aws:sqs:${self:provider.region}:${aws:accountId}:${self:custom.stage}-sparcs-events-email-queue.fifo" diff --git a/backend/serverless.yaml b/backend/serverless.yaml index dbabe11c..7ec526fb 100644 --- a/backend/serverless.yaml +++ b/backend/serverless.yaml @@ -1,8 +1,8 @@ -service: durianpy-events-api -frameworkVersion: '^3.40.0' +service: sparcs-events-api +frameworkVersion: "^3.40.0" custom: - projectName: durianpy-events + projectName: sparcs-events serviceName: events stage: ${opt:stage, self:provider.stage} paymentQueue: ${self:custom.stage}-${self:custom.projectName}-payment-queue.fifo @@ -16,12 +16,9 @@ custom: # konfHubApiKey: ${ssm:/konfhub/api-key-${self:custom.stage}} betterCredentials: enabled: true - emailQueue: - !ImportValue EmailQueue-${self:custom.stage} - certificateQueue: - !ImportValue CertificateQueue-${self:custom.stage} - basicAuthorizerARN: - !ImportValue BasicAuthAuthorizerARN-${self:custom.stage} + emailQueue: !ImportValue EmailQueue-${self:custom.stage} + certificateQueue: !ImportValue CertificateQueue-${self:custom.stage} + basicAuthorizerARN: !ImportValue BasicAuthAuthorizerARN-${self:custom.stage} pythonRequirements: dockerizePip: true usePoetry: false @@ -30,7 +27,7 @@ custom: - boto3 - botocore layer: - name: durianpy-events-${self:custom.stage}-python-requirements + name: sparcs-events-${self:custom.stage}-python-requirements compatibleRuntimes: - python3.11 slim: true @@ -65,16 +62,13 @@ provider: CERTIFICATE_QUEUE: ${self:custom.certificateQueue} S3_BUCKET: ${self:custom.bucket} # KONFHUB_API_KEY: ${self:custom.konfHubApiKey} - USER_POOL_ID: - !ImportValue UserPoolId-${self:custom.stage} - USER_POOL_CLIENT_ID: - !ImportValue AppClientId-${self:custom.stage} + USER_POOL_ID: !ImportValue UserPoolId-${self:custom.stage} + USER_POOL_CLIENT_ID: !ImportValue AppClientId-${self:custom.stage} SPARCS_GMAIL: sparcsup@gmail.com logs: restApi: role: !GetAtt ApiGatewayCloudWatchRole.Arn - resources: - ${file(resources/dynamodb.yml)} - ${file(resources/api_gateway.yml)} @@ -88,30 +82,29 @@ resources: AssumeRolePolicyDocument: Version: "2012-10-17" Statement: - - Effect: Allow - Principal: - Service: apigateway.amazonaws.com - Action: sts:AssumeRole + - Effect: Allow + Principal: + Service: apigateway.amazonaws.com + Action: sts:AssumeRole Policies: - PolicyName: AllowCloudWatchLogs PolicyDocument: Version: "2012-10-17" Statement: - - Effect: Allow - Action: - - logs:CreateLogGroup - - logs:CreateLogStream - - logs:DescribeLogGroups - - logs:DescribeLogStreams - - logs:PutLogEvents - Resource: "*" + - Effect: Allow + Action: + - logs:CreateLogGroup + - logs:CreateLogStream + - logs:DescribeLogGroups + - logs:DescribeLogStreams + - logs:PutLogEvents + Resource: "*" Outputs: ApiGatewayCloudWatchRoleArn: Value: !GetAtt ApiGatewayCloudWatchRole.Arn Export: Name: ApiGatewayCloudWatchRole-${self:custom.serviceName}-${self:custom.stage} - functions: - ${file(resources/api.yml)} - ${file(resources/functions.yml)} diff --git a/backend/usecase/certificate_usecase.py b/backend/usecase/certificate_usecase.py index 34d81439..7b3a181a 100644 --- a/backend/usecase/certificate_usecase.py +++ b/backend/usecase/certificate_usecase.py @@ -40,8 +40,8 @@ def generate_certificates(self, event_id: str, registration_id: str = None) -> T try: timestamp = datetime.utcnow().isoformat(timespec='seconds') payload = {'eventId': event_id} - message_group_id = f'durianpy-certificates-{event_id}' - message_dedup_id = f'durianpy-certificates-{event_id}-{timestamp}' + message_group_id = f'sparcs-certificates-{event_id}' + message_dedup_id = f'sparcs-certificates-{event_id}-{timestamp}' if registration_id: payload['registrationId'] = registration_id diff --git a/backend/utils/logger.py b/backend/utils/logger.py index e62d9c7b..97bd142a 100644 --- a/backend/utils/logger.py +++ b/backend/utils/logger.py @@ -2,7 +2,7 @@ import os from sys import stdout -logger = logging.getLogger('durianpy-certificates-service') +logger = logging.getLogger('sparcs-certificates-service') handler = logging.StreamHandler(stdout) if os.getenv('AWS_EXECUTION_ENV'): # pragma: no cover logger.propagate = False diff --git a/frontend/package-lock.json b/frontend/package-lock.json index c04ef854..57ee03b8 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -1,11 +1,11 @@ { - "name": "durianpy-techtix", + "name": "sparcs-techtix", "version": "0.0.1", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "durianpy-techtix", + "name": "sparcs-techtix", "version": "0.0.1", "dependencies": { "@hookform/resolvers": "^5.2.1", diff --git a/frontend/package.json b/frontend/package.json index 20823a51..92ba69cc 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,5 +1,5 @@ { - "name": "durianpy-techtix", + "name": "sparcs-techtix", "private": true, "version": "0.0.1", "type": "module",