Skip to content

Commit 8259cde

Browse files
committed
still changing
still making changes to public codebase Signed-off-by: tobigiwa <[email protected]>
1 parent 5bd25bb commit 8259cde

19 files changed

+74
-73
lines changed

Diff for: .gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
bin/
2-
vendor/
2+
vendor/
3+
.env

Diff for: BlockRideLogo.png

-2.31 KB
Binary file not shown.

Diff for: Dockerfile

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ COPY go.mod go.sum ./
1111

1212
COPY . .
1313

14-
RUN CGO_ENABLED=0 GOOS=linux go build -mod vendor -o /app/blockride cmd/blockride/main.go
14+
RUN CGO_ENABLED=0 GOOS=linux go build -mod vendor -o /app/companyXYZ cmd/companyXYZ/main.go
1515

1616
FROM alpine
1717

1818
WORKDIR /
1919

20-
COPY --from=builder /app/blockride /blockride
20+
COPY --from=builder /app/companyXYZ /companyXYZ
2121

22-
RUN chmod +x blockride
22+
RUN chmod +x companyXYZ
2323

24-
ENTRYPOINT [ "/blockride" ]
24+
ENTRYPOINT [ "/companyXYZ" ]

Diff for: README.MD

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
![Logo](/templ/BlockRideLogo.png)
1+
![Logo](/templ/companyXYZLogo.png)
22

33
# Waitlist Backend
44

Diff for: cmd/blockride/main.go renamed to cmd/companyXYZ/main.go

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package main
22

33
import (
4-
"Blockride-waitlistAPI/env"
5-
blockride "Blockride-waitlistAPI/http"
6-
"Blockride-waitlistAPI/internal/store"
4+
"companyXYZ-waitlistAPI/env"
5+
companyXYZ "companyXYZ-waitlistAPI/http"
6+
"companyXYZ-waitlistAPI/internal/store"
77
"context"
88
"errors"
99
"log"
@@ -16,20 +16,20 @@ import (
1616

1717
"strings"
1818

19-
"Blockride-waitlistAPI/docs"
19+
"companyXYZ-waitlistAPI/docs"
2020

2121
"go.mongodb.org/mongo-driver/bson"
2222
"go.mongodb.org/mongo-driver/mongo"
2323
"go.mongodb.org/mongo-driver/mongo/options"
2424
)
2525

26-
// @title BlockRide waitlist-backend
27-
// @description BlockRide waitlist-backend API endpoints.
26+
// @title companyXYZ waitlist-backend
27+
// @description companyXYZ waitlist-backend API endpoints.
2828
// @x-logo {"url": "https://example.com/img.png", "backgroundColor": "#000000", "altText": "example logo", "href": "https://example.com/img.png"}
2929
//
30-
// contact.name BlockRide
30+
// contact.name companyXYZ
3131
//
32-
// @contact.url https://www.blockride.xyz/
32+
// @contact.url https://www.companyXYZ.xyz/
3333
//
3434
// contact.email [email protected]
3535
//
@@ -62,7 +62,7 @@ func main() {
6262
)
6363

6464
uri = "mongodb://localhost:27017/"
65-
if env.GetEnvVar().Server.Env == blockride.Production {
65+
if env.GetEnvVar().Server.Env == companyXYZ.Production {
6666
uri = env.BuildURI(
6767
env.GetEnvVar().Databases.Mongo.Username,
6868
env.GetEnvVar().Databases.Mongo.Password,
@@ -87,7 +87,7 @@ func main() {
8787
log.Println("MongoDB collection indexed by `email` field successfully")
8888

8989
// setup Application Server
90-
app := blockride.NewApplication(mongoDbCollection, logger)
90+
app := companyXYZ.NewApplication(mongoDbCollection, logger)
9191

9292
srv := &http.Server{
9393
Addr: ":" + env.GetEnvVar().Server.Port,

Diff for: docs/docs.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const docTemplate = `{
1010
"description": "{{escape .Description}}",
1111
"title": "{{.Title}}",
1212
"contact": {
13-
"url": "https://www.blockride.xyz/"
13+
"url": "https://www.companyXYZ.xyz/"
1414
},
1515
"version": "{{.Version}}",
1616
"x-logo": {
@@ -44,7 +44,7 @@ const docTemplate = `{
4444
],
4545
"responses": {
4646
"200": {
47-
"description": "REDIRECT TO BLOCKRIDE HOMEPAGE",
47+
"description": "REDIRECT TO companyXYZ HOMEPAGE",
4848
"schema": {
4949
"type": "string"
5050
}
@@ -118,7 +118,7 @@ const docTemplate = `{
118118
"parameters": [
119119
{
120120
"type": "string",
121-
"description": "Users any preferred name",
121+
"description": "user any preferred name",
122122
"name": "name",
123123
"in": "formData",
124124
"required": true
@@ -202,8 +202,8 @@ var SwaggerInfo = &swag.Spec{
202202
Host: "",
203203
BasePath: "",
204204
Schemes: []string{},
205-
Title: "BlockRide waitlist-backend",
206-
Description: "BlockRide waitlist-backend API endpoints.",
205+
Title: "companyXYZ waitlist-backend",
206+
Description: "companyXYZ waitlist-backend API endpoints.",
207207
InfoInstanceName: "swagger",
208208
SwaggerTemplate: docTemplate,
209209
LeftDelim: "{{",

Diff for: docs/swagger.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"swagger": "2.0",
33
"info": {
4-
"description": "BlockRide waitlist-backend API endpoints.",
5-
"title": "BlockRide waitlist-backend",
4+
"description": "companyXYZ waitlist-backend API endpoints.",
5+
"title": "companyXYZ waitlist-backend",
66
"contact": {
7-
"url": "https://www.blockride.xyz/"
7+
"url": "https://www.companyXYZ.xyz/"
88
},
99
"x-logo": {
1010
"altText": "example logo",
@@ -35,7 +35,7 @@
3535
],
3636
"responses": {
3737
"200": {
38-
"description": "REDIRECT TO BLOCKRIDE HOMEPAGE",
38+
"description": "REDIRECT TO companyXYZ HOMEPAGE",
3939
"schema": {
4040
"type": "string"
4141
}
@@ -109,7 +109,7 @@
109109
"parameters": [
110110
{
111111
"type": "string",
112-
"description": "Users any preferred name",
112+
"description": "user any preferred name",
113113
"name": "name",
114114
"in": "formData",
115115
"required": true

Diff for: docs/swagger.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ externalDocs:
1212
description: OpenAPI
1313
info:
1414
contact:
15-
url: https://www.blockride.xyz/
16-
description: BlockRide waitlist-backend API endpoints.
17-
title: BlockRide waitlist-backend
15+
url: https://www.companyXYZ.xyz/
16+
description: companyXYZ waitlist-backend API endpoints.
17+
title: companyXYZ waitlist-backend
1818
x-logo:
1919
altText: example logo
2020
backgroundColor: '#000000'
@@ -34,7 +34,7 @@ paths:
3434
- application/json
3535
responses:
3636
"200":
37-
description: REDIRECT TO BLOCKRIDE HOMEPAGE
37+
description: REDIRECT TO companyXYZ HOMEPAGE
3838
schema:
3939
type: string
4040
"400":
@@ -79,7 +79,7 @@ paths:
7979
- application/x-www-form-urlencoded
8080
description: sends user registration email
8181
parameters:
82-
- description: Users any preferred name
82+
- description: user any preferred name
8383
in: formData
8484
name: name
8585
required: true

Diff for: go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module Blockride-waitlistAPI
1+
module companyXYZ-waitlistAPI
22

33
go 1.21.4
44

Diff for: http/handlers.go

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package http
22

33
import (
4-
"Blockride-waitlistAPI/env"
5-
"Blockride-waitlistAPI/internal/store"
4+
"companyXYZ-waitlistAPI/env"
5+
"companyXYZ-waitlistAPI/internal/store"
66
"context"
77
"encoding/json"
88
"errors"
@@ -20,7 +20,7 @@ import (
2020
// @Accept x-www-form-urlencoded
2121
// @Produce json
2222
// @Success 200 {string} string "OK"
23-
// @Param name formData string true "Users any preferred name"
23+
// @Param name formData string true "user any preferred name"
2424
// @Param email formData string true "valid email address" Format(email)
2525
// @Param country formData string true "country"
2626
// @Param splWalletAddr formData string true "SPL wallet Address"
@@ -67,8 +67,8 @@ func (a Application) waitListHandler(w http.ResponseWriter, r *http.Request) {
6767
}
6868

6969
if a.repository.CheckIfUserExist(subscriber) {
70-
w.Header().Set("Location", "https://www.blockride.xyz/")
71-
http.Redirect(w, r, "https://www.blockride.xyz/", http.StatusConflict)
70+
w.Header().Set("Location", "https://www.companyXYZ.xyz/")
71+
http.Redirect(w, r, "https://www.companyXYZ.xyz/", http.StatusConflict)
7272
return
7373
}
7474

@@ -84,8 +84,8 @@ func (a Application) waitListHandler(w http.ResponseWriter, r *http.Request) {
8484
return
8585
}
8686

87-
w.Header().Set("Location", "https://www.blockride.xyz/")
88-
http.Redirect(w, r, "https://www.blockride.xyz/", http.StatusOK)
87+
w.Header().Set("Location", "https://www.companyXYZ.xyz/")
88+
http.Redirect(w, r, "https://www.companyXYZ.xyz/", http.StatusOK)
8989
}
9090

9191
// ConfirmAndSaveHandler
@@ -95,7 +95,7 @@ func (a Application) waitListHandler(w http.ResponseWriter, r *http.Request) {
9595
// @Tags application
9696
// @Produce json
9797
// @Param k query string true "BASE64 ENCODED STRING"
98-
// @Success 200 {string} string "REDIRECT TO BLOCKRIDE HOMEPAGE"
98+
// @Success 200 {string} string "REDIRECT TO companyXYZ HOMEPAGE"
9999
// @Failure 400 {string} string "CLIENT ERROR: BAD REQUEST, KEY MISSING IN REQUEST"
100100
// @Failure 404 {string} string "CLIENT ERROR: NOT FOUND, LINK/KEY EXPIRED"
101101
// @Failure 409 {string} string "CLIENT ERROR: USER WITH EMAIL ALREADY EXIST"
@@ -127,18 +127,18 @@ func (a Application) confirmAndSaveHandler(w http.ResponseWriter, r *http.Reques
127127

128128
if err := a.repository.SaveToDb(user); err != nil {
129129
if strings.Contains(err.Error(), "duplicate key error") {
130-
w.Header().Set("Location", "https://www.blockride.xyz/")
131-
http.Redirect(w, r, "https://www.blockride.xyz/", http.StatusConflict)
130+
w.Header().Set("Location", "https://www.companyXYZ.xyz/")
131+
http.Redirect(w, r, "https://www.companyXYZ.xyz/", http.StatusConflict)
132132
return
133133
}
134-
134+
135135
a.serverError(w)
136136
a.logger.LogAttrs(context.TODO(), slog.LevelError, err.Error())
137137
return
138138
}
139139

140-
w.Header().Set("Location", "https://www.blockride.xyz/")
141-
http.Redirect(w, r, "https://www.blockride.xyz/", http.StatusOK)
140+
w.Header().Set("Location", "https://www.companyXYZ.xyz/")
141+
http.Redirect(w, r, "https://www.companyXYZ.xyz/", http.StatusOK)
142142
}
143143

144144
type ServerStatus struct {

Diff for: http/helpers.go

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package http
22

33
import (
4-
"Blockride-waitlistAPI/env"
5-
"Blockride-waitlistAPI/internal/store"
6-
"Blockride-waitlistAPI/templ"
74
"bytes"
5+
"companyXYZ-waitlistAPI/env"
6+
"companyXYZ-waitlistAPI/internal/store"
7+
"companyXYZ-waitlistAPI/templ"
88
"crypto/aes"
99
"crypto/cipher"
1010
"crypto/rand"
@@ -26,27 +26,27 @@ type templData struct {
2626
func sendConfirmationMail(name, email, key string) error {
2727

2828
var (
29-
from = env.GetEnvVar().Mail.EmailAcc
30-
tpl bytes.Buffer
31-
s = templData{Name: name, Key: key}
32-
data []byte
33-
err error
29+
from = env.GetEnvVar().Mail.EmailAcc
30+
tpl bytes.Buffer
31+
s = templData{Name: name, Key: key}
32+
data []byte
33+
err error
3434
)
35-
35+
3636
m := gomail.NewMessage()
3737
m.SetHeader("From", from)
3838
m.SetHeader("To", email)
39-
m.SetHeader("Subject", "BlockRide Confirmation mail")
39+
m.SetHeader("Subject", "companyXYZ Confirmation mail")
4040

4141
if err = prepareMail(s, &tpl); err != nil {
4242
return err
4343
}
4444

45-
if data, err = templ.BlockRideLogo.ReadFile("BlockRideLogo.png"); err != nil {
45+
if data, err = templ.CompanyXYZLogo.ReadFile("companyXYZLogo.png"); err != nil {
4646
return err
4747
}
48-
m.Attach("BlockRideLogo.png", gomail.SetHeader(map[string][]string{
49-
"Content-ID": {"BlockRideLogo"},
48+
m.Attach("companyXYZLogo.png", gomail.SetHeader(map[string][]string{
49+
"Content-ID": {"companyXYZLogo"},
5050
}), gomail.SetCopyFunc(func(w io.Writer) error {
5151
_, err := w.Write(data)
5252
return err

Diff for: http/routes.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package http
22

33
import (
4-
"Blockride-waitlistAPI/env"
4+
"companyXYZ-waitlistAPI/env"
55
"net/http"
66
"time"
77

@@ -13,8 +13,8 @@ import (
1313
)
1414

1515
const (
16-
blockrideHOMEURL string = "https://www.blockride.xyz/"
17-
Production string = "production"
16+
companyXYZHOMEURL string = "https://www.companyXYZ.xyz/"
17+
Production string = "production"
1818
)
1919

2020
func (a Application) Routes() *chi.Mux {
@@ -51,5 +51,5 @@ func (a Application) Routes() *chi.Mux {
5151
}
5252

5353
func AllowOriginFunc(r *http.Request, origin string) bool {
54-
return origin == blockrideHOMEURL
54+
return origin == companyXYZHOMEURL
5555
}

Diff for: http/server.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package http
22

33
import (
4-
"Blockride-waitlistAPI/internal/store"
4+
"companyXYZ-waitlistAPI/internal/store"
55
"log/slog"
66

77
"go.mongodb.org/mongo-driver/mongo"

Diff for: http/validation.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package http
22

33
import (
4-
"Blockride-waitlistAPI/internal/store"
4+
"companyXYZ-waitlistAPI/internal/store"
55

66
solana "github.com/blocto/solana-go-sdk/common"
77
"github.com/go-playground/validator/v10"

Diff for: makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
BINARY_NAME=BlockRide
1+
BINARY_NAME=companyXYZ
22

33
run:
44
@echo "Running server"
@@ -10,15 +10,15 @@ tidy:
1010

1111
build:
1212
@echo "Building binary"
13-
@go build -o bin/${BINARY_NAME} cmd/blockride/main.go
13+
@go build -o bin/${BINARY_NAME} cmd/companyXYZ/main.go
1414

1515
test:
1616
@echo "Running all test"
1717
@go test ./... -v
1818

1919
swagger:
2020
@echo "Generating swagger"
21-
@swag init -d cmd/blockride/,http/
21+
@swag init -d cmd/companyXYZ/,http/
2222
@swag fmt --exclude internal/,templ/,env/
2323

2424

Diff for: templ/BlockRideLogo.png

-2.31 KB
Binary file not shown.

Diff for: templ/companyXYZLogo.png

13.2 KB
Loading

0 commit comments

Comments
 (0)