Socket
Book a DemoInstallSign in
Socket

github.com/danielmesquitta/flight-api

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/danielmesquitta/flight-api

v0.0.0-20250428130112-280ad71c7978
Source
Go
Version published
Created
Source

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

  • Go 1.21+
  • Docker
  • make

Installation

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

  • 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

FAQs

Package last updated on 28 Apr 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.