A NestJS application designed to generate QR codes using AWS Lambda and store the QR Code inside AWS S3 with LocalStack or serverless-s3-local. This project leverages the power of serverless architecture to provide a scalable and efficient QR code generation service.
- NestJS
- Serverless
- LocalStack
- Clone && install depenencies
- Rename .env.example to .env
- run docker
docker-compose up -d
- run
yarn deploy:local
- Get the generated link from the deploy command above
- Access
http://localhost:4566/restapis/actlxplygf/local/_user_request_/qrcode/generate?qrCodeURL=https://google.com/
, dont forget to replace the initial part for yours - After accessing the route above, you can get the link of the image, but, change http://host.docker.internal:4566 to http://localhost:4566
- Clone && install depenencies
- Rename .env.example to .env
- Uncoment the lines referent to the
serverless-s3-local
- run
yarn local
- Access http://localhost:3000/dev/qrcode/generate?qrCodeURL=https://google.com/
- After accessing the route above, you can get the link of the image
- All files will be located inside ./buckets/qr-codes
- All files will be located inside ./buckets/qr-codes
- Configure your AWS Credentials
aws configure
- Create the bucket on S3 with ACL, and give public permission for reading
- Make sure .env.prod has the configurations as you need
- Configure serverless
serverless
- Execute
yarn deploy
- Get the link of your lambda and execute
Contributions are welcome! Please fork the repository and submit a pull request.
This project is licensed under the MIT License.