-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2a0a63a
commit 43e1833
Showing
45 changed files
with
18,663 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package lending | ||
|
||
import "go.uber.org/fx" | ||
|
||
func Module() fx.Option { | ||
return fx.Module("lending", | ||
fx.Invoke(NewLendingHandler), | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package lending | ||
|
||
import ( | ||
"log/slog" | ||
"net/http" | ||
|
||
"github.com/labstack/echo/v4" | ||
gossr "github.com/natewong1313/go-react-ssr" | ||
|
||
"github.com/marcopollivier/techagenda/lib/config" | ||
) | ||
|
||
func NewLendingHandler(server *echo.Echo) { | ||
cfg := config.Get() | ||
engine, err := gossr.New(gossr.Config{ | ||
AppEnv: cfg.Environment, | ||
AssetRoute: "/assets", | ||
FrontendDir: "./ui/src", | ||
GeneratedTypesPath: "./ui/src/generated.d.ts", | ||
TailwindConfigPath: "./ui/tailwind.config.js", | ||
LayoutCSSFilePath: "main.css", | ||
PropsStructsPath: "./pkg/lending/props.go", | ||
}) | ||
if err != nil { | ||
slog.Error("Fail to start SSR engine", "error", err) | ||
panic(err) | ||
} | ||
|
||
server.Static("/assets", "./ui/public/") | ||
|
||
server.GET("/v2", func(c echo.Context) (err error) { | ||
page := engine.RenderRoute(gossr.RenderConfig{ | ||
File: "pages/Lending.tsx", | ||
Title: "TechAgenda", | ||
MetaTags: map[string]string{ | ||
"og:title": "TechAgenda", | ||
"description": "A Tech Agenda é um projeto OpenSource que foi criado pensando em ajudar as pessoas a encontrarem eventos de tecnologia perto delas.", | ||
}, | ||
Props: &IndexRouteProps{ | ||
InitialCount: 171, | ||
}, | ||
}) | ||
return c.HTML(http.StatusOK, string(page)) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package lending | ||
|
||
import "github.com/marcopollivier/techagenda/pkg/event" | ||
|
||
type Props struct { | ||
Events []event.Event | ||
} | ||
|
||
type IndexRouteProps struct { | ||
InitialCount int `json:"initialCount"` | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
|
||
# testing | ||
/coverage | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* |
Oops, something went wrong.