Thanks to visit codestin.com
Credit goes to github.com

Skip to content

This repository hosts a full-stack flight search application developed as part of the Golang Flights Challenge. The project demonstrates proficiency in building scalable and efficient systems using Go, Vue.js, and Redis.

Notifications You must be signed in to change notification settings

rubengp99/golang-flights-challenge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Golang Flights Challenge ✈️

A full-stack flight search application with:

  • Golang backend (API, flight logic, WebSocket subscriptions)
  • Vue.js frontend (Vuetify UI, filters, real-time updates)
  • Redis cache (for flight data)
  • Docker for full local environment

🔧 Prerequisites


🚀 Quick Start with Docker + Docker Compose V1

To start the whole project (backend + frontend + Redis):

git clone https://github.com/rubengp99/golang-flights-challenge.git
cd golang-flights-challenge
docker-compose up --build

🚀 Quick Start with Docker + Docker Compose V2

To start the whole project (backend + frontend + Redis):

git clone https://github.com/rubengp99/golang-flights-challenge.git
cd golang-flights-challenge
docker compose up --build

📁 Project Structure

.
├── backend.golang/       # Go source code and Makefile
├── frontend.vuejs/      # Vue.js + Vuetify frontend app
├── docker-compose.yml
└── README.md

✅ Access URLs

| Service     | URL                                            |
| ----------- | ---------------------------------------------- |
| Frontend    | [http://localhost:8080](http://localhost:8080) |
| Backend API | [http://localhost:8081](http://localhost:8081) |
| Redis       | Internal (localhost:6379)                      |

🔧 Manual Setup (Dev Mode)

▶️ Backend (Go)

cd backend.golang
make run

Ensure Go 1.23+ is installed. The server will start on http://localhost:8081. Starts on http://localhost:8080. Make sure your .env points to the backend:

🖼️ Frontend (Vue 3 + Vuetify)

cd frontend.vuejs
npm install
npm run serve

Starts on http://localhost:8080. Make sure your .env file contains:

VUE_APP_BACKEND_URL=localhost:8081

🔁 WebSocket Subscription

The frontend opens a WebSocket connection to receive flight updates in real time:

new WebSocket("ws://localhost:8081/subscribe?origin=JFK&destination=LAX&date=2025-05-10&adults=1")

🧪 Backend Testing

Mock server and Infisical secrets support are included.

cd backend.golang
go test ./...

💾 Redis Cache

Used by the backend to cache flight responses.

Automatically runs via docker-compose

Host: redis
Port: 6379
Go client: go-redis/v9

Example usage:

val, err := rdb.Get(ctx, "flight:LAX-JFK").Bytes()
if err == redis.Nil {
    // cache miss
}

✉️ API Overview

GET /flights/search Search flights with:

| Query Param   | Description          |
| ------------- | -------------------- |
| `origin`      | Airport code         |
| `destination` | Airport code         |
| `date`        | Date in `YYYY-MM-DD` |
| `adults`      | Number of passengers |

📋 Environment Variables

| Name                   | Description                   |
| ---------------------- | ----------------------------- |
| `VUE_APP_BACKEND_URL`  | Vue frontend → backend URL    |
| `REDIS_URL`            | Mandatory external API source |
| `PROJECT_ID`           | Mandatory secrets manager id  |
| `INFISICAL_TOKEN`      | Mandatory secrets manager key |

About

This repository hosts a full-stack flight search application developed as part of the Golang Flights Challenge. The project demonstrates proficiency in building scalable and efficient systems using Go, Vue.js, and Redis.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published