This repository provides the necessary resources and deployment scripts to set up JSReport Studio and report generation capabilities using AWS Lambda. The project aims to simplify the deployment process, ensuring that you can quickly get up and running with JSReport on AWS.
This project is inspired by the jsreport documentation, where it is specified how to work with lambdas functions and/or EC2 instances.
After some searching I could not find a project that combined the functionality that exists for AWS, persistence of the template in S3, persistence of the output report in S3, and of course a lambda for the requesting of reports, in this project apart from this also integrated the possibility of having a container is JSReport Studio already configured to create or modify new templates.
Referencias
- Automated deployment of JSReport Studio on AWS
- Serverless report generation using AWS Lambda
- Integration with AWS services such as S3, Lambda, App Rummer, and CloudFormation
- Scalable and cost-efficient architecture
- AWS account with necessary permissions
- AWS CLI configured
- Node.js and npm installed locally
- Clone the repository:
git clone https://github.com/eliecer2000/jsreport-aws-app.git
- Navigate to the project directory:
cd jsreport-aws-app
npm install
- Configure your AWS credentials:
Make sure your AWS CLI is configured with the necessary permissions to deploy resources.
aws configure
# or in case of using SSO
aws configure sso
- Environmental Variables:
You must create from the sample .env.local file a file containing your project data.
ENV_REGION_ID=us-east-1
# this will be the aws account number where the project is going to be deployed
ENV_ACCOUNT_ID=000000000000
# this will be the folder where the report tempates will be stored
FS_STORE_AWS_S3_PERSISTENCE_PREFIX=testReports
FS_AUTHENTICATION_ADMIN_USERNAME=admin
FS_AUTHENTICATION_ADMIN_PASSWORD=password
- Deploy the infrastructure:
Use the provided CloudFormation template or deployment scripts to set up the infrastructure on AWS.
# recommend using the flag --require-approval=never
cdk deploy --all --require-approval=never
- Access JSReport Studio:
Once the deployment is complete, you can access JSReport Studio through the provided endpoint.
...
...
✅ DockerJsReportServerStack-xxx
✨ Deployment time: 1.13s
Outputs:
DockerJsReportServerStack-xxx.app-runner-url = https://XXXXXXXXXXX.us-east-1.awsapprunner.com # this is the endpoint
Stack ARN:
arn:aws:cloudformation:us-xxxx-x:XXXXXXXXXXXX:stack/DockerJsReportServerStack-xxx
...
...
JSReport Studio
Access the JSReport Studio through the deployed endpoint to create and manage your reports.
Invoke the AWS Lambda function with the required parameters to generate reports dynamically.
To invoke the lambda function you can use the contents of the event.json
file
- User Management: Integration with AWS Cognito for user authentication and management.
- Template permanence: Integrate DynamoDB for template data persistence.
- AutoScaling Configuration: Change App Runner AutoScaling configuration to optimize service costs.
- App Runner Timeout: Implement auto pause of App Runner service to optimize costs while the infrastructure is not in use.
- Report download: provide as optional the download link to the file saved in the s3 bucket.
- Enhanced Security: Implementation of advanced security features and best practices (cfn_nag).
Please fork this repository and submit pull requests with your improvements.
This project is licensed under the MIT License - see the LICENSE file for details.