A simple Twitter clone project implemented in Go with GraphQL.
This project aims to create a basic Twitter-like application using Go programming language and GraphQL. It provides functionalities for creating tweets, following users, and retrieving tweet feeds.
- PGX: PostgreSQL driver and toolkit for Go.
- scany: A lightweight ORM (Object-Relational Mapping) for Go.
- gqlgen: A code generator for GraphQL servers in Go.
- Dataloaden: A library for generating efficient data loaders in Go.
- golang-migrate: Database schema migration tool for Go applications.
- Insomnia: A powerful API testing and debugging tool.
- Chi: Lightweight, idiomatic, and composable router for Go web applications.
- PostgreSQL: A powerful open-source relational database management system.
- godotenv: A Go package for reading environment variables from a
.env
file. - testify: A testing toolkit for Go.
- Clone the repository:
git clone https://github.com/your-username/twitter-go-graphql.git
- Install the required libraries:
go mod tidy
- Set up your PostgreSQL database and update the connection details in the
.env
file. - Run database migrations:
go run ./migrations/*.go up
- Start the application:
go run main.go
- Open Insomnia (or any other API testing tool) and import the provided Insomnia configuration file (
insomnia.json
) to test the GraphQL API.
- Access the GraphQL API endpoint:
http://localhost:8080/graphql
- Refer to the API documentation for available queries and mutations.
- Use Insomnia (or any other API testing tool) to send requests to the API.
- Run the tests:
go test ./...