Java EE todo application with gradle build. The project is not dependent on IDE for development or deployment.
- Create config file and glassfish password file
cp config.example config
cp passwordfile.example passwordfile
- Update the values in the config file appropriately.
gfDomain: glassfish domain to use gfUser: Username to log in to glassfish as. gfPasswordFile: Path to password file. Check the password.example
-
Update
Database connection variables
inscripts/createresource
. Thats the information for glassfish to connect to the database. -
Make sure that the database
todo
is created and postgres is running. -
Make sure
asadmin
is in path. Verify this by typingasadmin --help
. If no command found add that to your ``$PATH.
export PATH=$PATH:path_to_glassfish_home/glassfish/bin
Important: Glassfish doesn't come with postgress by default. You will need:
- Download the postgres java driver jar from here.
- Copy that into
path_to_glassfish_home/glassfish/modules/
.
$ git clone https://github.com/adikari/todo-ee.git
$ cd todo-ee
$ ./scripts/createresource
$ gradle startServer
$ gradle flywayMigrate
$ gradle deploy
Assuming everything went successfully, you can go to http://localhost:8080/todo-rest/ to access the site. The rest api can be accessed at http://localhost:8080/todo-rest/api/.
There are 2 default users seeded to the database. Password is currently saved as plain text. Check the migration script for username and password to login.
Once the initial setup is done, now on you can just use:
$ cd path_to_todo-ee
$ gradle startServer && gradle deploy -t
On file save, the code is automatically compiled, ear
is built and deployed to the server. Only need to refresh the browser to see the changes.
- Add browser live reload if web files are changed or added.
- Use configuration file to store configuration variables from
createresources
script. - Implement same api using JAX-WS
- Implement same application for both JAX-WS and JAX-RS that can be accessed via different links.
- Add token based authentication for JAX-RS