Coder Social home page Coder Social logo

activtyapi's Introduction

Quickstart_Backend GUIDE

This code is to be used as a backend quickstart code for projects and exercises given in flow 2 and 3 in the third semester of the study program “AP degree in Computer Science” at CPH Business Lyngby.

Projects which are expected to use this start-code are projects that require all, or most of the following technologies:

  • JPA and REST
  • Testing, including database test
  • Testing, including tests of REST-API's
  • CI and CONTINUOUS DELIVERY

Preconditions

In order to use this code, you should have a local developer setup + a "matching" droplet on Digital Ocean as described in the 3. semester guidelines. You will also need to build, test and deploy, locally with maven and remotely with maven controlled by Github actions. Your docker environment should be up and running.

  • Before you commit your project to the repository do a mvn clean test via the terminal to see if your docker environment is up and running.

Clone code

From github link: https://github.com/solskinIsak/Quickstart_backend

Git repository

Delete existing git repository and create your own git repository and upload to your own github account.

Delete the existing git repository by using this command: rm -fr .git

Github Actions

In order to be able to get github actions up and running correctly you need to set some secrets on the repository:

  • REMOTE_USER This should have the value of your tomcat user

  • REMOTE_PW This should have the value of your password for your tomcat user

You can find your values in the tomcat-users.xml file on Digital Ocean.

CHANGES TO BE MADE IN THE CODE

Open the files with Intellij IDEA 2021.2.4

SDK

Remember to set project SDK to java 11.

pom.xml file

INSERT UNIQUE ID - example: com.domain INSERT NAME OF PROJECT 1.0.1 war

INSERT NAME OF PROJECT

<remote.server>https:// INSERT YOUR URL/tomcat/manager/text</remote.server> <db.name>INSERT YOUR DB NAME</db.name>

Check that there are no multiple dependencies.

mavenworkflow.yml

Check the code as listed below is set to the name of your main branch:

EXAMPLE:

branches:

  • main

persistence.xml

Make sure to insert the name of your database as below:

you might want to change the testdatabase too:

Tomcat configuration

  • Open build configuration tab
  • Click on the + icon
  • Choose Tomcat Server → local
  • Click the fix button on build and choose war_exploded
  • Set the url to your desired local url
  • Press apply + ok

The url that is set here should match the frontend application when running on local If the project is not to run on local remember to change accordingly.

Maven delegate IDE

Open the maven settings tab Go to “Build, Execution, Development” Open Build tools → Maven → Runner

Make sure the “Delegate IDE build/run actions to maven” box is ticked

Class examples in the project:

In the project, there are multiple examples to be used as templates: Entities -> EntityExample needs to be changed if you want to use it Facades -> FacadeExample needs to be changed if you want to use it

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.