Skip to content

miguelalb/arithmetic-calculator-frontend

Repository files navigation

arithmetic-calculator-frontend

This project is a simple calculator that allows users to perform basic mathematical operations (addition, subtraction, multiplication, division) and also generate a random string. Each one of these operations have a separate cost per request; users have an initial credit/balance and each request updates their balance accordingly. This Repo contains the code for the frontend, you can find the backend source code, architecture design and deployment instructions here.

Local Testing/Deployment

Clone the backend repo and deploy the backend first. After running deploy on the backend, an env.json file will be created at the root of the backend project repo. This file contains the outputs of the CloudFormation stack, including the service endpoint, the AWS Cognito Hosted UI login URL, and the AWS Cognito Hosted UI Signout URL for users to login.

Create a .env.local file at the root of this frontend project code and fill out the
VITE_SERVICE_ENDPOINT
VITE_LOGIN_HOSTEDUI_URL
VITE_SIGNOUT_HOSTEDUI_URL
environment variables. Note: You need to update these environment variables values in the .env.local file each time you run sls deploy if you're re-deploying the app, even if you have not run sls remove. This is because AWS might generate a different client_id which will change the hosted UI URL login and signout URLs.

By the default the AWS Cognito Hosted UI will use the following addresses for callback and signout URLs:

If you'd like to change these URLs or change the port you can configure this in the backend by changing the defaultCallBackURL and defaultSignOutURL variables in the custom custom section of the serverless.yml file.

Recommended IDE Setup

VSCode + Volar (and disable Vetur) + TypeScript Vue Plugin (Volar).

Customize configuration

See Vite Configuration Reference.

Project Setup

npm install

Compile and Hot-Reload for Development

npm run dev

Compile and Minify for Production

npm run build

Lint with ESLint

npm run lint

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published