-
Notifications
You must be signed in to change notification settings - Fork 1
Project Setup
Follow these steps to prepare your environment for development and testing. Whether you're contributing code, testing features, or exploring the project, these instructions will help you start smoothly.
-
Git: Ensure
gitis installed on your system. If not, download it here. - IntelliJ IDEA: We recommend using IntelliJ IDEA (Community Edition) with JetBrains Toolbox to manage updates and multiple JetBrains products. Download IntelliJ here (you may need to scroll down on the Downloads page to find the community edition). If installing the IDE with JetBrains Toolbox, visit this link instead.
- Java Development Kit (JDK): You may need to install JDK 17 if it does not come with your IntelliJ installation. Here is an installation guide from the geeksforgeeks website.
- A GitHub Account, with SSH key set-up. You can follow this guide to create an account, this guide to create an SSH key and this guide to add the SSH key to your GitHub account.
You can clone Roky via IntelliJ or the command line:
- Open IntelliJ IDEA.
- Go to File > New > Project from Version Control.
- Paste the repository URL:
git@github.com:PPartisan/Roky.git - Select a directory and click Clone.
- Open your terminal.
- From an appropriate directory, run the following command:
git clone git@github.com:PPartisan/Roky.git- Navigate into the project directory:
cd RokyIf you are cloning the project for the first time, you may need to specify the Java version and run Gradle sync.
- Navigate to File → Settings... (keyboard shortcut, Ctrl + Alt + S).
- From the Settings dialog box, navigate to Build, Execution, Deployment → Build Tools → Gradle.
- A Gradle JVM dropdown menu is at the bottom of the box. From here, select Project SDK 17. If this does not exist, select Download JDK: set the version to 17 and the vendor to Amazon Corretto.
- Navigate to File → Project Structure (keyboard shortcut, Ctrl + Alt + Shift + S).
- From the Project selection, click the SDK dropdown menu and select 17. If this does not exist, select Download JDK and set the version to 17 and the vendor to Amazon Corretto.
- On the far right of the IDE, there is an elephant-shaped icon. Hovering over it shows a "Gradle" tooltip. Press this to open the Gradle pane.
- From this pane, click the button in the top row, fourth from the left. It looks like a "save" or "download" icon. Hovering over this button will show a "Download Sources" tooltip.
- Wait for this step to complete. If you are running for the first time, it may take several minutes.
Roky uses Supabase as its backend to store user and chat message data. To simplify development and protect our production server from work on our develop branch, we use Supabase CLI while building features. Supabase CLI creates a local Supabase server on your development machine, which means we can use and test the behaviour of Supabase without affecting our production server. So, it is strongly recommended that all new contributors configure Supabase CLI on their development machines. The official instructions exist here, and we have guides on our Supabase page written by Roky contributors.
If you continue to experience problems, please raise an Issue if the situation requires modifying our Wiki. Otherwise, communicate them on the Discussions board or raise them in our WhatsApp channel.
You can run Roky directly from IntelliJ or the command line using Gradle.
- Open the
main.ktfile and press the green "Run" symbol next tofun main().
- First, build the project by running:
./gradlew assembleOnce assembled, you can run the application using:
java -jar build/libs/Roky-1.0-SNAPSHOT.jarNote that the name of the jar file may differ from Roky-1.0-SNAPSHOT.jar. Check the contents of the build/libs directory.
Distributed releases of Roky use Supabase as a backend, but for safety reasons, Roky contributors do not typically use this production server during development. Instead, Roky contributors have two strategies to simulate interactions with Supabase: hardcoded mocks and Supabase-CLI.
Hardcoded mocks refer to Roky source code that returns predetermined values for various user interactions. For example, logging in via the Login screen may "authenticate" against a list of usernames and passwords in the source code. Supabase-CLI, on the other hand, refers to an instance of Supabase designed to run locally on a contributor's computer. It captures the interactions between our app and our production server more accurately but requires more work to configure and deploy. The Setup Supabase CLI section provides instructions on how to install and run Supabase-CLI.
To switch between these two strategies, contributors may modify the constants under the secrets.properties file in the project root directory. To use the Hardcoded Mocks strategy, set USE_LOCAL_MOCKS=true. To use the Supabase-CLI strategy, set this same value to false. Note that to use Supabase-CLI, you must also add values for the server URL and client API key.
Roky currently uses the following libraries and tools:
- Lanterna: Lightweight UI framework for text-based user interfaces.
- Supabase: Backend service for authentication and database management.
- Koin: Dependency injection for better code modularity.
- Kotlin Coroutines: Enables asynchronous programming with concise code.
- JUnit5 & Kotest: Testing frameworks for unit and integration tests.
- MockK: Mocking framework for Kotlin to support unit testing.
- Ktor: A framework for building asynchronous server and client applications.
Once you’ve set up the project, please familiarise yourself with our Contribution Guidelines so you can understand our coding standards. If you encounter any issues during setup, please refer to the FAQ or ask for assistance in the WhatsApp group.