space-trouble

module
v0.0.0-...-9da9030 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 5, 2023 License: MIT

README

Space Trouble

The project represents the configuration and setup server for Space Trouble project

CI GoReport license GitHub go.mod Go version of a Go module GoDoc

Structure

The project consists of 2 parts:

  • API that handles all HTTP communication
  • Monitor that actualizes information about SpaceX launches from their API

Prerequisites

  • Git
  • Docker
  • Docker Compose

How to Install

Clone from github and navigate to the project's folder

# HTTPS
git clone https://github.com/vbetsun/space-trouble.git

# SSH
git clone git@github.com:vbetsun/space-trouble.git

cd space-trouble

How to Deploy

cp ./deployments/.env.example ./deployments/.env

change env variables for your needs

PORT=8000 # port for serving API
DOCS_PORT=8080 # port for serving OpenAPI documentation

POSTGRES_PORT=5432 # port of postgre db
POSTGRES_HOST=localhost # host of postgre db
POSTGRES_PASSWORD=someStr0ngPass # password to psql

and start the application via docker compose. It should start the API server, monitor for actualizing data, PostgreSQL database, pgAdmin and OpenAPI documentation, which you can see on http://localhost:${DOCS_PORT}

docker compose -f ./deployments/docker-compose.yml up -d

after that you have to run migrations

make migrate-up

Database structure

ERD

How to Test

for testing our API we're going to use unit tests and Postman collection via Newman

make test # runs unit and integration tests

make test-e2e # this command runs e2e tests for running application

Directories

Path Synopsis
cmd
api
Entry point for application's API
Entry point for application's API
monitor
Entry point for application's monitor which actualizes launches of SpaceX
Entry point for application's monitor which actualizes launches of SpaceX
package configs uses for configuring different parts of our application
package configs uses for configuring different parts of our application
internal
core
Package core represents domain's entities
Package core represents domain's entities
dto
package dto is using for storing objects for sending data between layers in application
package dto is using for storing objects for sending data between layers in application
storage/psql
Package psql used for storing data in PostgreSQL database
Package psql used for storing data in PostgreSQL database
transport/rest
Package rest implements setup, teardown and handlers for the REST API
Package rest implements setup, teardown and handlers for the REST API
transport/rest/handler
PAckage handler implements router and endpoints for REST API
PAckage handler implements router and endpoints for REST API

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL