MCPcopy Create free account
hub / github.com/danielmesquitta/flight-api

github.com/danielmesquitta/flight-api @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
201 symbols 624 edges 59 files 44 documented · 22% updated 16mo ago★ 34

Browse by type

Functions 127 Types & classes 74
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Flight API

A Go-based HTTP API for searching flights, authentication, health checks, and OpenAPI/Swagger documentation. Built with Fiber, Wire for DI, Go‑Playground/Validator for validation, JWT for auth, and Redis for rate‑limiting.

Features

  • Health check endpoint (GET /api/health)
  • User login with email/password (POST /api/v1/auth/login)
  • JWT‑based authentication middleware for protected routes
  • Flight search endpoint (GET /api/v1/flights/search)
  • OpenAPI/Swagger docs served under /api/docs
  • Docker support & Makefile commands
  • Unit & integration tests with testify, Fiber’s test harness, Dockerized Redis

Project Structure

.
├── .air.toml # Air config for live reload
├── .editorconfig
├── .env.example
├── Dockerfile # Docker configuration to deploy the server
├── Makefile # Makefile for scripts
├── bin
│ └── install.sh # Install Go tools
├── cmd
│ └── server
│  └── main.go # Main entry point for the server
├── docs
│ ├── docs.go # Documentation handling
│ ├── openapi.json
│ ├── openapi.yaml
│ ├── swagger.json
│ └── swagger.yaml
├── embed.go # Embedding files for the server
├── generate.go # Code generation utilities
├── go.mod
├── go.sum
├── internal
│ ├── app
│ │ └── server # HTTP server, handlers, middleware, router
│ ├── config # env loading, logging, time zone, Wire setup
│ ├── domain # use‑cases, entities, error types
│ ├── pkg # utilities: jwtutil, validator, ptr, …
│ └── provider # external integrations (Amadeus, Duffel, Serp, cache)
├── test
│ ├── container # Docker containers for integration tests
│ └── integration # Integration tests
└── tmp
└── .gitkeep

Prerequisites

Installation

  1. Clone the repo and enter directory:
git clone https://github.com/danielmesquitta/flight-api.git
cd flight-api
  1. Install tools:
make install
  1. Copy .env.example to .env and set required values

  2. Run the server locally:

make run

or Run with Docker:

docker build -t flight-api .
docker run -p 8080:8080 flight-api

API Documentation

Swagger UI and raw specs are available at:

/api/docs/swagger.json /api/docs/swagger.yaml /api/docs/openapi.json /api/docs/openapi.yaml /api/docs

Testing

Unit Tests

Run unit tests with:

make unit-test

Integration Tests

Run integration tests with:

make integration-test

Run both unit and integration tests:

make test

Extension points exported contracts — how you extend this code

browse all types & interfaces →

Core symbols most depended-on inside this repo

browse all functions →

Shape

Method 68
Struct 66
Function 59
TypeAlias 4
Interface 3
FuncType 1

Languages

Go100%

Modules by API surface

internal/provider/cache/mockcache/mockcache_gen.go22 symbols
test/integration/server/server.go14 symbols
internal/provider/flightapi/duffelapi/search_flights.go13 symbols
internal/provider/flightapi/mockflightapi/mockflightapi_gen.go10 symbols
internal/provider/flightapi/amadeusapi/search_flights.go8 symbols
internal/pkg/jwtutil/jwtutil.go8 symbols
internal/provider/cache/fibercache/fibercache.go7 symbols
internal/domain/usecase/flight/search.go7 symbols
internal/domain/errs/errs.go6 symbols
internal/config/env/env.go6 symbols
internal/provider/flightapi/serpapi/search_flights.go5 symbols
internal/provider/cache/rediscache/rediscache.go5 symbols

For agents

$ claude mcp add flight-api \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page