wallace41290 / trucking-kit

0 stars 0 forks source link

TruckingKit

Setup

  1. Clone the repository
  2. Navigate to the directory in your terminal.
  3. Install nvm.
  4. Invoke: nvm use to install and set the correct node version defined in .nvmrc.
  5. Install dependencies by invoking npm i.

Setup AWS and Amplify

  1. Install the amplify cli npm install -g @aws-amplify/cli.
  2. Install the AWS cli, see instructions.
  3. Sign into your SSO account
  4. Click "Command line or programmatic access".
  5. Follow the instructions for "AWS IAM Identity Center credentials (Recommended)"
    • For the session name, I put "truckingkit"
    • Just hit enter for SSO registration scopes [sso:account:access]:
    • For CLI default client Region [None]: put us-east-1
    • For CLI default output format [None]: put json
    • For CLI profile name [Developers-789204160597]: I changed to will-dev
  6. Edit the aws config file via code ~/.aws/config, add to the end of your profile block this line as described in the docs:
    [profile will-dev]
    ...
    credential_process = aws configure export-credentials --profile will-dev

    save the config

  7. You should now be able to call any of the commands from the amplify cli. Start by:
    • cd libs/shared/backend (you have to run amplify commands from here, not the root)
    • amplify pull
    • This should pull down some files that don't get checked into git, now you can run the app.

Start the app

To start the development server run nx serve trucking-kit. Open your browser and navigate to http://localhost:4200/. Happy coding!

An Assortment of Helpful Commands

Amplify/AWS - docs

Generate code

If you happen to use Nx plugins, you can leverage code generators that might come with it.

Run nx list to get a list of available plugins and whether they have generators. Then run nx list <plugin-name> to see what generators are available.

Learn more about Nx generators on the docs.

Running tasks

To execute tasks with Nx use the following syntax:

nx <target> <project> <...options>

You can also run multiple targets:

nx run-many -t <target1> <target2>

..or add -p to filter specific projects

nx run-many -t <target1> <target2> -p <proj1> <proj2>

Targets can be defined in the package.json or projects.json. Learn more in the docs.