twitter-emulation
twitter-emulation copied to clipboard
Twitter emulation in Java and React/Angular
Twitter emulation in Java and React/Angular

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:
- Spring MVC, JSP
- Spring Boot, JSP
- Spring Boot, React
- Spring Boot, Angular
Requirements
- JDK 21+
- Apache Maven 3.9.0+
- Node.js 20.15.0+ (optional)
- Docker (optional)
Running
Spring MVC, JSP
-
From the command line with Maven (in the root directory):
mvn clean install -Dmaven.test.skip=true -
Change directory:
cd twitter-emulation-spring-mvc-jsp -
From the command line run one of the commands 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) -
Access the deployed web application at:
http://localhost:8080
-
Log in with existing accounts (
jsmith/password,jdoe/password,rroe/password,alone/password) or create a new account
Spring Boot, JSP
-
From the command line with Maven (in the root directory):
mvn clean install -Dmaven.test.skip=true -
Change directory:
cd twitter-emulation-spring-boot-jsp -
From the command line run one of the commands 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) -
Access the deployed web application at:
http://localhost:8080
-
Log in with existing accounts (
jsmith/password,jdoe/password,rroe/password,alone/password) or create a new account
Spring Boot, React
Method 1
-
From the command line with Maven (in the root directory):
mvn clean install -Dmaven.test.skip=true -
Change directory:
cd twitter-emulation-spring-boot-react-server -
From the command line run one of the commands 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) -
Access the deployed web application at:
http://localhost:8080
-
Log in with existing accounts (
jsmith/password,jdoe/password,rroe/password,alone/password) or create a new account
Method 2
-
Install Node.js
-
Run to ensure that npm is working:
npm -v -
Change directory:
cd twitter-emulation-spring-boot-react-server -
From the command line run one of the commands 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) -
Change directory:
cd twitter-emulation-spring-boot-react-web -
From the command line with npm:
npm start -
Access the deployed web application at:
http://localhost:3000
-
Log in with existing accounts (
jsmith/password,jdoe/password,rroe/password,alone/password) or create a new account
Method 3
-
From the command line with Maven (in the root directory):
mvn clean package -DskipTests -
Change directory:
cd twitter-emulation-distrib/target -
Find distribution file:
twitter-emulation-react-<version>.zip -
Extract files from ZIP, for example:
unzip twitter-emulation-react-<version>.zip -
Change directory:
cd twitter-emulation-react-<version> -
Run:
runme.bat(Windows)
runme.sh(macOS or Linux) -
Access the running web application at:
http://localhost:8080
-
Log in with existing accounts (
jsmith/password,jdoe/password,rroe/password,alone/password) or create a new account
Spring Boot, Angular
Method 1
-
From the command line with Maven (in the root directory):
mvn clean install -Dmaven.test.skip=true -
Change directory:
cd twitter-emulation-spring-boot-angular-server -
From the command line run one of the commands 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) -
Access the deployed web application at:
http://localhost:8080
-
Log in with existing accounts (
jsmith/password,jdoe/password,rroe/password,alone/password) or create a new account
Method 2
-
Install Node.js
-
Run to ensure that npm is working:
npm -v -
Change directory:
cd twitter-emulation-spring-boot-angular-server -
From the command line run one of the commands 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) -
Change directory:
cd twitter-emulation-spring-boot-angular-web -
From the command line with npm:
npm start -
Access the deployed web application at:
http://localhost:4200
-
Log in with existing accounts (
jsmith/password,jdoe/password,rroe/password,alone/password) or create a new account
Method 3
-
From the command line with Maven (in the root directory):
mvn clean package -DskipTests -
Change directory:
cd twitter-emulation-distrib/target -
Find distribution file:
twitter-emulation-angular-<version>.zip -
Extract files from ZIP, for example:
unzip twitter-emulation-angular-<version>.zip -
Change directory:
cd twitter-emulation-angular-<version> -
Run:
runme.bat(Windows)
runme.sh(macOS or Linux) -
Access the running web application at:
http://localhost:8080
-
Log in with existing accounts (
jsmith/password,jdoe/password,rroe/password,alone/password) or create a new account
Monitoring
-
Change directory:
cd twitter-emulation-spring-boot-admin -
From the command line with Maven:
mvn spring-boot:run -
Change directory:
cd twitter-emulation-spring-boot-react-serveror
cd twitter-emulation-spring-boot-angular-server -
From the command line with Maven:
mvn spring-boot:run -
Access Spring Boot Admin application at:
http://localhost:9000
-
Log in with existing account
admin/password
Testing
Backend unit testing for DAOs and services
-
Install Docker (optional, only for Oracle Database testing)
-
Change directory:
cd twitter-emulation-common -
From the command line run one of the commands with Maven:
mvn test(H2)
mvn test -P development(H2)
mvn test -P production(Oracle Database)
Backend unit testing for controllers, integration testing
-
Change directory:
cd twitter-emulation-spring-boot-common-server -
From the command line with Maven:
mvn test
Frontend unit testing
Jest, React Testing Library tests
-
Change directory:
cd twitter-emulation-spring-boot-react-web -
From the command line with npm:
npm run test
Jasmine tests
-
Change directory:
cd twitter-emulation-spring-boot-angular-web -
From the command line with npm:
npm run test
Frontend end-to-end testing
Puppeteer tests
-
Change directory:
cd twitter-emulation-spring-boot-react-web -
From the command line with npm:
npm run e2e
Protractor tests
-
Change directory:
cd twitter-emulation-spring-boot-angular-web -
From the command line with npm:
npm run e2e
Development
Frameworks and libraries
- Spring:
- React
- Angular
- H2 or Oracle Database (data storage)
- Swagger (REST API documentation)
- JUnit (Java unit testing)
- Mockito (mocking for unit tests in Java)
- TestContainers (testing with Docker containers)
- Jest (JavaScript unit testing)
- React Testing Library (JavaScript unit testing for React)
- Jasmine (JavaScript unit testing)
- Puppeteer (JavaScript end-to-end testing)
- Protractor (end-to-end testing for Angular)
CI/CD
- GitHub Actions (automation of workflows)
- Dependabot (automated dependency updates)
- Mergify (automated merging of pull requests)
Tools
- ToDoList 7.1.5+ (planning)
- Pencil 3.0.4+ (GUI prototyping)
- Violet 0.21.1 (UML diagrams)
Article
The evolution of creating web applications in Java (Russian)