Skip to content

A simple Twitter-like App in Go & GraphQL. Create tweets, follow users, and fetch feeds. 🐦 🐹

Notifications You must be signed in to change notification settings

mobamoh/twittie

Repository files navigation

twitter-go-graphql

A simple Twitter clone project implemented in Go with GraphQL.

Description

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.

Libraries Used

  • 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.

Setup and Installation

  1. Clone the repository: git clone https://github.com/your-username/twitter-go-graphql.git
  2. Install the required libraries: go mod tidy
  3. Set up your PostgreSQL database and update the connection details in the .env file.
  4. Run database migrations: go run ./migrations/*.go up
  5. Start the application: go run main.go
  6. Open Insomnia (or any other API testing tool) and import the provided Insomnia configuration file (insomnia.json) to test the GraphQL API.

Usage

  • 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.

Testing

  1. Run the tests: go test ./...

About

A simple Twitter-like App in Go & GraphQL. Create tweets, follow users, and fetch feeds. 🐦 🐹

Topics

Resources

Stars

Watchers

Forks