Skip to content

Internal Wiki

Alhassan Al-badri edited this page Jun 2, 2023 · 14 revisions

Setting Up Development Environment

This guide will help you setup the development environment for both the app and the backend:

App:

Pre-Requisites:

  • Java (Preferrably Java 17+)

Setup Steps

  1. Clone the repository using git clone https://github.com/KreakTech/frontend

  2. Ensure that Java is installed correctly, as highlighted in prerequisites.

  • If you are using Eclipse: The tools/eclipse directory contains eclipse ".launch" files that will add common Maven goals as menu items inside Eclipse. After importing this project into Eclipse, you should import the launch files.

  • If you are using Netbeans: This project is a multi-module Maven project that was generated from a Maven archetype.

  • If you are using IntelliJ: The project should work in IntelliJ out of the box. No need to copy any files. You may use the scripts provided to you.

  • If you are using another IDE: You may use the bash or sh files depending on your operating system. First, run the build.sh or build.bat file and then run the run.sh or run.bat file. This should then run the frontend of this project without an issue.

  1. You are done, you now have the simulator of the mobile app ready.

Backend:

Pre-Requisites:

Setup Steps

  1. Clone the repository using git clone https://github.com/KreakTech/backend
  2. Install Docker Desktop, as highlighted in prerequisites.
  3. Locate the .env.example file in the main directory, duplicate it, and rename it to .env, edit any information you wish.
  4. Write docker-compose up into cmd or in any terminal this may take a while on the first go as all the dependancies are being downloaded.
  5. You can verify the instances are now up by typing docker ps into cmd or terminal.
  6. You're now all setup!

FAQ

  1. How to exit the instance (turn off the backend)? CTRL+C (Win) or CMD+C (Mac).
  2. How to enable hot-restart? It is already enabled with the dev environment, just save your changes and the server will auto restart.
  3. How to push to production? You don't need to do anything special. We have setup an auto-deploy script, which builds the prod docker image, pushes it to dockerhub, and brings the prod-server upto date. This script is triggered when a PR is merged into master.

Scraper:

Pre-Requisites:

Setup Steps

  1. Clone the repository using git clone https://github.com/KreakTech/scraper
  2. Install Docker Desktop, as highlighted in prerequisites.
  3. Locate the .env.example file in the main directory, duplicate it, and rename it to .env, edit any information you wish.
  4. Write docker-compose up into cmd or in any terminal this may take a while on the first go as all the dependancies are being downloaded.
  5. You can verify the instances are now up by typing docker ps into cmd or terminal.
  6. You're now all setup, the scraper will scrape the data for all the configured universities and post it to RabbitMQ automatically.

Common Enums:

public class Enum {
	public enum MapWaypointType {
		BUILDING, CAFE, BUS_STOP, MARKET, UTILITY
	}

	public enum Language {
		EN, TR
	}

	public enum MealType {
		BREAKFAST, LUNCH, DINNER
	}

	public enum PhysicalStatus {
		ONLINE, FACETOFACE
	}

	public enum EventType {
		DAILY_MEAL, ANNOUNCEMENT, STUDENT_ACTIVITIES
	}

}

Backend API Endpoint Documentation:

The documentation is currently deployed here.