This repository is a practice and example for working with GraphQL API, contains the source code for the Author Management System, a GraphQL-based API for managing authors, books, genres, and languages.
These instructions will help you set up and run the project on your local machine for check code and testing purposes.
- Go 1.16 or higher
- Docker (for running the database)
- Make (optional, for using the Makefile)
-
Clone the repository:
git clone https://github.com/AssassinRobot/author.git cd author
-
Install dependencies:
go mod download
-
Set up the database:
docker-compose up -d
-
Run the application:
go run main.go
-
Access the GraphQL playground at
http://localhost:8000
. (Also you can deal with GraphQL direct by sending POST request tohttp://localhost:8000/query
)
main.go
: Entry point of the application.config/
: Configuration files.database/
: Database connection and repository implementations.graph/
: GraphQL resolvers and schema.internal/model/
: internal(database) models.internal/repository/
: Repository interfaces.