A temporary online groupchat platform. This repository contains the backend server. The frontend is located at dingwen07/VTHacks11-Frontend.
- Clone the repository
- Run
mvn clean package
to build and package the backend server
Run java -jar target/chatroom-0.0.1-SNAPSHOT.jar
to run the backend server. It will listen on port 8080.
Start a Redis server, if your redis server is not running on localhost:6379, you can change the configuration in chatroom/src/main/java/com/example/chatroom/config/RedissionConfig.java
and rebuild. If you would like to use containers, make sure the server can access the redis server.
Use Nginx to reverse proxy the backend server and serve the frontend files. Here is an example configuration:
server {
listen 0.0.0.0:8000;
listen [::]:8000;
server_name example.com;
location / {
return 301 $scheme://$host:$server_port/web/;
}
location /web/ {
alias /var/www/chatroom/; # The path to the frontend files
try_files $uri $uri/ =404;
}
location /api/v1/ {
proxy_pass http://localhost:8080/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
Make sure Nginx can accees to the exposed port of the backend server.