DEV Community

Cover image for Complete Beginner Guide to Install Post Apache AGE Setup + Apache Viewer on Windows 10 Pro with WSL2 Part-2
Vinay Kumar Talreja
Vinay Kumar Talreja

Posted on

Complete Beginner Guide to Install Post Apache AGE Setup + Apache Viewer on Windows 10 Pro with WSL2 Part-2

This guide aims to assist you in Post Apache-AGE setup and seamlessly integrating it with Apache Viewer on your Windows system. It is designed to provide a step-by-step walkthrough, ensuring a straightforward installation process. While there is an informative YouTube video available, I personally encountered some minor difficulties while following it. Hence, this guide aims to simplify the process further.

Note: You must have installed postgreSQL and integrated it with Apache AGE before following this blog.

If you haven't installed PostgreSQL or Apache AGE yet, checkout Part-1.


Post Installation Apache-AGE Setup

Before proceeding with the installation of Apache Viewer, it is necessary to create a demo database. This will allow us to better understand how we can manipulate databases to solve real-world problems. Therefore, I recommend to follow below steps:

Step:1

Now, navigate back to the home directory, type cd in the terminal and follow certain commands given, and shown in photo below:

  • cd postgresql-11.18/
  • cd bin
  • initdb demoDataBase
  • cd ..
  • initdb demoDataBase

Image description

Image description

Image description

Image description

After above sub-steps, we need to start server. Make sure, you are inside postgresql-11.18 directory and follow below sub-steps:

  • bin/pg_ctl -D demoDataBase -l logfile start

After execution of above sub command, your Server will start
Image description

  • bin/createdb demoDataBase
  • bin/psql demoDataBase

After this, you will be entered to manipulate demoDataBase created above.

Step:2

Try to follow below commands like shown in pictures below

  • CREATE EXTENSION age;
  • LOAD 'age';
  • SET search_path = ag_catalog, "$user", public;
  • SELECT * FROM ag_catalog.create_graph('taxonomy_biology');
  • SELECT * FROM cypher('taxonomy_biology', $$ CREATE (:Kingdom{name: 'Animalia'}) $$) as (a agtype);

Image description

  • SELECT * FROM cypher('taxonomy_biology', $$ CREATE (:Phylum{name: 'Cnidaria'}) $$) as (a agtype);

Image description

  • SELECT * FROM cypher('taxonomy_biology', $$ MATCH (a: Kingdom), (b: Phylum) WHERE a.name = 'Animalia' AND b.name = 'Cnidaria' CREATE (b)-[e: BELONGS_TO]->(a) RETURN e $$) as (edge agtype);

Image description

  • SELECT * FROM cypher('taxonomy_biology', $$ MATCH (v) RETURN v $$) as (vertex agtype);

Image description

  • SELECT * FROM cypher('taxonomy_biology', $$ MATCH (a)-[e]->(b) RETURN a, e, b $$) as (vertex_start agtype, edge agtype, vertex_end agtype);

Image description

  • Type \q to get exit from demoDataBase=#

Till here, demoDataBase has been created and demo data has also been inserted using above commands. Type cd to get back to home directory.

Hurrah! Post Apache-AGE Setup has been successfully installed in your system.


Install Apache-Viewer

Now, clone the Apache Viewer repository into the home directory(type cd). Therefore, I recommend to follow below steps:

Step:1
git clone https://github.com/apache/age-viewer.git

Image description

Step:2
Now, cd into the cloned folder and run the command npm run setup

Image description

Step:3
Run the command npm run start

Image description

After Step-3, you will be redirected to development server as shown below:

Image description

Step:4
In this step, you have to enter your details to connect with demoDataBase.

Image description

After you press connect, if credentials are correct then, database will be connected.

Image description

Hurrah! Apache-Viewer has been successfully installed in your system.


Some Apache-Viewer Interactions

  • You can see the queries like shown below:

Image description

  • You can run and see Graphical representation of the queries like shown below:

Image description


Hurrah! Post Apache AGE Setup and Apache-Viewer has been successfully installed in your system. Start studying more about postgresql

I hope, this blog has helped you for successful installation.

Checkout Part-1 too.

Top comments (0)