bookstore-api

module
v0.0.0-...-da803b4 Latest Latest
Warning

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

Go to latest
Published: May 11, 2023 License: MIT

README ΒΆ

πŸ“¦ Packages

  • Echo - Web framework
  • Sqlx - Extensions to database/sql.
  • Validator - Go Struct and Field validation
  • Jwt-go - JSON Web Tokens (JWT)
  • Migrate - Database migrations. CLI and Golang library.
  • Swag - Swagger
  • Docker - Docker

πŸ“ Data Flow

DataFlow

πŸ”§ Getting Started

🚧 You will need Go, Docker and Migrate installed.

  1. Clone the repository
git clone git@github.com:techwithmat/bookstore-api.git
  1. Go to the directory
cd bookstore-api
  1. Create a .env file with the following content:
# Database Config.
POSTGRES_HOST=
POSTGRES_PORT=
POSTGRES_USER=
POSTGRES_DB=
POSTGRES_PASSWORD=

# Port number that the server will be listening to.
PORT=

# Secret key that will be used to sign the JWT tokens.
JWT_SECRET=
  1. Once you got those things in place just run the following command.
# Start docker compose and the server
make docker-up run

# Run migrations
migrate -path ./migrations -database postgres://<db_user>:<db_user_password>@<host>/<database_name>?sslmode=disable up
## or
migrate -path ./migrations -database postgres://<db_user>:<db_user_password>@<host>/<database_name>?sslmode=disable down

πŸ”‘ License:

Directories ΒΆ

Path Synopsis
Package docs GENERATED BY SWAG; DO NOT EDIT This file was generated by swaggo/swag
Package docs GENERATED BY SWAG; DO NOT EDIT This file was generated by swaggo/swag
internal
pkg

Jump to

Keyboard shortcuts

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