Skip to content

Web service built in Go, providing CRUD operations for managing individual records with additional filtering options. While saving, it fetches up additional info about the person via external API concurrently. The API utilizes SQLite as the underlying database and comes with Swagger UI for easy exploration of endpoints.

Notifications You must be signed in to change notification settings

ilkhom19/task_peopler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

People-Base API

People-Base API is a RESTful web service for managing and retrieving information about individuals. It provides CRUD (Create, Read, Update, Delete) operations for people, along with filtering options based on name, age, gender, and nationality.

Table of Contents

Getting Started

Prerequisites

Before running the People-Base API, make sure you have the following prerequisites installed:

Installation

  1. Clone the repository:

    git clone https://github.com/ilkhom19/task_peopler.git
  2. Change to the project directory:

    cd task_peopler
  3. Build and run the API:

    swag init --pd -g cmd/main.go
    source .env && go build -o app main.go && ./app

    The API will be accessible at http://localhost:8080/docs/index.html Handles

Usage

The API provides endpoints for managing people. You can use tools like curl or Postman to interact with the API. Here are some example requests:

  • Create a new person:

    curl -X POST -H "Content-Type: application/json" -d '{"name": "John", "surname": "Doe"}' http://localhost:8080/person
  • Retrieve a person by ID:

    curl http://localhost:8080/person/1
  • Delete a person by ID:

    curl -X DELETE http://localhost:8080/person/1
  • Get people by name:

    curl http://localhost:8080/people/name?name=John&page=1&pageSize=10
  • Get people by age:

    curl http://localhost:8080/people/age?age=30&page=1&pageSize=10
  • Get people by gender:

    curl http://localhost:8080/people/gender?gender=male&page=1&pageSize=10
  • Get people by nationality:

    curl http://localhost:8080/people/nationality?nationality=UZ&page=1&pageSize=10

About

Web service built in Go, providing CRUD operations for managing individual records with additional filtering options. While saving, it fetches up additional info about the person via external API concurrently. The API utilizes SQLite as the underlying database and comes with Swagger UI for easy exploration of endpoints.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages