Git Product home page Git Product logo

coding-challenge-db's Introduction

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

    • 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

coding-challenge-db's People

Contributors

aldearalucae avatar khankriyaltarun avatar peterrhysthomas avatar soumitra-soundankar avatar ssharan22 avatar stream2stream avatar

coding-challenge-db's Issues

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.