Skip to content

Grbson00/globetrotter

 
 

Repository files navigation

Globetrotter

A GO/React unversity project, consisting of a monolithic backend application for booking flights, paired with a user-friendly frontend and a microservice backend, following design patterns, using an nginx gateway, gRPC for interservice communication and a corresponding frontend.

Technologies: GO, React, Docker, nginx, gRPC

Micro Service Application Architecture

Screenshot

Service models:

Accommodation model

type Accommodation struct {
	Model                 `bson:",inline"`
	Reservations          []*primitive.ObjectID `json:"reservations" bson:"reservations"`
	Name                  string                `json:"name" bson:"name"`
	Location              Address               `json:"location" bson:"location"`
	AvailableCommodations []Commodations        `json:"availableCommodations" bson:"available_commodations"`
	Photos                []string              `json:"photos" bson:"photos"` 
	Guests                int                   `json:"guests" bson:"guests"`
	Availability          TimeInterval          `json:"availability" bson:"availability"`
	UnitPrice             Price                 `json:"unitPrice" bson:"unit_price"`             
	PriceForPerson        bool                  `json:"priceForPerson" bson:"price_for_person"` 
	User                  *primitive.ObjectID   `json:"user" bson:"user"`
	AutoApprove           bool                  `json:"autoApprove" bson:"auto_approve"`  
}

Account model

type User struct {
	Model                `bson:",inline"`
	FirstName            string `json:"firstName" bson:"first_name"`
	LastName             string `json:"lastName" bson:"last_name"`
	EMail                string `json:"email" bson:"email"`
	Password             string `json:"password" bson:"password"`
	Role                 string `json:"role" bson:"role"`
	SuperHost            bool   `json:"superHost" bson:"super_host"`
	CancellationsCounter int    `json:"cancellationsCounter" bson:"cancellations_counter"`
	RatingStatus
	Address
}

Reservation model

type Reservation struct {
	Model           `bson:",inline"`
	AccommodationId *primitive.ObjectID `json:"accommodationId" bson:"accommodation_id"`
	UserId          *primitive.ObjectID `json:"userId" bson:"user_id"`
	DateInterval    TimeInterval        `json:"dateInterval" bson:"date_interval"`
	NumOfGuests     int                 `json:"numOfGuests" bson:"num_of_guests"`
	IsApproved      bool                `json:"isApproved" bson:"is_approved"`
	TotalPrice      float32             `json:"totalPrice" bson:"total_price"`
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 58.4%
  • JavaScript 39.8%
  • HTML 0.8%
  • Dockerfile 0.6%
  • Python 0.2%
  • CSS 0.1%
  • Shell 0.1%