This project implements a Go API that interacts with a Neo4j database, demonstrating how to perform CRUD operations and manage relationships in a graph database using Go.
- CRUD Operations: Create, Read, Update, and Delete nodes in the Neo4j database.
- Relationship Management: Establish and manage relationships between nodes.
- RESTful API: Exposes Neo4j operations through a RESTful API.
- Dockerized: Includes a Dockerfile for easy deployment and containerization.
- Go 1.16 or higher
- Neo4j 4.x or higher
- Docker (optional)
Clone the repository:
git clone https://github.com/Huvinesh-Rajendran-12/neo4j-go-api.git
Set up your Neo4j database and update the connection details in the configuration file.
Install dependencies:
go mod tidy
Run the application:
go run main.go
- GET /api/users: Retrieve all users
- GET /api/users/:id: Retrieve a specific user
- POST /api/users: Create a new user
- PUT /api/users/:id: Update a user
- DELETE /api/users/:id: Delete a user
To run the application using Docker: Build the Docker image:
docker build -t neo4j-go-api .
Run the container:
docker run -p 8080:8080 neo4j-go-api