Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
# Conflicts:
#	.github/workflows/ci.yml
#	.gitignore
#	README.md
#	api/service.go
#	api/service_mock.go
#	cmd/capture/cloudbuild.yaml
#	cmd/dlqcapture/cloudbuild.yaml
#	cmd/server/cloudbuild.yaml
#	cmd/sitemap/cloudbuild.yaml
#	cmd/thumb/cloudbuild.yaml
#	deployments/acme-issue.yaml
#	deployments/mongodb.yaml
#	deployments/private-registry-secret.yaml
#	deployments/secrets.yaml
#	go.mod
#	go.sum
#	internal/infra/algolia.go
#	internal/infra/algolia_mock.go
#	internal/infra/anaconda.go
#	internal/infra/anaconda_mock.go
#	pkg/browser/service_test.go
#	pkg/content/repository.go
#	pkg/content/repository_mock.go
#	pkg/content/service_test.go
#	pkg/resolver/gen_interfaces.go
#	pkg/resolver/mutation_test.go
#	pkg/resolver/query_test.go
#	pkg/search/service_test.go
#	pkg/tweet/repository.go
#	pkg/tweet/repository_mock.go
#	pkg/tweet/service_test.go
#	pkg/user/repository.go
#	pkg/user/repository_mock.go
#	pkg/user/service_test.go
#	tools.go
#	web/app/src/pages/HomePage.tsx
  • Loading branch information
rayyildiz committed Feb 3, 2024
2 parents 52b1195 + 1044b40 commit 922244e
Show file tree
Hide file tree
Showing 38 changed files with 849 additions and 3,106 deletions.
19 changes: 11 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ on:
- main

env:
RELEASE: 1.0.0
RELEASE: 1.3.0

permissions:
contents: write


jobs:
build:
Expand All @@ -26,7 +30,7 @@ jobs:
restore-keys: |
${{ runner.os }}-go-
- uses: actions/setup-go@v3
- uses: actions/setup-go@v4
with:
go-version: 'stable'
cache: true
Expand All @@ -35,23 +39,22 @@ jobs:

- run: go test -cover -coverprofile=coverage.txt -covermode=atomic ./...

- uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}

- name: Set Short SHA
id: vars
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"

- name: Create Sentry release
uses: getsentry/action-release@v1.1.5
- uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
with:
version: ${{ env.RELEASE }}

- uses: actions/go-dependency-submission@v1
with:
go-mod-path: go.mod

# - name: Upload Test Results As Artifact
# uses: actions/upload-artifact@v2
# if: always()
Expand Down
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,8 @@ test_report.zip
test_report/
*.exe
.gitignore~
..gitignore.un~
..gitignore.un~
..bfg-report/
bfg.jar
private.txt
.DS_Store
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 Ramazan AYYILDIZ

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# CaptureTweet

![Build status](https://github.com/rayyildiz/capture-tweet/workflows/build/badge.svg)
![Build status](https://github.com/rayyildiz/capture-tweet/workflows/pull-request/badge.svg)
[![codecov](https://codecov.io/gh/rayyildiz/capture-tweet/branch/main/graph/badge.svg?token=58YR43PZFS)](https://codecov.io/gh/rayyildiz/capture-tweet)
[![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=rayyildiz/capture-tweet&identifier=272198663)](https://dependabot.com)
[![build](https://github.com/rayyildiz/capture-tweet/actions/workflows/ci.yml/badge.svg)](https://github.com/rayyildiz/capture-tweet/actions/workflows/ci.yml)
[![pull-request](https://github.com/rayyildiz/capture-tweet/actions/workflows/pr.yml/badge.svg)](https://github.com/rayyildiz/capture-tweet/actions/workflows/pr.yml)
[![Security Scan](https://github.com/rayyildiz/capture-tweet/actions/workflows/security_scan.yml/badge.svg)](https://github.com/rayyildiz/capture-tweet/actions/workflows/security_scan.yml)

I am going to close capturetweet on 31.12.2023, which I started at Starbucks to try [cloud run](https://cloud.google.com/run) features,
in accordance with [Twitter's pricing policy](https://www.engadget.com/twitter-announces-new-api-pricing-including-a-limited-free-tier-for-bots-005251253.html).
Anyone who wishes can deploy the application to the GCP cloud run. All necessary [CI /CD pipelines](.github/workflows/ci.yml) are ready.

## How

Expand Down Expand Up @@ -33,14 +36,14 @@ ALGOLIA_INDEX=tweets-LOCAL

## RoadMap

- [x] Create skeleton project
- [x] Create a skeleton project
- [x] Add graphql support.
- [x] Tweet Service
- [x] CRUD for tweet service
- [x] Use algolia for search
- [x] Store user additional data in a different collection.
- [x] Async capture
- [x] Pubsub support
- [x] PubSub support
- [x] Capture and update collection
- [x] New UI design
- [x] Apollo client support
Expand Down
2 changes: 1 addition & 1 deletion api/service.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//go:generate go run github.com/golang/mock/mockgen -package=api -self_package=capturetweet.com/api -destination=service_mock.go . UserService,TweetService,SearchService,BrowserService,ContentService
//go:generate go run go.uber.org/mock/mockgen@latest -package=api -self_package=capturetweet.com/api -destination=service_mock.go . UserService,TweetService,SearchService,BrowserService,ContentService
package api

import (
Expand Down
35 changes: 20 additions & 15 deletions api/service_mock.go

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

2 changes: 1 addition & 1 deletion cmd/capture/cloudbuild.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
steps:
- name: 'golang:1.20'
- name: 'golang:1.21'
args: [ 'go', 'build', '-a', '-installsuffix','cgo', '-o' ,'tmp/app','.' ]
env:
- 'GO111MODULE=on'
Expand Down
2 changes: 1 addition & 1 deletion cmd/dlqcapture/cloudbuild.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
steps:
- name: 'golang:1.20'
- name: 'golang:1.21'
args: [ 'go', 'build', '-a', '-installsuffix','cgo', '-o' ,'tmp/app','.' ]
env:
- 'GO111MODULE=on'
Expand Down
2 changes: 1 addition & 1 deletion cmd/server/cloudbuild.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
steps:
- name: 'golang:1.20'
- name: 'golang:1.21'
args: [ 'go', 'build', '-a', '-installsuffix','cgo', '-o' ,'tmp/app','.' ]
env:
- 'GO111MODULE=on'
Expand Down
2 changes: 1 addition & 1 deletion cmd/sitemap/cloudbuild.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
steps:
- name: 'golang:1.20'
- name: 'golang:1.21'
args: [ 'go', 'build', '-a', '-installsuffix','cgo', '-o' ,'tmp/app','.' ]
env:
- 'GO111MODULE=on'
Expand Down
2 changes: 1 addition & 1 deletion cmd/thumb/cloudbuild.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
steps:
- name: 'golang:1.20'
- name: 'golang:1.21'
args: [ 'go', 'build', '-a', '-installsuffix','cgo', '-o' ,'tmp/app','.' ]
env:
- 'GO111MODULE=on'
Expand Down
2 changes: 1 addition & 1 deletion deployments/acme-issue.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
namespace: istio-system
spec:
acme:
email: rayyildiz+acme@gmail.com
email: acme@example.com
server: https://acme-v02.api.letsencrypt.org/directory
privateKeySecretRef:
name: letsencrypt-secret-prod
Expand Down
4 changes: 2 additions & 2 deletions deployments/mongodb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ spec:
cpu: 150m
env:
- name: MONGO_INITDB_ROOT_USERNAME
value: "OVzXseTlsKLu9HVn7zS9t1Wh59bEOe"
value: "***REMOVED***"
- name: MONGO_INITDB_ROOT_PASSWORD
value: "XYEbHtCbT97HOETfvbmuIuJToWdzl8"
value: "***REMOVED***"
volumeClaimTemplates:
- metadata:
name: mongodb-data
Expand Down
2 changes: 1 addition & 1 deletion deployments/private-registry-secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ metadata:
namespace: capturetweet
type: kubernetes.io/dockerconfigjson
data:
.dockerconfigjson: eyJhdXRocyI6eyJyYXl5aWxkaXouYXp1cmVjci5pbyI6eyJ1c2VybmFtZSI6InJheXlpbGRpeiIsInBhc3N3b3JkIjoia3pTNmtjeEduaVBWaXBNSjc5dGZ6SVcrRkc1a0dINWkiLCJlbWFpbCI6InJheXlpbGRpekBnbWFpbC5jb20iLCJhdXRoIjoiY21GNWVXbHNaR2w2T210NlV6WnJZM2hIYm1sUVZtbHdUVW8zT1hSbWVrbFhLMFpITld0SFNEVnAifX19
.dockerconfigjson: ***REMOVED***
18 changes: 9 additions & 9 deletions deployments/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ metadata:
namespace: capturetweet
type: Opague
stringData:
MONGO_SERVER_URL: "mongodb://OVzXseTlsKLu9HVn7zS9t1Wh59bEOe:XYEbHtCbT97HOETfvbmuIuJToWdzl8@mongodb:27017"
TWITTER_ACCESS_SECRET: "Go7JpRneIVTQgvzVdWVi0om053J1NRq1sxlnEpYLgaF6T"
TWITTER_ACCESS_TOKEN: "13364212-WtFt7DIq7pOWfvarZ6zxe230EAnki46l8WKtWRu0a"
TWITTER_CONSUMER_KEY: "rczgdgKIGv6u2Ss1Dgyx0yu3w"
TWITTER_CONSUMER_SECRET: "7Ses3kCBBIZfP8aaFGahPLpJKriTcIk9If4tjQhuXjClOj0l7G"
MONGO_SERVER_URL: "mongodb://***REMOVED***:***REMOVED***@mongodb:27017"
TWITTER_ACCESS_SECRET: "***REMOVED***"
TWITTER_ACCESS_TOKEN: "***REMOVED***"
TWITTER_CONSUMER_KEY: "***REMOVED***"
TWITTER_CONSUMER_SECRET: "***REMOVED***"
GRAPHQL_ENABLE_PLAYGROUND: "false"
ALGOLIA_SECRET: "4290904ad9d2294d5cf0ceab96c60570"
ALGOLIA_CLIENT_ID: "F2V8C0P3PU"
ALGOLIA_SECRET: "***REMOVED***"
ALGOLIA_CLIENT_ID: "***REMOVED***"
ALGOLIA_INDEX: "tweets-K8S"
DOCSTORE_TWEETS: "mongo://capturetweet/tweets?id_field=id"
DOCSTORE_USERS: "mongo://capturetweet/authors?id_field=id"
DOCSTORE_CONTACT_US: "mongo://capturetweet/contactUs?id_field=id"
TOPIC_CAPTURE: "nats://capture.request"
NATS_SERVER_URL: "nats://nats-svc:4222"
SENDGRID_TEMPLATE_ID: "d-8110a54bed1d4268bafbdac8bea22eea"
SENDGRID_APIKEY: "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"
SENDGRID_TEMPLATE_ID: "***REMOVED***"
SENDGRID_APIKEY: "***REMOVED***"
Loading

0 comments on commit 922244e

Please sign in to comment.