Git Product home page Git Product logo

tn-calculator-front's Introduction

TN Calculator Front

The project uses VueJS 3 + Vuetify to run a sample frontend which consumes the tn-calculator api

The application is ready to be run locally on top of Docker or deployed to AWS via CDK

Main structure

The project is divided on two main folders:

  • App which is the app itself
  • cdk which is a CDK application to provision the main app on AWS

Opening the projects

In order to work on either "app" or in "cdk" you must fulfill these pre-requisites:

  • VSCode
  • Docker / Docker Compose
  • Extension Dev Containers installed on VSCode

Now, in order to open "app" or "cdk", just open the correspondent folder on VSCode. You`ll be prompted to reopen the IDE on a container, which you must answer Yes.

Now, this can take some minutes, but thanks to the Dev Containers technology everything you need will be automatically provisioned for you.

Running e2e

  • Open "app" on VSCode
  • Run these two commands do setup Playwright, this is a one time only step

yarn playwright install yarn playwright install-deps

  • Run the tests

yarn test:e2e

Running locally

  • Open "app" folder on VSCode,
  • On project root, create a .env.local file following the avialable .env.local.sample file, you must set the endpoint url there

yarn dev

And this is it, the app is running on http://localhost:3000

Running on AWS

Although it wasn`t a requirement, I made it easy to deploy on AWS. To do so, open the "cdk" folder on VSCode.

Now you must provide AWS credentials, you can use aws-cli configure command for that. The credentials you use must have enough permissions to manage S3, CloudFront, CloudWatch, CloudFormation, etc.

aws configure

If you just want to experiment the app and deployment process, I recommend a user with AdministratorAccess policy.

Next, create a .env file at project root following the available .env.sample file, you must set the endpoint url there

Next, you must bootstrap CDK on your AWS account, this is as simple as: (Not necessary if you already bootstraped and deployed the backend project on this account)

cdk bootstrap

This is a one time step, even if you recreate the container

And finally, you deploy the application with:

cdk deploy

On both deploy and bootstrap you will be prompted to confirm creation of some resources on your AWS account, which you should answer yes.

The deploy operation will take some minutes to complete, but in the end you`re expected to see something like:

tn-calc-front

Deployment time: 115.45s

Outputs: tn-calc-front.fronturl = dxaqowvauwp5m.cloudfront.net Stack ARN: arn:aws:cloudformation:us-east-2:122195075444:stack/tn-calc-front/e7b7f210-13be-11ee-93d2-0ae870b7b3af

Now the app is deployed at http://dxaqowvauwp5m.cloudfront.net

Demo accounts

Whatever method you use to access the application (live version, local, deployed by yourself), you have 5 demo accounts to use: username demo[1-5]@tn.com / password 1234

tn-calculator-front's People

Contributors

magnomp avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.