This project is a response to the Full-Stack Challenge. The solution applies the RESTful architectural style. The back-end is written in Java and it relies on the JAX-RS API implemented by Eclipse Jersey. The front-end is written in JavaScript and offers two alternative versions:
The React-based variant offers a significantly better UX (as it eliminates the symptoms of page reloading whenever an update is needed) but it creates a problem of Cross-Origin Resource Sharing, as the React client needs to be hosted on its own NodeJS server. The CORS issue is solved on the back-end by utilizing a customized Container Response Filter.
All dependencies are listed in the POM file.
The solution has been tested on Apache TomEE application server (the Plus edition). It's a good fit due to its built-in support for JAX-RS.
The easiest option is deployment from the pre-compiled WAR binaries:
- Download Apache TomEE Plus and start the server
- Download the WAR file and copy it into TomEE's
webapps
folder - Navigate to http://localhost:8080/spam-protection-team/
First, make sure the TomEE server is running and the WAR file is successfully deployed (as described above). Then follow these steps:
git clone [email protected]:jakub-zarembinski/spam-protection-team.git
cd spam-protection-team/ReactClient
npm install
npm start
- Navigate to http://localhost:3000/
A basic unit test for the back-end is available in the Tester.java file. This test assumes that another instance of the application is already deployed and running on the server.