Skip to content

Commit

Permalink
Move from backend to . (#8)
Browse files Browse the repository at this point in the history
* Move from backend to .

* Remove /backend from go mod path

---------

Co-authored-by: Valentin Zwerschke <vallezw@gmail.com>
  • Loading branch information
pavelzw and vallezw committed May 4, 2023
1 parent 636f819 commit cf8e8a6
Show file tree
Hide file tree
Showing 32 changed files with 48 additions and 47 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Build and push
uses: docker/build-push-action@v3
with:
context: ./backend
context: .
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion backend/Dockerfile → Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RUN go mod download
COPY ./ ./

# todo add tests
# RUN CGO_ENABLED=1 go test -timeout 30s -v github.com/RomManager/server/backend/tests
# RUN CGO_ENABLED=1 go test -timeout 30s -v github.com/RomManager/server/tests

RUN mkdir /app
RUN CGO_ENABLED=1 go build \
Expand Down
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,22 @@ Will be using [go.rice](https://github.com/GeertJohan/go.rice) to connect web-cl

Automate with npm script or something like that

`docker run --rm -p 8080:8080 ghcr.io/rommanager/server:edge`
`docker run --rm -p 8080:8080 ghcr.io/rommanager/server:edge`

## Backend
-- To be extended --

The backend is written in go with gin and gorm

`cd backend`

`go run *.go`

To run it with live reloading use [air](https://github.com/cosmtrek/air)

`air`


For the Images and game information we use the [SteamGridDB Api](https://www.steamgriddb.com/api/v2). Create a key and set it in the `.env`

`STEAMGRIDDBAPIKEY="yourapikey"`
17 changes: 0 additions & 17 deletions backend/README.md

This file was deleted.

File renamed without changes.
8 changes: 4 additions & 4 deletions backend/controllers/auth.go → controllers/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import (
"fmt"
"net/http"

"github.com/RomManager/server/backend/models"
"github.com/RomManager/server/backend/request_types"
"github.com/RomManager/server/backend/utils"
"github.com/RomManager/server/backend/utils/token"
"github.com/RomManager/server/models"
"github.com/RomManager/server/request_types"
"github.com/RomManager/server/utils"
"github.com/RomManager/server/utils/token"
"github.com/gin-gonic/gin"
)

Expand Down
2 changes: 1 addition & 1 deletion backend/controllers/home.go → controllers/home.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package controllers
import (
"net/http"

"github.com/RomManager/server/backend/roms"
"github.com/RomManager/server/roms"
"github.com/gin-gonic/gin"
)

Expand Down
4 changes: 2 additions & 2 deletions backend/controllers/rom.go → controllers/rom.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"net/http"
"strconv"

"github.com/RomManager/server/backend/models"
"github.com/RomManager/server/backend/utils"
"github.com/RomManager/server/models"
"github.com/RomManager/server/utils"
"github.com/gin-gonic/gin"
)

Expand Down
4 changes: 2 additions & 2 deletions backend/controllers/routes.go → controllers/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package controllers
import (
"fmt"

"github.com/RomManager/server/backend/config"
"github.com/RomManager/server/backend/middlewares"
"github.com/RomManager/server/config"
"github.com/RomManager/server/middlewares"
"github.com/gin-gonic/gin"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package controllers
import (
"net/http"

"github.com/RomManager/server/backend/roms"
"github.com/RomManager/server/roms"
"github.com/gin-gonic/gin"
)

Expand Down
2 changes: 1 addition & 1 deletion backend/go.mod → go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/RomManager/server/backend
module github.com/RomManager/server

go 1.19

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion backend/gridapi/setup.go → gridapi/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"io"
"net/http"

"github.com/RomManager/server/backend/config"
"github.com/RomManager/server/config"
"github.com/fatih/color"
)

Expand Down
10 changes: 5 additions & 5 deletions backend/main.go → main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ package main
import (
"fmt"

"github.com/RomManager/server/backend/config"
"github.com/RomManager/server/backend/controllers"
"github.com/RomManager/server/backend/gridapi"
"github.com/RomManager/server/backend/models"
"github.com/RomManager/server/backend/roms"
"github.com/RomManager/server/config"
"github.com/RomManager/server/controllers"
"github.com/RomManager/server/gridapi"
"github.com/RomManager/server/models"
"github.com/RomManager/server/roms"
)

func main() {
Expand Down
4 changes: 2 additions & 2 deletions backend/middlewares/auth.go → middlewares/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"errors"
"net/http"

"github.com/RomManager/server/backend/utils"
"github.com/RomManager/server/backend/utils/token"
"github.com/RomManager/server/utils"
"github.com/RomManager/server/utils/token"
"github.com/gin-gonic/gin"
)

Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion backend/models/setup.go → models/setup.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package models

import (
"github.com/RomManager/server/backend/config"
"github.com/RomManager/server/config"
"github.com/fatih/color"
"gorm.io/driver/sqlite"
"gorm.io/gorm"
Expand Down
2 changes: 1 addition & 1 deletion backend/models/user.go → models/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"errors"
"time"

"github.com/RomManager/server/backend/utils/token"
"github.com/RomManager/server/utils/token"
"golang.org/x/crypto/bcrypt"
"gorm.io/gorm"
)
Expand Down
2 changes: 1 addition & 1 deletion backend/request_types/auth.go → request_types/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"errors"
"fmt"

"github.com/RomManager/server/backend/utils"
"github.com/RomManager/server/utils"
)

type LoginRequest struct {
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions backend/roms/synchronization.go → roms/synchronization.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (
"strings"
"time"

"github.com/RomManager/server/backend/config"
"github.com/RomManager/server/backend/gridapi"
"github.com/RomManager/server/backend/models"
"github.com/RomManager/server/backend/utils"
"github.com/RomManager/server/config"
"github.com/RomManager/server/gridapi"
"github.com/RomManager/server/models"
"github.com/RomManager/server/utils"
"github.com/fatih/color"
)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion backend/utils/token/token.go → utils/token/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"strings"
"time"

"github.com/RomManager/server/backend/config"
"github.com/RomManager/server/config"
jwt "github.com/dgrijalva/jwt-go"
"github.com/gin-gonic/gin"
)
Expand Down

0 comments on commit cf8e8a6

Please sign in to comment.