Projeyi calistirmak icin oncelikle su bagimliliklarini kurmaniz gerekmektedir.
- Docker
- minikube
- kubectl
Kurulum icin sirasi ile su adimlari izleyin
- Minikube baslat
minikube start
- Postgres namespace'i olusturun ve minikube cluster'ina kurun ve kontrol edin
kubectl create namespace postgres
kubectl apply -f k8s/postgres.yaml -n postgres
kubectl get pod -n postgres
- Redis namespace'i olusturun ve minikube cluster'ina kurun
kubectl create namespace redis
kubectl apply -f k8s/redis.yaml -n redis
kubectl get pod -n redis
- Phishy core api'i icin namespace olusturun ve minikube cluster'ina kurun
kubectl create namespace phishy
kubectl apply -f k8s/phishy.yaml -n phishy
kubectl get pod -n phishy
- Phishy worker api'i icin namespace olusturun ve minikube cluster'ina kurun
kubectl create namespace phishy-worker
kubectl apply -f k8s/phishy-worker.yaml -n phishy-worker
kubectl get pod -n phishy-worker
Ve son olarakda locale'inizden istek atabilmeniz icin port forwarding yapacagiz
kubectl port-forward svc/phishy 8080:80 -n phishy
Eger redisi redis-comander
gibi bir uygulamadan takip etmek istiyorsaniz kubernates deki redisinde portunu forward'lamaniz gerekiyor
kubectl port-forward svc/redis-service 6379:6379 -n redis
sonrasinda redis-commander
i calistirip redisi takip edebilirsiniz.
Proje ci\cd veya bir ara yuze sahip degildir. Worker'in linki
Projeyi basit komutlarla test edebilmek icin gereken endpointler ve istekler assagida listelenmektedir. Proje restAPI'a uyumlu gelistirilmistir. Diger crud endpointlerde mevcuttur.
curl --location 'localhost:8080/targets' \
--header 'Content-Type: application/json' \
--data '{
"fullName": "mesa2",
"email": "memesa2"
}'
curl --location 'localhost:8080/targets' \
--data ''
curl --location 'localhost:8080/campaigns' \
--header 'Content-Type: application/json' \
--data '{
"name": "camp1",
"description": "camp1desc"
}'
curl --location 'localhost:8080/campaigns' \
--data ''
curl --location 'localhost:8080/campaigns/1/add_target' \
--header 'Content-Type: application/json' \
--data '{
"targetId": 1
}'
curl --location --request POST 'localhost:8080/campaigns/1/launch' \
--header 'Content-Type: application/json' \
--data ''
curl --location 'localhost:8080/campaigns/1/schedule' \
--header 'Content-Type: application/json' \
--data '{"scheduledTime": "2024-01-27T20:27:00.000Z"}'
Not: Buradaki tarihi bilgisayar saatinizin 3 saat oncesine gore ayarlarsaniz kisa surede test edebilirsiniz.