Skip to content

Commit

Permalink
🎨 Change project structure of backend
Browse files Browse the repository at this point in the history
  • Loading branch information
harehare committed Dec 3, 2024
1 parent 3f5fc3f commit 783f612
Show file tree
Hide file tree
Showing 36 changed files with 731 additions and 398 deletions.
4 changes: 2 additions & 2 deletions backend/gqlgen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ model:
autobind: []
models:
Item:
model: github.com/harehare/textusm/internal/domain/model/item/diagramitem.DiagramItem
model: github.com/harehare/textusm/internal/domain/model/diagramitem.DiagramItem
GistItem:
model: github.com/harehare/textusm/internal/domain/model/item/gistitem.GistItem
model: github.com/harehare/textusm/internal/domain/model/gistitem.GistItem
ShareCondition:
model: github.com/harehare/textusm/internal/domain/model/share.ShareCondition
Diagram:
Expand Down
65 changes: 30 additions & 35 deletions backend/internal/app/wire.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,13 @@ import (
"github.com/harehare/textusm/internal/app/server"
"github.com/harehare/textusm/internal/config"
"github.com/harehare/textusm/internal/db"
"github.com/harehare/textusm/internal/domain/service"
"github.com/harehare/textusm/internal/domain/service/diagramitem"
"github.com/harehare/textusm/internal/domain/service/gistitem"
"github.com/harehare/textusm/internal/domain/service/settings"
"github.com/harehare/textusm/internal/github"
firebaseItemRepo "github.com/harehare/textusm/internal/infra/firebase/item"
firebaseSettingsRepo "github.com/harehare/textusm/internal/infra/firebase/settings"
firebaseShareRepo "github.com/harehare/textusm/internal/infra/firebase/share"
userRepo "github.com/harehare/textusm/internal/infra/firebase/user"
postgresItemRepo "github.com/harehare/textusm/internal/infra/postgres/item"
postgresSettingsRepo "github.com/harehare/textusm/internal/infra/postgres/settings"
postgresShareRepo "github.com/harehare/textusm/internal/infra/postgres/share"
sqliteItemRepo "github.com/harehare/textusm/internal/infra/sqlite/item"
sqliteSettingsRepo "github.com/harehare/textusm/internal/infra/sqlite/settings"
sqliteShareRepo "github.com/harehare/textusm/internal/infra/sqlite/share"
"github.com/harehare/textusm/internal/infra/firebase"
"github.com/harehare/textusm/internal/infra/postgres"
"github.com/harehare/textusm/internal/infra/sqlite"
"github.com/harehare/textusm/internal/presentation/api"
resolver "github.com/harehare/textusm/internal/presentation/graphql"
)
Expand All @@ -42,14 +37,14 @@ func InitializeFirebaseServer() (*http.Server, func(), error) {
provideGithubClientID,
provideGithubClientSecret,
db.NewFirestoreTx,
firebaseItemRepo.NewFirestoreItemRepository,
firebaseItemRepo.NewFirestoreGistItemRepository,
firebaseSettingsRepo.NewFirestoreSettingsRepository,
firebaseShareRepo.NewFirestoreShareRepository,
userRepo.NewFirebaseUserRepository,
service.NewService,
service.NewGistService,
service.NewSettingsService,
firebase.NewItemRepository,
firebase.NewGistItemRepository,
firebase.NewSettingsRepository,
firebase.NewShareRepository,
firebase.NewUserRepository,
diagramitem.NewService,
gistitem.NewService,
settings.NewService,
resolver.New,
api.New,
handler.NewHandler,
Expand All @@ -64,14 +59,14 @@ func InitializePostgresServer() (*http.Server, func(), error) {
provideGithubClientID,
provideGithubClientSecret,
db.NewPostgresTx,
postgresItemRepo.NewPostgresItemRepository,
postgresItemRepo.NewPostgresGistItemRepository,
postgresSettingsRepo.NewPostgresSettingsRepository,
postgresShareRepo.NewPostgresShareRepository,
userRepo.NewFirebaseUserRepository,
service.NewService,
service.NewGistService,
service.NewSettingsService,
postgres.NewItemRepository,
postgres.NewGistItemRepository,
postgres.NewSettingsRepository,
postgres.NewShareRepository,
firebase.NewUserRepository,
diagramitem.NewService,
gistitem.NewService,
settings.NewService,
resolver.New,
api.New,
handler.NewHandler,
Expand All @@ -86,14 +81,14 @@ func InitializeSqliteServer() (*http.Server, func(), error) {
provideGithubClientID,
provideGithubClientSecret,
db.NewDBTx,
sqliteItemRepo.NewSqliteItemRepository,
sqliteItemRepo.NewSqliteGistItemRepository,
sqliteSettingsRepo.NewSqliteSettingsRepository,
sqliteShareRepo.NewSqliteShareRepository,
userRepo.NewFirebaseUserRepository,
service.NewService,
service.NewGistService,
service.NewSettingsService,
sqlite.NewItemRepository,
sqlite.NewGistItemRepository,
sqlite.NewSettingsRepository,
sqlite.NewShareRepository,
firebase.NewUserRepository,
diagramitem.NewService,
gistitem.NewService,
settings.NewService,
resolver.New,
api.New,
handler.NewHandler,
Expand Down
77 changes: 36 additions & 41 deletions backend/internal/app/wire_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package item
package diagramitem

import (
"context"

"github.com/harehare/textusm/internal/domain/model/item/diagramitem"
"github.com/harehare/textusm/internal/domain/model/diagramitem"
"github.com/samber/mo"
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package item
package gistitem

import (
"context"

"github.com/harehare/textusm/internal/domain/model/item/gistitem"
"github.com/harehare/textusm/internal/domain/model/gistitem"
"github.com/samber/mo"
)

Expand Down
2 changes: 1 addition & 1 deletion backend/internal/domain/repository/share/share.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package share
import (
"context"

"github.com/harehare/textusm/internal/domain/model/item/diagramitem"
"github.com/harehare/textusm/internal/domain/model/diagramitem"
shareModel "github.com/harehare/textusm/internal/domain/model/share"
"github.com/samber/mo"
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package service
package diagramitem

import (
"context"
Expand All @@ -17,9 +17,9 @@ import (
jwt "github.com/form3tech-oss/jwt-go"
"github.com/harehare/textusm/internal/context/values"
"github.com/harehare/textusm/internal/db"
"github.com/harehare/textusm/internal/domain/model/item/diagramitem"
"github.com/harehare/textusm/internal/domain/model/diagramitem"
shareModel "github.com/harehare/textusm/internal/domain/model/share"
itemRepo "github.com/harehare/textusm/internal/domain/repository/item"
itemRepo "github.com/harehare/textusm/internal/domain/repository/diagramitem"
shareRepo "github.com/harehare/textusm/internal/domain/repository/share"
userRepo "github.com/harehare/textusm/internal/domain/repository/user"
e "github.com/harehare/textusm/internal/error"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package service
package diagramitem

import (
"context"
Expand All @@ -9,7 +9,7 @@ import (

jwt "github.com/form3tech-oss/jwt-go"
"github.com/harehare/textusm/internal/context/values"
"github.com/harehare/textusm/internal/domain/model/item/diagramitem"
"github.com/harehare/textusm/internal/domain/model/diagramitem"
sm "github.com/harehare/textusm/internal/domain/model/share"
um "github.com/harehare/textusm/internal/domain/model/user"
shareRepo "github.com/harehare/textusm/internal/domain/repository/share"
Expand Down
Loading

0 comments on commit 783f612

Please sign in to comment.