Skip to content

Commit 2a3525d

Browse files
authored
Merge pull request #1 from akshaychaudhari/develop
Self | Develop -> Main
2 parents 2d438f3 + 46a8bc6 commit 2a3525d

File tree

8 files changed

+118
-77
lines changed

8 files changed

+118
-77
lines changed

README.md

Lines changed: 44 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,44 @@
1-
## Chat Application:
2-
- using SpringBoot
3-
- Thymeleaf
4-
- Spring MVC
1+
# Spring Boot Chat Application
2+
3+
## Motivation
4+
5+
This project aims to create a real-time chat application using Spring Boot, Thymeleaf, and Spring MVC, providing a platform for users to communicate seamlessly.
6+
7+
## Implementation
8+
9+
### Tools Used
10+
11+
- Spring Boot
12+
- Spring MVC
13+
- Thymeleaf (for frontend)
14+
- Maven (for dependency management)
15+
16+
### Features Implemented
17+
18+
- Real-time chat functionality
19+
- User authentication and registration
20+
- Chat room creation
21+
- Sending and receiving messages
22+
- User presence status
23+
24+
### Additional Features
25+
26+
- File sharing
27+
- Message search
28+
- Notifications
29+
30+
31+
## Steps of Execution
32+
33+
1. Clone the repository to your local machine.
34+
2. Navigate to the project directory.
35+
3. Build and run the application using Maven.
36+
4. Open a web browser and access the application at [http://localhost:8086/chat](http://localhost:8086/chat).
37+
5. Sign up or log in to start using the chat application.
38+
39+
## Note
40+
41+
Make sure you have Java and Maven installed on your system. You may need to configure a database for user authentication and chat history storage as per your requirements.
42+
43+
Feel free to customize and extend the application according to your needs. Have fun building and using your Maven-based Spring Boot chat application!
44+
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package com.udacity.mvc;
2+
3+
import org.springframework.boot.SpringApplication;
4+
import org.springframework.boot.autoconfigure.SpringBootApplication;
5+
6+
7+
@SpringBootApplication
8+
public class ChatApplication {
9+
public static void main(String[] args) {
10+
SpringApplication.run(ChatApplication.class, args);
11+
}
12+
13+
/* @Bean
14+
public String message() {
15+
System.out.println("Creating Message Bean");
16+
return "Hello, Spring";
17+
}
18+
19+
@Bean
20+
public String uppercaseMessage(MessageService msgService) {
21+
System.out.println("Creating uppercaseMessage Bean");
22+
return msgService.upperCase();
23+
}
24+
25+
@Bean
26+
public String lowercaseMessage(MessageService msgService) {
27+
System.out.println("Creating lowercaseMessage Bean");
28+
return msgService.lowerCase();
29+
}*/
30+
}

src/main/java/com/udacity/mvc/ReviewApplication.java

Lines changed: 0 additions & 33 deletions
This file was deleted.

src/main/java/com/udacity/mvc/model/ChatForm.java

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,32 @@
22

33
public class ChatForm {
44

5-
private String username;
6-
private String messageText;
7-
private String messageType;
8-
9-
public String getUsername() {
10-
return username;
11-
}
12-
public void setUsername(String username) {
13-
this.username = username;
14-
}
15-
public String getMessageText() {
16-
return messageText;
17-
}
18-
public void setMessageText(String messageText) {
19-
this.messageText = messageText;
20-
}
21-
public String getMessageType() {
22-
return messageType;
23-
}
24-
public void setMessageType(String messageType) {
25-
this.messageType = messageType;
26-
}
27-
5+
private String username;
6+
private String messageText;
7+
private String messageType;
8+
9+
public String getUsername() {
10+
return username;
11+
}
12+
13+
public void setUsername(String username) {
14+
this.username = username;
15+
}
16+
17+
public String getMessageText() {
18+
return messageText;
19+
}
20+
21+
public void setMessageText(String messageText) {
22+
this.messageText = messageText;
23+
}
24+
25+
public String getMessageType() {
26+
return messageType;
27+
}
28+
29+
public void setMessageType(String messageType) {
30+
this.messageType = messageType;
31+
}
32+
2833
}

src/main/java/com/udacity/mvc/service/AuthenticationService.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
11
package com.udacity.mvc.service;
22

3-
import java.util.ArrayList;
4-
3+
import com.udacity.mvc.mapper.UserMapper;
4+
import com.udacity.mvc.model.User;
55
import org.springframework.beans.factory.annotation.Autowired;
66
import org.springframework.security.authentication.AuthenticationProvider;
77
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
88
import org.springframework.security.core.Authentication;
99
import org.springframework.security.core.AuthenticationException;
1010
import org.springframework.stereotype.Service;
1111

12-
import com.udacity.mvc.mapper.UserMapper;
13-
import com.udacity.mvc.model.User;
12+
import java.util.ArrayList;
1413

1514
@Service
1615
public class AuthenticationService implements AuthenticationProvider {
17-
18-
@Autowired
16+
17+
@Autowired
1918
private UserMapper userMapper;
20-
@Autowired
19+
@Autowired
2120
private HashService hashService;
2221

2322
// public AuthenticationService(UserMapper userMapper, HashService hashService) {
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
* {
2-
background-color: #d1cfef;
2+
background-color: #d1cfef;
33
}
44

55
h1 {
6-
color: orange;
7-
text-align: center;
6+
color: orange;
7+
text-align: center;
88
}
99

1010
p {
11-
font-family: verdana;
12-
font-size: 20px;
11+
font-family: verdana, sans-serif;
12+
font-size: 20px;
1313
}
1414

1515
.chat-table {
16-
color: maroon;
17-
margin-left: 40px;
18-
width:50%
16+
color: maroon;
17+
margin-left: 40px;
18+
width: 50%
1919
}

src/main/resources/templates/chat.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ <h1 id="firstHeading"> Welcome to The Chat Page !</h1>
2020
<select id="messageType" th:field="*{messageType}">
2121
<option th:each="type : ${allMsgTypes}" th:value="${type}" th:text="${type}">Say</option>
2222
</select>
23-
<input type="submit">
23+
<input id="submitMessage" type="submit">
2424
</form>
2525

2626
<div>

src/test/java/com/udacity/mvc/ReviewApplicationTests.java renamed to src/test/java/com/udacity/mvc/ChatApplicationTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import io.github.bonigarcia.wdm.WebDriverManager;
1919

2020
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
21-
class ReviewApplicationTests {
21+
class ChatApplicationTests {
2222

2323
@LocalServerPort
2424
public int port;

0 commit comments

Comments
 (0)