Skip to content

stream2stream/arrakis_v2

Repository files navigation

Welcome to the TDI Graduate Training Coding Project

How to get started:

  1. Fork this repository into your own personal space on GitHub.
  2. You might want to setup branch protection if you are working in a team so direct commits to main are restricted and then branches and pull requests/reviews are required for all team members:
  • In your repository navigation to Settings > Branches
  • Under “Protected Branches” select 'main'
  • Enable the following settings:
    • Protect this branch
    • Require pull request reviews before merging
    • Dismiss stale pull request approvals when new commits are pushed
    • Include administrators

Working with the project:

You can work with this project locally or in Github Codespaces. With Codespaces you get 120 hours free per month, so keep within your quota.

  1. Java 11 should be installed on your machine, verify
java --version
  1. Build the project
mvnw.cmd clean install (Windows)
./mvnw clean install (Mac/Codespaces/Linux)

Run the project for local testing

For local testing before pushing the code use the following

mvnw.cmd spring-boot:run -pl java-api (Windows)
./mvnw spring-boot:run -pl java-api (Mac/Codespaces/Linux)

Frontend URL - http://localhost:8080/index.html

Further Reference

Note: From Codespaces, you can allow public access to the running application, see here for details. This will allow others outside of your codespace to navigate to the url - this can be useful for team testing or demos. Alternatively you can push the code to a server as in the next section.

Run in Codespace ** [Optional] **

  • Click on codespace

    image

  • It will open new window with Visual studio in it

  • In Editor in terminal first run

    mvnw clean install

    image

  • Once that is finished run below command

    ./mvnw spring-boot:run -pl java-api

    image

  • Once finished on right bottom corner it asks for "Open in Browser" and "Make Public". Click on "Make Public"

    image

  • Go to Ports, you will find an URL where application can be accessed image

Run on a server ** [Optional] **

  • This is completely Optional for coding challenge, make sure you will not enter any payment method to fly.io

  • Register for an account on fly.io

    • Go to www.fly.io

      image

    • Click on signup

      image

    • Enter any personal account email id and password

      image

    • Click on top left corner, it will take you to dashboard. Confirm you are using Trial Plan and there is no payment method added

      image

  • Install flyctl

  • Authorise flyctl to access your fly account

flyctl auth login
  • Generate a new app, enter a unique name or generate one
flyctl apps create 
  • Enter the app name into fly.toml
  • Manually trigger the Java Deploy to fly.io workflow (or edit the action to trigger on push to main branch)
  • App should be available on {appname}.fly.dev

Note: you might need to scale the app resources

fly scale memory 2048 -a {appname} (To scale memory)

or

fly scale vm shared-cpu-2x {appname} (To scale CPU)

See fly documentation for more guidance

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published