Skip to content

Commit

Permalink
Implement initial schema.resolvers.go
Browse files Browse the repository at this point in the history
  • Loading branch information
yasuflatland-lf committed Jul 9, 2024
1 parent 2b706eb commit 0ddf44d
Show file tree
Hide file tree
Showing 15 changed files with 456 additions and 215 deletions.
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
# Framingo Armond
Tinder like Flashcard App
Tinder like Flashcard App.

# Environment
This repository is structured as a mono repository.

| Directroy | Discription |
|:--|:--|
|frontend | frontend implementation |
|backend| backend GraphQL API server |

## frontend
- Typescript
- React
- Vite

## backend
- Go
- Echo
-
# Run Locally
```
docker compose up --build
Expand Down
6 changes: 6 additions & 0 deletions backend/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
PG_HOST=localhost
PG_USER=your_db_user
PG_PASSWORD=your_db_password
PG_DBNAME=your_db_name
PG_PORT=5432
PG_SSLMODE=disable
8 changes: 6 additions & 2 deletions backend/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,14 @@ ENVS = \
update: ## Update go.mod
go mod tidy

.PHONY: gen
gen: ## Generate GraphQL implementations
.PHONY: clear_gen
clear_gen: ## Clear GraphQL implementations
printf "${GREEN} Clean up files\n\n"; \
cd ./graph; rm -fR generated.go resolver.go schema.resolvers.go model; cd ${ORG_PATH} ; \
printf "${GREEN}Done\n"; \

.PHONY: gen
gen: ## Generate GraphQL implementations
printf "${GREEN} Update gqlgen\n\n"; \
go get github.com/99designs/gqlgen@latest; cd ${ORG_PATH} ; \
printf "${GREEN} Generating GraphQL related sources\n\n"; \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ CREATE TABLE cards
ON DELETE CASCADE
);

CREATE TABLE cardgroups_users
CREATE TABLE cardgroup_users
(
cardgroup_id INTEGER NOT NULL,
user_id TEXT NOT NULL,
Expand All @@ -48,7 +48,7 @@ CREATE TABLE roles
name TEXT NOT NULL UNIQUE
);

CREATE TABLE users_roles
CREATE TABLE user_roles
(
user_id TEXT NOT NULL,
role_id INTEGER NOT NULL,
Expand Down
3 changes: 2 additions & 1 deletion backend/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ go 1.22.5

require (
github.com/99designs/gqlgen v0.17.49
github.com/caarlos0/env/v11 v11.1.0
github.com/gorilla/websocket v1.5.0
github.com/labstack/echo/v4 v4.12.0
github.com/stretchr/testify v1.9.0
github.com/testcontainers/testcontainers-go v0.31.0
Expand Down Expand Up @@ -36,7 +38,6 @@ require (
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect
Expand Down
2 changes: 2 additions & 0 deletions backend/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ github.com/andybalholm/cascadia v1.3.2 h1:3Xi6Dw5lHF15JtdcmAHD3i1+T8plmv7BQ/nsVi
github.com/andybalholm/cascadia v1.3.2/go.mod h1:7gtRlve5FxPPgIgX36uWBX58OdBsSS6lUvCFb+h7KvU=
github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0 h1:jfIu9sQUG6Ig+0+Ap1h4unLjW6YQJpKZVmUzxsD4E/Q=
github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdKJDJF9BV14lnkjHmOQgcvEKgtqs5a1N3LNdJhGE=
github.com/caarlos0/env/v11 v11.1.0 h1:a5qZqieE9ZfzdvbbdhTalRrHT5vu/4V1/ad1Ka6frhI=
github.com/caarlos0/env/v11 v11.1.0/go.mod h1:LwgkYk1kDvfGpHthrWWLof3Ny7PezzFwS4QrsJdHTMo=
github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM=
github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
github.com/containerd/containerd v1.7.15 h1:afEHXdil9iAm03BmhjzKyXnnEBtjaLJefdU7DV0IFes=
Expand Down
Loading

0 comments on commit 0ddf44d

Please sign in to comment.