Files
MinglarBackendNestJS/serverless.yml

182 lines
5.0 KiB
YAML
Raw Normal View History

2025-11-10 15:05:01 +05:30
service: minglarDev
provider:
name: aws
runtime: nodejs20.x
2025-11-12 19:59:54 +05:30
apiGateway:
binaryMediaTypes:
- '*/*' # allow binary uploads
minimumCompressionSize: 0
region: ap-south-1
versionFunctions: false
2025-11-10 15:05:01 +05:30
environment:
DATABASE_URL: ${env:DATABASE_URL}
2025-11-12 16:03:57 +05:30
DB_USERNAME: ${env:DB_USERNAME}
DB_PASSWORD: ${env:DB_PASSWORD}
DB_DATABASE_NAME: ${env:DB_DATABASE_NAME}
DB_HOSTNAME: ${env:DB_HOSTNAME}
DB_PORT: ${env:DB_PORT}
2025-11-10 15:05:01 +05:30
BY_PASS_EMAIL: ${env:BY_PASS_EMAIL}
BYPASS_OTP: ${env:BYPASS_OTP}
BREVO_EMAIL_API_KEY: ${env:BREVO_EMAIL_API_KEY}
BREVO_API_BASEURL: ${env:BREVO_API_BASEURL}
BREVO_FROM_EMAIL: ${env:BREVO_FROM_EMAIL}
BREVO_SMTP_HOST: ${env:BREVO_SMTP_HOST}
BREVO_SMTP_PORT: ${env:BREVO_SMTP_PORT}
BREVO_SMTP_USER: ${env:BREVO_SMTP_USER}
BREVO_SMTP_PASS: ${env:BREVO_SMTP_PASS}
REFRESH_TOKEN_SECRET: ${env:REFRESH_TOKEN_SECRET}
JWT_SECRET: ${env:JWT_SECRET}
SALT_ROUNDS: ${env:SALT_ROUNDS}
2025-11-12 16:03:57 +05:30
NODE_ENV: ${env:NODE_ENV}
2025-11-12 19:59:54 +05:30
# AWS_REGION: ${env:AWS_REGION}
S3_BUCKET_NAME: ${env:S3_BUCKET_NAME}
iam:
role:
statements:
- Effect: Allow
Action:
- s3:PutObject
- s3:GetObject
- s3:DeleteObject
Resource: 'arn:aws:s3:::${env:S3_BUCKET_NAME}/*'
2025-11-12 16:03:57 +05:30
2025-11-10 15:05:01 +05:30
httpApi:
cors:
allowedOrigins: ['*']
2025-11-10 15:05:01 +05:30
allowedHeaders:
- Content-Type
- X-Amz-Date
- Authorization
- X-Api-Key
- X-Auth-Token
2025-11-10 15:05:01 +05:30
allowCredentials: false
custom:
esbuild:
bundle: true
minify: false
sourcemap: false
2025-11-12 19:59:54 +05:30
exclude: ['aws-sdk'] # Exclude AWS SDK v2, but include v3 (@aws-sdk/*)
target: node20
platform: node
concurrency: 10
outdir: dist
2025-11-10 15:05:01 +05:30
package:
individually: true
patterns:
- '!node_modules/**' # exclude all node_modules first
- '!**/*.spec.ts'
- '!**/*.test.ts'
- '!**/*.log'
- 'src/**' # include all source files
- 'common/**' # include common modules
- 'node_modules/@prisma/client/**'
- 'node_modules/.prisma/client/**'
- 'prisma/schema.prisma'
2025-11-10 15:05:01 +05:30
functions:
# 👇 Example Lambda for Host Module
getHosts:
handler: src/modules/host/handlers/host.handler
package:
patterns:
- 'src/modules/host/**'
- 'common/**'
- 'node_modules/.prisma/client/libquery_engine-rhel-openssl-3.0.x.so.node'
- 'node_modules/@prisma/client/**'
- 'prisma/schema.prisma'
2025-11-10 15:05:01 +05:30
events:
- httpApi:
path: /host
method: get
2025-11-12 16:03:57 +05:30
verifyOtp:
handler: src/modules/host/handlers/verifyOtp.handler
package:
patterns:
- 'src/modules/host/**'
- 'common/**'
- 'node_modules/.prisma/client/libquery_engine-rhel-openssl-3.0.x.so.node'
- 'node_modules/@prisma/client/**'
- 'prisma/schema.prisma'
events:
- httpApi:
path: /host/verify-otp
method: post
loginForHost:
handler: src/modules/host/handlers/loginForHost.handler
package:
patterns:
- 'src/modules/host/**'
- 'common/**'
- 'node_modules/.prisma/client/libquery_engine-rhel-openssl-3.0.x.so.node'
- 'node_modules/@prisma/client/**'
- 'prisma/schema.prisma'
events:
- httpApi:
path: /host/login
method: post
registrationOfHost:
handler: src/modules/host/handlers/registration.handler
package:
patterns:
- 'src/modules/host/**'
- 'common/**'
- 'node_modules/.prisma/client/libquery_engine-rhel-openssl-3.0.x.so.node'
- 'node_modules/@prisma/client/**'
- 'prisma/schema.prisma'
events:
- httpApi:
path: /host/registration
method: post
createPasswordForHost:
handler: src/modules/host/handlers/createPassword.handler
package:
patterns:
- 'src/modules/host/**'
- 'common/**'
- 'node_modules/.prisma/client/libquery_engine-rhel-openssl-3.0.x.so.node'
- 'node_modules/@prisma/client/**'
- 'prisma/schema.prisma'
events:
- httpApi:
path: /host/create-password
2025-11-12 19:59:54 +05:30
method: post
addPaymentDetailsForHost:
handler: src/modules/host/handlers/addPaymentDetails.handler
package:
patterns:
- 'src/modules/host/**'
- 'common/**'
- 'node_modules/.prisma/client/libquery_engine-rhel-openssl-3.0.x.so.node'
- 'node_modules/@prisma/client/**'
- 'prisma/schema.prisma'
events:
- httpApi:
path: /host/add-payment-details
method: post
addCompanyDetails:
handler: src/modules/minglaradmin/handlers/addCompanyDetails.handler
package:
patterns:
- 'src/modules/minglaradmin/**'
- 'common/**'
- 'node_modules/.prisma/client/libquery_engine-rhel-openssl-3.0.x.so.node'
- 'node_modules/@prisma/client/**'
- 'node_modules/@aws-sdk/**'
- 'prisma/schema.prisma'
events:
- httpApi:
path: /minglaradmin/add-company-details
2025-11-12 16:03:57 +05:30
method: post