diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..32e52e46c26ed1ac6516534db7fa0d671615fe5b --- /dev/null +++ b/README.md @@ -0,0 +1,77 @@ +# Unnamed project (TBD) + +This should be the first file you read! + +This README will: + +- Give a brief overview of the project file structure, and how to navigate it. +- Show how to run the project locally. + +## Project Structure + +- We're using Gradle, so you'll see a `build.gradle` file in the root directory. +- Specifically, we're using a multi-project setup, so you'll see a + `settings.gradle` file in the root directory, that lists all the subprojects. +- A multi-project setup means that the project is split into multiple + subprojects, each with its own `build.gradle` file. +- Each subproject is a separate module, and they can depend on each other. +- The subprojects are: + - `backend`: The backend server, written in Java using the Spring Boot + framework. + - `register`: The registration application, where times are registered and + sent to the backend. + - `admin`: The admin application, where admins can view and manage the times. + - `shared`: Shared code between the subprojects, like data models and utility + functions. + +This subproject separation is still a work in progress. We might need to change +the organization as we go along. I'm for example not entirely sure how register, +result and admin should work together, or if we even need both result and admin? + +## Running the Project + +After much struggle, we've got everything up and running via Gradle. Spring Boot +thankfully does a lot of the heavy lifting for us. Here's how to run the +project: + +```bash +# Run the backend server +./gradlew :backend:bootRun + +# Run the registration application +./gradlew :backend:bootRun +``` + +And of course, normal Gradle commands work as well. + +```bash +# Run tests +./gradlew test +# Build the project +./gradlew build +``` + +Finally, we have a custom Gradle task that builds everything and packages it +into a release zip file. + +```bash +# Build the project and create a release zip file +./gradlew assembleAll +``` + +The zip file will be placed in `release/project-bundle.zip`. If you unpack it, +you should be able to run the backend server with the included `runner` script, +and the registration application is a runnable jar file. So: + +```bash +# Unpack the release zip file +cd release +unzip project-bundle.zip +cd project-bundle + +# Start the backend server +./runner start + +# Run the registration application +java -jar register.jar +``` diff --git a/build.gradle b/build.gradle index bd71a3308f39e4400c85a7fcc08ba2aec321764f..6faf16b30c22082cb7c448c50c5990cc81ca4818 100644 --- a/build.gradle +++ b/build.gradle @@ -13,10 +13,11 @@ subprojects { repositories { mavenCentral() } - java { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 - } + // If Gradle is using the wrong Java version, you can set it here! + // java { + // sourceCompatibility = JavaVersion.VERSION_17 + // targetCompatibility = JavaVersion.VERSION_17 + // } dependencies { // I previously had the following dependencies here, but I don't think we need them diff --git a/settings.gradle b/settings.gradle index e4b53fe3dff93ae4cec7acf460ab7748b9dfd95f..2ecaeacdb1eaaeb99dccecff52e6c221ced23606 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,4 +1,4 @@ -rootProject.name = 'Enduro Time Keeper' // The name of the project (currently just a placeholder) +rootProject.name = 'Unnamed project' // The name of the project (currently just a placeholder) include 'shared', 'register', 'admin', 'backend' // Subprojects to include gradle.ext.version = 'v0.1' // The version of the project, remember to update this when releasing a new version