{"id":28056364,"url":"https://github.com/webmakaka/microservices-with-node-js-and-react-improved","last_synced_at":"2025-05-12T06:10:41.066Z","repository":{"id":39131160,"uuid":"340768245","full_name":"webmakaka/Microservices-with-Node-JS-and-React-Improved","owner":"webmakaka","description":"[Stephen Grider] Microservices with Node JS and React [ENG, 2021]","archived":false,"fork":false,"pushed_at":"2023-01-01T16:08:02.000Z","size":192,"stargazers_count":31,"open_issues_count":36,"forks_count":24,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-08T00:35:13.058Z","etag":null,"topics":["curl","docker","helm","jest","kubernetes","microservices","minikube","mongodb","mongoose","nats-streaming-server","nextjs","nodejs","reactjs","skaffold","stripe","supertest","typescript","ubuntu"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/webmakaka.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-20T22:36:58.000Z","updated_at":"2025-04-13T05:59:04.000Z","dependencies_parsed_at":"2022-08-24T16:41:59.383Z","dependency_job_id":null,"html_url":"https://github.com/webmakaka/Microservices-with-Node-JS-and-React-Improved","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webmakaka%2FMicroservices-with-Node-JS-and-React-Improved","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webmakaka%2FMicroservices-with-Node-JS-and-React-Improved/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webmakaka%2FMicroservices-with-Node-JS-and-React-Improved/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webmakaka%2FMicroservices-with-Node-JS-and-React-Improved/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webmakaka","download_url":"https://codeload.github.com/webmakaka/Microservices-with-Node-JS-and-React-Improved/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253685226,"owners_count":21947308,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["curl","docker","helm","jest","kubernetes","microservices","minikube","mongodb","mongoose","nats-streaming-server","nextjs","nodejs","reactjs","skaffold","stripe","supertest","typescript","ubuntu"],"created_at":"2025-05-12T06:10:40.466Z","updated_at":"2025-05-12T06:10:41.061Z","avatar_url":"https://github.com/webmakaka.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [Stephen Grider] Microservices with Node JS and React [ENG, 2021]\n\n\u003cbr/\u003e\n\n### [Previous Version (close to original)](https://github.com/webmakaka/Microservices-with-Node-JS-and-React)\n\n\u003cbr/\u003e\n\n### Here we will develop only project 2 from course.\n\n\u003cbr/\u003e\n\n## Preparation\n\nI am working in ubuntu linux 20.04.\n\nMinikube, Kubectl, Docker, Skaffold should be installed.\n\n\u003cbr/\u003e\n\n```\n$ sudo apt install -y jq\n```\n\n\u003cbr/\u003e\n\n### Minikube setup\n\n```\n$ curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 \u0026\u0026 chmod +x minikube \u0026\u0026 sudo mv minikube /usr/local/bin/\n```\n\n\u003cbr/\u003e\n\n### Kubectl setup\n\n```\n$ curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl \u0026\u0026 chmod +x kubectl \u0026\u0026 sudo mv kubectl /usr/local/bin/\n```\n\n\u003cbr/\u003e\n\n### Skaffold setup\n\n```\n$ curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64 \u0026\u0026 chmod +x ./skaffold \u0026\u0026 sudo mv ./skaffold /usr/local/bin\n```\n\n\u003cbr/\u003e\n\n### Run minikube\n\n\u003cbr/\u003e\n\n```\n$ export \\\n    PROFILE=microservices-with-nodejs-and-react \\\n    MEMORY=8192 \\\n    CPUS=4 \\\n    DRIVER=docker \\\n    KUBERNETES_VERSION=v1.22.4\n```\n\n\u003cbr/\u003e\n\n```\n$ {\n    minikube --profile ${PROFILE} config set memory ${MEMORY}\n    minikube --profile ${PROFILE} config set cpus ${CPUS}\n    minikube --profile ${PROFILE} config set disk-size 20g\n\n    minikube --profile ${PROFILE} config set vm-driver ${DRIVER}\n\n    minikube --profile ${PROFILE} config set kubernetes-version ${KUBERNETES_VERSION}\n    minikube start --profile ${PROFILE} --embed-certs\n\n    // Enable ingress\n    minikube addons --profile ${PROFILE} enable ingress\n\n    // Enable registry\n    // minikube addons --profile ${PROFILE} enable registry\n}\n```\n\n\u003cbr/\u003e\n\n    $ minikube --profile ${PROFILE} ip\n    192.168.49.2\n\n\u003cbr/\u003e\n\n    $ sudo vi /etc/hosts\n\n```\n#---------------------------------------------------------------------\n# Minikube\n#---------------------------------------------------------------------\n192.168.49.2 ticketing.dev\n```\n\n\u003cbr/\u003e\n\n## How to run project in development mode (current version)\n\n\u003cbr/\u003e\n\n```\n$ kubectl create secret generic jwt-secret --from-literal=JWT_KEY=MY_JWT_SECRET\n```\n\n\u003cbr/\u003e\n\n**stripe.com**\n\nDevelopers --\u003e API keys\n\n\u003cbr/\u003e\n\n```\n// \u003cSTRIPE_SECRET_KEY\u003e from stripe.com\n$ kubectl create secret generic stripe-secret --from-literal=STRIPE_KEY=\u003cSTRIPE_SECRET_KEY\u003e\n```\n\n\u003cbr/\u003e\n\napp/client/src/pages/orders/[orderId].js\n\nSet your **stripeKey** (stripe public key) instead mine.\n\n\u003cbr/\u003e\n\n**Need to update baseURL (Ingress HostName).**\n\n/app/client/src/api\n\n\u003cbr/\u003e\n\n```\n// It will show after skaffold starts\n$ kubectl get ingress\nNAME          CLASS    HOSTS           ADDRESS        PORTS   AGE\ningress-svc   \u003cnone\u003e   ticketing.dev   192.168.49.2   80      8m41s\n```\n\n\u003cbr/\u003e\n\nTake ADDRESS and modify baseURL.\n\n\u003cbr/\u003e\n\nbaseURL should looks like:\n\n\u003cbr/\u003e\n\n```\n192-168-49-2.kubernetes.default.svc.cluster.local\n```\n\n\u003cbr/\u003e\n\n[more details](./docs/02-client-service.md)\n\n\u003cbr/\u003e\n\n    $ cd skaffold\n\n\u003c!--\n\n    $ docker login\n\n--\u003e\n\nNeed to update my docker image name webmakaka/microservices\\*\\*\\* to your in scripts from skaffold and k8s folders.\n\n    $ skaffold dev\n\n\u003cbr/\u003e\n\n```\n$ kubectl get pods\nNAME                                           READY   STATUS    RESTARTS   AGE\nauth-deployment-84bffc5564-cjqzt               1/1     Running   0          64s\nauth-mongo-deployment-57db5fc46f-9g7wh         1/1     Running   0          64s\nclient-deployment-77f9896bdb-zdwwg             1/1     Running   0          64s\nexpiration-deployment-69b678458d-l5w2p         1/1     Running   0          63s\nexpiration-redis-deployment-777554b4f8-vkttt   1/1     Running   0          63s\nnats-deployment-6486d9669f-lmv8p               1/1     Running   0          63s\norders-deployment-765c6cfc5b-kcjpr             1/1     Running   0          63s\norders-mongo-deployment-5997f95f7f-hzf4l       1/1     Running   0          63s\npayments-deployment-bff95d98c-qv6w4            1/1     Running   0          63s\npayments-mongo-deployment-7ccdb6f6c9-tqlzk     1/1     Running   0          63s\ntickets-deployment-79b9854cdf-5d8ld            1/1     Running   0          63s\ntickets-mongo-deployment-545dc7d7c5-md59k      1/1     Running   0          63s\n```\n\n\u003cbr/\u003e\n\nchrome browser -\u003e https://ticketing.dev/\n\n\u003cbr/\u003e\n\ntype: **thisisunsafe** in the browser window with security warning.\n\n\u003cbr/\u003e\n\n### Requests to app\n\n```\n// SIGN UP\n$ curl \\\n    --insecure \\\n    --cookie-jar /tmp/cookies.txt \\\n    --data '{\"email\":\"marley@example.com\", \"password\":\"123456789\"}' \\\n    --header \"Content-Type: application/json\" \\\n    --request POST \\\n    --url https://ticketing.dev/api/users/signup \\\n    | jq\n```\n\n\u003cbr/\u003e\n\n```\n// SIGN IN\n$ curl \\\n    --data '{\"email\":\"marley@example.com\", \"password\":\"123456789\"}' \\\n    --header \"Content-Type: application/json\" \\\n    --request POST \\\n    --url http://ticketing.dev/api/users/signin \\\n    | jq\n```\n\n\u003cbr/\u003e\n\n```\n// GET CURRENT USER\n$ curl \\\n    --insecure \\\n    --cookie /tmp/cookies.txt \\\n    --header \"Content-Type: application/json\" \\\n    --request GET \\\n    --url https://ticketing.dev/api/users/currentuser \\\n    | jq\n```\n\n\u003cbr/\u003e\n\n```\n// CREATE TICKET\n$ curl \\\n    --insecure \\\n    --cookie /tmp/cookies.txt \\\n    --data '{\"title\":\"concert\", \"price\":10}' \\\n    --header \"Content-Type: application/json\" \\\n    --request POST \\\n    --url https://ticketing.dev/api/tickets \\\n    | jq\n```\n\n\u003cbr/\u003e\n\n```\n// GET ALL TICKETS\n$ curl \\\n    --insecure \\\n    --header \"Content-Type: application/json\" \\\n    --request GET \\\n    --url https://ticketing.dev/api/tickets/ \\\n    | jq\n```\n\n\u003cbr/\u003e\n\n```\n// GET TICKET\n$ curl \\\n    --insecure \\\n    --header \"Content-Type: application/json\" \\\n    --request GET \\\n    --url https://ticketing.dev/api/tickets/6037eaacbcc4a0001acb6d50 \\\n    | jq\n```\n\n\u003cbr/\u003e\n\n```\n// UPDATE TICKET\n$ curl \\\n    --insecure \\\n    --cookie /tmp/cookies.txt \\\n    --data '{\"title\":\"new concert\", \"price\":100}' \\\n    --header \"Content-Type: application/json\" \\\n    --request PUT \\\n    --url https://ticketing.dev/api/tickets/603b0e8036b9f80019154277 \\\n    | jq\n```\n\n\u003cbr/\u003e\n\n```\n// CREATE ORDER\n$ curl \\\n    --insecure \\\n    --cookie /tmp/cookies.txt \\\n    --data '{\"ticketId\":\"604150ce9a43b7001a54b720\"}' \\\n    --header \"Content-Type: application/json\" \\\n    --request POST \\\n    --url https://ticketing.dev/api/orders \\\n    | jq\n```\n\n\u003cbr/\u003e\n\n```\n// GET ALL ORDERS\n$ curl \\\n    --insecure \\\n    --cookie /tmp/cookies.txt \\\n    --header \"Content-Type: application/json\" \\\n    --request GET \\\n    --url https://ticketing.dev/api/orders \\\n    | jq\n```\n\n\u003cbr/\u003e\n\n```\n// GET SINGLE ORDER\n$ curl \\\n    --insecure \\\n    --cookie /tmp/cookies.txt \\\n    --header \"Content-Type: application/json\" \\\n    --request GET \\\n    --url https://ticketing.dev/api/orders/604150e7d42b880019802e99 \\\n    | jq\n```\n\n\u003cbr/\u003e\n\n```\n// CREATE PAYMENT\n$ curl \\\n    --insecure \\\n    --cookie /tmp/cookies.txt \\\n    --data '{\"orderId\":\"5ec6c93f6c627e0023725faf\", \"token\": \"tok_visa\"}' \\\n    --header \"Content-Type: application/json\" \\\n    --request POST \\\n    --url https://ticketing.dev/api/payments/ \\\n    | jq\n```\n\n\u003cbr/\u003e\n\n### [Development](./docs/Development.md)\n\n\u003cbr/\u003e\n\n---\n\n\u003cbr/\u003e\n\n**Marley**\n\nAny questions in english: \u003ca href=\"https://jsdev.org/chat/\"\u003eTelegram Chat\u003c/a\u003e  \nЛюбые вопросы на русском: \u003ca href=\"https://jsdev.ru/chat/\"\u003eТелеграм чат\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebmakaka%2Fmicroservices-with-node-js-and-react-improved","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebmakaka%2Fmicroservices-with-node-js-and-react-improved","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebmakaka%2Fmicroservices-with-node-js-and-react-improved/lists"}