Make sure you have the following tools installed on your machine before starting:
- Git
- PostgreSQL 16
- A PostgreSQL client such as:
- Java 17
- IntelliJ IDEA (IDE)
- Android Studio (IDE)
PostgreSQL 16 is the database required for this project. Follow the steps below to install it:
- Download PostgreSQL 16 from the official website.
- Follow the installation steps for your operating system.
- During the setup process, you will need to:
- Set a password for the PostgreSQL
superuser(commonlypostgres). - Install the
pgAdmintool, which comes bundled with PostgreSQL (optional if you plan to use a different client).
- Set a password for the PostgreSQL
After installation, make sure PostgreSQL is running.
For testing purposes, a pre-configured database backup is available for download.
-
Download the database backup from the following link:
-
Once downloaded, you can restore the database using either pgAdmin or DBeaver.
- Open pgAdmin and connect to your PostgreSQL instance.
- Right-click on
Databasesand chooseCreate>Database...to create a new database (e.g.,chip). - Right-click on the newly created database, select
Restore..., and in the "Filename" field, browse to the location of the downloaded.backupfile. - Click
Restoreto complete the process.
- Navigate to the imtecho-web folder inside the cloned repository and open it with IntelliJ IDEA.
- Once IntelliJ resolves and downloads the dependencies, configure the pom.xml to use the development (dev) profile for testing.
In the pom.xml, locate the dev profile and update the following placeholders with your specific details:
<profile>
<id>dev</id>
<properties>
<server.port>8080</server.port>
<server.redirect.port>8181</server.redirect.port>
<server.is.secure>true</server.is.secure>
<server.droptype>P</server.droptype>
<server.type>DEV</server.type>
<server.implementation.type>chip</server.implementation.type>
<jdbc.url>localhost</jdbc.url>
<jdbc.database>[database_name]</jdbc.database>
<jdbc.username>[postgres_username]</jdbc.username>
<jdbc.password>[postgres_password]</jdbc.password>
<jdbc.port>5432</jdbc.port>
<jdbc.maxActiveConnection>50</jdbc.maxActiveConnection>
<jdbc.maxPoolSize>100</jdbc.maxPoolSize>
<hibernate.showsql>true</hibernate.showsql>
<hibernate.formatsql>true</hibernate.formatsql>
<spring.resourceslocation>file:../</spring.resourceslocation>
<repository.path>[path_to_repository_folder]/</repository.path>
<firebasejson.path>[path_to_firebase_folder]/</firebasejson.path>
<email.server>smtp.gmail.com</email.server>
<email.port>465</email.port>
<email.userName>no-reply@infodocrx.com</email.userName>
<email.password>testing123_delete</email.password>
<email.from>no-reply@infodocrx.com</email.from>
<email.replyTo>[your_email]</email.replyTo>
<email.isSecure>true</email.isSecure>
<ssl.keystore.enable>false</ssl.keystore.enable>
<ssl.keystore.file>classpath:ssl-certs/imtstaging.jks</ssl.keystore.file>
<ssl.keystore.password>q1w2e3R$</ssl.keystore.password>
<allow.origin>*</allow.origin>
<skipTests>true</skipTests>
<rch.data.push.cron.job>false</rch.data.push.cron.job>
<ibm.access.key>WXI-fgndQ07mYNqMEHcTC5CnqZvqfxy2IjgD-4fgY9z5</ibm.access.key>
</properties>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
Replace the following fields:
[database_name]: The name of the PostgreSQL database you created.
[postgres_username]: Your PostgreSQL username (commonly postgres).
[postgres_password]: Your PostgreSQL password.
[path_to_repository_folder]: The path where your repository is located.
[path_to_firebase_folder]: The path to your Firebase folder.
[your_email]: Your email address for replies.
Once everything is set up:
Ensure PostgreSQL is running. In IntelliJ, run the project with the dev profile to verify the setup. Use the URL http://localhost:8181 to access the application.
Ensure that the correct PostgreSQL port (default: 5432) is open. Modify any additional settings as required for your development environment.
- Navigate to the imtecho-android folder and open it in Android Studio:
Launch Android Studio. Select Open from the welcome screen. Browse to the location of the imtecho-android folder and select it. Click OK to load the project.
-
Resolve Dependencies Once the project is open, Android Studio will automatically resolve and download the necessary dependencies.
-
Change the Build Configuration Open the build.gradle file (Module: app) in the imtecho-android project and add the following configuration under the buildTypes section:
debug {
shrinkResources false
minifyEnabled false
buildConfigField "String", 'BASE_URL', "\"http://[your_network_ip]:8181/\""
buildConfigField "String", 'BASE_URL_TRAINING', "\"http://[your_network_ip]:8181/\""
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}- Run the Project After resolving the dependencies, you can run the project using the Run button in Android Studio. Make sure your Android device or emulator is connected and set up properly.