Skip to content

lab-projects/go-arepas

This branch is 21 commits behind romelgomez/go-arepas:main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

1310bb7 Β· Sep 30, 2024

History

7 Commits
Sep 30, 2024
Sep 28, 2024
Sep 28, 2024
Sep 28, 2024
Sep 28, 2024
Sep 28, 2024
Sep 28, 2024
Sep 28, 2024
Sep 28, 2024
Sep 28, 2024
Sep 28, 2024
Sep 30, 2024
Sep 30, 2024
Sep 30, 2024
Sep 30, 2024
Sep 30, 2024
Sep 30, 2024
Sep 28, 2024
Sep 30, 2024
Sep 28, 2024
Sep 28, 2024
Sep 28, 2024
Sep 28, 2024

Repository files navigation

Go Arepas πŸ«“

Golang Prisma Postgresql Railway

Models

  • post

go run main.go

Generate the prisma lib

We do this step every time we edit the schema

go run github.com/steebchen/prisma-client-go generate dev

Migrate and deploy prima in the database

This command will create two file, one for preview other will implement that migration

go run github.com/steebchen/prisma-client-go migrate dev --preview-feature --create-only

This command will direct implement the migration without preview the sql

go run github.com/steebchen/prisma-client-go migrate dev

Project tree example

tree -I '.github|.trunk|prisma'

.
β”œβ”€β”€ README.md
β”œβ”€β”€ TODO.md
β”œβ”€β”€ api
β”‚   β”œβ”€β”€ v1
β”‚   β”‚   β”œβ”€β”€ account_routes.go
β”‚   β”‚   β”œβ”€β”€ address_routes.go
β”‚   β”‚   β”œβ”€β”€ category_routes.go
β”‚   β”‚   β”œβ”€β”€ listing_routes.go
β”‚   β”‚   β”œβ”€β”€ media_routes.go
β”‚   β”‚   β”œβ”€β”€ phone_routes.go
β”‚   β”‚   β”œβ”€β”€ post_routes.go
β”‚   β”‚   β”œβ”€β”€ publication_media_routes.go
β”‚   β”‚   β”œβ”€β”€ publication_routes.go
β”‚   β”‚   β”œβ”€β”€ role_routes.go
β”‚   β”‚   β”œβ”€β”€ user_media_routes.go
β”‚   β”‚   └── user_routes.go
β”‚   └── v2
β”œβ”€β”€ common
β”‚   └── web_reponse.go
β”œβ”€β”€ config
β”‚   └── database.go
β”œβ”€β”€ domain
β”‚   β”œβ”€β”€ account
β”‚   β”‚   β”œβ”€β”€ controller
β”‚   β”‚   β”‚   └── account_controller.go
β”‚   β”‚   β”œβ”€β”€ dto
β”‚   β”‚   β”‚   β”œβ”€β”€ account_create_dto.go
β”‚   β”‚   β”‚   β”œβ”€β”€ account_response_dto.go
β”‚   β”‚   β”‚   └── account_update_dto.go
β”‚   β”‚   β”œβ”€β”€ model
β”‚   β”‚   β”‚   └── account.go
β”‚   β”‚   β”œβ”€β”€ repository
β”‚   β”‚   β”‚   β”œβ”€β”€ account_repository.go
β”‚   β”‚   β”‚   └── account_repository_impl.go
β”‚   β”‚   └── service
β”‚   β”‚       β”œβ”€β”€ account_service.go
β”‚   β”‚       └── account_service_impl.go
β”‚   └── post
β”‚   β”‚   β”œβ”€β”€ controller
β”‚   β”‚   β”‚   └── post_controller.go
β”‚   β”‚   β”œβ”€β”€ dto
β”‚   β”‚   β”‚   β”œβ”€β”€ post_create.go
β”‚   β”‚   β”‚   β”œβ”€β”€ post_respose.go
β”‚   β”‚   β”‚   └── post_update_request.go
β”‚   β”‚   β”œβ”€β”€ model
β”‚   β”‚   β”‚   └── post.go
β”‚   β”‚   β”œβ”€β”€ repository
β”‚   β”‚   β”‚   β”œβ”€β”€ post_repository.go
β”‚   β”‚   β”‚   └── post_repository_impl.go
β”‚   β”‚   └── service
β”‚   β”‚       β”œβ”€β”€ post_service.go
β”‚   β”‚       └── post_service_impl.go
β”œβ”€β”€ go-arepas
β”œβ”€β”€ go.mod
β”œβ”€β”€ go.sum
β”œβ”€β”€ helper
β”‚   β”œβ”€β”€ error.go
β”‚   └── json.go
β”œβ”€β”€ main.go
β”œβ”€β”€ router
β”‚   └── router.go
β”œβ”€β”€ thunder-collection_go-prisma.json
└── trunk

CORS

In your .env file or environment settings, define the allowed origins for different environments.

In dev

CORS_ALLOWED_ORIGINS=http://localhost:3000,http://localhost:4322,http://localhost:8080
CORS_ALLOWED_METHODS=GET,POST,PUT,DELETE,OPTIONS
CORS_ALLOWED_HEADERS=Content-Type,Authorization

In production, you would set the CORS_ALLOWED_ORIGINS to your actual domain(s):

CORS_ALLOWED_ORIGINS=https://your-astro-client.com,https://your-android-client.com,https://your-ios-client.com

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 47.2%
  • Go 42.2%
  • Makefile 8.9%
  • Dockerfile 1.7%