First thing you need to do is clone the repo locally. Anywhere will do but just remember where you put it. [repo link](https://gitlab.engr.ship.edu/merlin/freshmanrpgsuite)
# Front End:
1) You will need to install the Flutter framework. This will also come with the dart sdk so you don't need to worry about installing that (It should be noted that you can check the repo's pubspec.yml to see which sdk versions are safe for download but I used version 3.7.12 for the test install). [Flutter Download/Tutorial](https://docs.flutter.dev/get-started/install)
2) After you download the framework, run `flutter doctor` in IntelliJ in the frontend project to verify that it's installed and to run some initial setup things.
3) Go to the `Settings (ctrl-alt-s) -> Plugins` and look up/download the dart plugin.
4) In settings still, go to `Settings -> Languages & Frameworks -> Dart` and set the Dart SDK Path and enable it for the game_manager module. The Dart SDK Path should be within the flutter folder that was previously downloaded in `flutter\bin\cache\dart-sdk`.
5) At this point, you should be able to run `flutter run -d chrome` (or another browser) and see proper code highlighting, meaning you are good to go.
# Backend
1) If you don't already have Java installed, download the java 17 JDK [here](https://www.oracle.com/java/technologies/downloads/#java17)
2) Now, click on the file tab in the top left of IntelliJ and go to `Project Structure -> Project Settings -> Project` and select the java 17 JDK that you just installed.
3) To run the database, you need to install [docker desktop](https://www.docker.com/products/docker-desktop/) and you can follow the short setup tutorial for docker on windows on [this page](Preparing-A-Windows-Machine)
4) Once you have that setup, you can configure the local run configuration for the restful server and setup the database by going to [this page](Setting-up-IntelliJ#running-locally)
4.5) When running the database now, if you ever experience any issues that seem to be database related, always try making sure docker is running, and rebuilding the database before trying other things because those will most likely be the issue
## Potential Errors
### When setting this up, there were two major issues that could easily happen on your machine.
- If you had an old JDK installed, make sure that your PATH environment variable is up to date if getting an error stating that has the old JDK path in it. You can also double check what java version your gradle is using by running `./gradlew --version` Also restarting your pc/IntelliJ if it's still showing the wrong version after you made changes might be needed.
- When trying to run the restful server, you may also encounter an error saying that a specific port is in use already. The two ways to check if this port is in use is by running `netstat -ano |findstr <port num>` in the terminal, and by going to Resource Monitor (resmon.exe) and navigating to `Network -> Listening Ports` and searching for the port here. If the port is in uses by httpd or some variant, check your task manager for an Apache task or some other webserver and kill the process before trying again.
After this, you should be good to start development!