This project was developed to create an online hotel booking API platform, using an event driven microservices architecture.
- Login and signup to the application;
During the development of this project, the following techologies were used:
After creating the required AWS infrastructure resources, you must update the following lines at cognito.js with the Cognito's created service data, as well as the redirect callback and sign out URLs to your application's URL:
const config={
cognito:{
identityPoolId:"user_pool_id",
cognitoDomain:"cognito_domain",
appId:"app_client_id"
}
}
//...
var cognitoApp={
//...
{
var authData = {
//...
RedirectUriSignIn : 'https://your-app.domain.com/',
RedirectUriSignOut : 'https://your-app.domain.com/',
};
//...
}
}
You must also update the form action for addHotel.html with the API Gateway invoke url:
action="invoke_url"
To make it easier to provision infrastructure on cloud providers, you can make use of the Terraform template provided.
First, you'll need to install Terraform on your machine; then, since we're using AWS for the specified resources, you'll need to install the AWS CLI as well.
After that, you must set up an IAM user with permissions to manage resources, create an access key for the new user and configure the AWS CLI with the following command (entering the access key ID, secret access key, default region and outout format):
$ aws configure
Once these steps are done, you can use the Terraform commands to create, update and delete resources.
$ terraform init # Downloads the necessary provider plugins and set up the working directory
$ terraform plan # Creates the execution plan for the resources
$ terraform apply # Executes the actions proposed in a Terraform plan
$ terraform destroy # Destroys all remote objects managed by a particular Terraform configuration
If you want to provide the required variables for Terraform automatically when executing the script, you can create a file called prod.auto.tfvars file on the root directory, with all needed variables, according to the sample provided (auto.tfvars).
This project is under the MIT license. For more information, access LICENSE.