Files
2026-06-11 22:52:58 +07:00

3.3 KiB

WebGIS SIG Project (Geographic Information System)

This repository contains WebGIS applications built for university assignments / learning sessions (Pertemuan 1 to 4).

🚀 Setup & Installation

Follow these steps to set up and run the applications on your local machine.


1. Database Setup (MySQL)

We have provided a database dump file (database.sql) containing the schema and the pre-configured markers for Pertemuan 1.

  1. Open MySQL Workbench and connect to your local MySQL server.
  2. In the top menu, go to Server -> Data Import.
  3. Choose Import from Self-Contained File.
  4. Click the ... button and select the database.sql file located in pertemuan 1_stable/webgis_gasstation/database.sql.
  5. Under Default Schema to be Imported To, you can leave it blank or click New... to create a database named spbu_gis.
  6. Click the Start Import button at the bottom right.
  7. Once finished, refresh your schemas list to see the spbu_gis database and its locations table populated with the markers.

Method B: Importing via Command Line

If you prefer the command line, run the following command (enter your MySQL root password when prompted):

mysql -u root -p < "pertemuan 1_stable/webgis_gasstation/database.sql"

2. Configure Environment Variables

Before starting the server, you need to configure your database credentials:

  1. Navigate to the project folder (e.g., pertemuan 1_stable/webgis_gasstation).
  2. Duplicate the .env.example file and rename it to .env.
  3. Open .env and fill in your local MySQL password and connection details:
    DB_HOST=localhost
    DB_PORT=3306
    DB_USER=root             # Your MySQL username
    DB_PASSWORD=your_password # Your MySQL password
    DB_NAME=spbu_gis         # Database name
    PORT=3000                # App server port
    

(Note: The .env file is excluded from git commits using .gitignore to keep your local password secure.)


3. Run the Application

Once your database is running and credentials are set:

  1. Open your terminal and navigate to the project directory:
    cd "pertemuan 1_stable/webgis_gasstation"
    
  2. Install the required Node.js dependencies:
    npm install
    
  3. Start the server:
    node server.js
    
  4. Open your web browser and navigate to: http://localhost:3000

📁 Repository Structure