/twitter-emulation

Twitter emulation in Java and Angular

Primary LanguageJava

GitHub Actions status codecov Quality Gate Status

Twitter emulation in Java and Angular

Screenshot

The application emulates the main features of Twitter:

  • login, logout;
  • account management (registration, editing, deleting, search by substring);
  • main page (account properties, timeline, tweets, following, followers);
  • tweet creating;
  • follow/unfollow.

in several ways:

  1. Spring MVC, JSP
  2. Spring Boot, JSP
  3. Spring Boot, Angular

Requirements

Running

Spring MVC, JSP

  1. Change directory:

    cd twitter-emulation-spring-mvc-jsp

  2. From the command line with Maven:

    mvn jetty:run (H2)
    mvn jetty:run -P development (H2)
    mvn jetty:run -P production (Oracle Database)
    (Oracle Database connection properties: etc/jetty.xml)

  3. Access the deployed web application at:

    http://localhost:8080

  4. Log in with existing accounts (jsmith/password, jdoe/password, rroe/password, alone/password) or create a new account

Spring Boot, JSP

  1. Change directory:

    cd twitter-emulation-spring-boot-jsp

  2. From the command line with Maven:

    mvn spring-boot:run (H2)
    mvn spring-boot:run -P development (H2)
    mvn spring-boot:run -P production (Oracle Database)
    (Oracle Database connection properties: src/main/resources/application.yml)

  3. Access the deployed web application at:

    http://localhost:8080

  4. Log in with existing accounts (jsmith/password, jdoe/password, rroe/password, alone/password) or create a new account

Spring Boot, Angular

Method 1

  1. From the command line with Maven (in the root directory):

    mvn clean install -Dmaven.test.skip=true

  2. Change directory:

    cd twitter-emulation-spring-boot-angular-server

  3. From the command line with Maven:

    mvn spring-boot:run (H2)
    mvn spring-boot:run -P development (H2)
    mvn spring-boot:run -P production (Oracle Database)
    (Oracle Database connection properties: src/main/resources/application.yml)

  4. Access the deployed web application at:

    http://localhost:8080

  5. Log in with existing accounts (jsmith/password, jdoe/password, rroe/password, alone/password) or create a new account

Method 2

  1. Install Node.js

  2. Run to ensure that npm is working:

    npm -v

  3. Change directory:

    cd twitter-emulation-spring-boot-angular-server

  4. From the command line with Maven:

    mvn spring-boot:run (H2)
    mvn spring-boot:run -P development (H2)
    mvn spring-boot:run -P production (Oracle Database)
    (Oracle Database connection properties: src/main/resources/application.yml)

  5. Change directory:

    cd twitter-emulation-spring-boot-angular-web

  6. From the command line with npm:

    npm start

  7. Access the deployed web application at:

    http://localhost:4200

  8. Log in with existing accounts (jsmith/password, jdoe/password, rroe/password, alone/password) or create a new account

Monitoring

  1. Change directory:

    cd twitter-emulation-spring-boot-admin

  2. From the command line with Maven:

    mvn spring-boot:run

  3. Change directory:

    cd twitter-emulation-spring-boot-angular-server

  4. From the command line with Maven:

    mvn spring-boot:run

  5. Access Spring Boot Admin application at:

    http://localhost:9000

Testing

Backend unit testing for DAOs and services

  1. Install Docker (optional, only for Oracle Database testing)

  2. Change directory:

    cd twitter-emulation-common

  3. From the command line with Maven:

    mvn test (H2)
    mvn test -P development (H2)
    mvn test -P production (Oracle Database)

Backend unit testing for controllers, integration testing

  1. Change directory:

    cd twitter-emulation-spring-boot-angular-server

  2. From the command line with Maven:

    mvn test

Frontend unit testing

  1. Change directory:

    cd twitter-emulation-spring-boot-angular-web

  2. From the command line with npm:

    npm run test

Frontend end-to-end testing

  1. Change directory:

    cd twitter-emulation-spring-boot-angular-web

  2. From the command line with npm:

    npm run e2e

Development

Frameworks and libraries

Tools

Article

See Habr (Russian)