Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: authentication autorization strategy with next auth and gqlgen #49

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
GO_ENV=development
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/stud42_dev
22 changes: 19 additions & 3 deletions .github/workflows/backend-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,37 @@ on:
- 'docs/**'

jobs:
applications-test-units:
name: Backend Tests 💻
linters:
name: Backend Linters 💻
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@v3
- name: Setup go
uses: actions/setup-go@v3
with:
go-version: '1.17'
go-version: '1.18'
check-latest: true
- name: Generate code
run: make -f build/Makefile generate
- name: golangci-lint
uses: golangci/golangci-lint-action@v3.1.0
with:
version: latest

tests:
name: Backend Tests 💻
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@v3
- name: Setup go
uses: actions/setup-go@v3
with:
go-version: '1.18'
check-latest: true
- name: Generate code
run: make -f build/Makefile generate
- name: Run Unit tests
run: |
go test ./... -coverprofile coverage.out -covermode count
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/frontend-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ jobs:

- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Generate code
run: yarn generate

- name: ESLint
run: yarn style:lint
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/sponsors-label.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ jobs:
run: |
echo "is_sponsor=$(gh api graphql -F owner=${{ env.repository_owner }} -F sponsor=${{ env.opener }} -f query='${{ env.REQUEST }}' --jq '.data.repositoryOwner.isSponsoredBy')" >> $GITHUB_ENV
- name: Assign Sponsor label to Issue
if: ${{ github.event_name == 'issues' }}
run: gh issue edit ${{ github.event.issue.number }} --add-label "sponsor 💖"
if: ${{ github.event_name == 'issues' && env.is_sponsor == 'true' }}
run: gh issue edit ${{ github.event.issue.number }} -R ${{ env.repository_owner }}/${{ env.repository_name }} --add-label "sponsor 💖"
- name: Assign Sponsor label to Pull Request
if: ${{ github.event_name == 'pull_request' }}
run: gh pr edit ${{ github.event.pull_request.number }} --add-label "sponsor 💖"
if: ${{ github.event_name == 'pull_request' && env.is_sponsor == 'true' }}
run: gh pr edit ${{ github.event.pull_request.number }} -R ${{ env.repository_owner }}/${{ env.repository_name }} --add-label "sponsor 💖"
25 changes: 15 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@
# Globals 🤖
# =================================================
# local env files
.env.local
.env.development.local
.env.test.local
.env.production.local
.env*
!.env.example

# Configuration Files
config/*
Expand All @@ -17,24 +15,33 @@ config/*
# Backend ignores 💻
# =================================================

# Generated code
internal/api/generated/*
internal/models/generated/*
internal/models/structs_generated.go

# =================================================
# Frontned ignores 🕹
# =================================================

# Generated code
web/ui/src/graphql/schema.json
web/ui/src/graphql/generated.ts

# dependencies
web/ui/node_modules
web/ui/*.pnp
web/ui/*.pnp.js

# testing
web/ui/*/coverage
web/ui/coverage

# next.js
web/ui/*/.next/
web/ui/*/out/
web/ui/.next/
web/ui/out/

# production
web/ui/*/build
web/ui/build

# misc
.DS_Store
Expand All @@ -45,8 +52,6 @@ web/ui/*npm-debug.log*
web/ui/*yarn-debug.log*
web/ui/*yarn-error.log*



# vercel
web/ui/*.vercel

Expand Down
1 change: 1 addition & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Login Error handling
Loading