{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"174bf3b2-0e55-43a6-8f48-29bfbf94ee3c","name":"Tinitron Microservices API","description":"# Tinitron Microservices \n(Built for the CS 443 Course Project Group #9)\n\nShorten, create and share trusted, powerful links for your business. Tinitron helps you maximize the impact of every digital initiative.\n\n## Website\n[Tinitron](https://tinitron.cf)\n\n## Features\n- Observability and Monitoring\n   - Stackdriver Monitorning\n   - Stackdriver Logging\n   - Prometheus & Graphana Monitoring\n - Spring Boot Tinitron Example with Google Cloud Native configuration\n   - Spring Cloud GCP\n   - Removed Eureka, Hystrix, Ribbon, Config Server, Gateway, and many other components, because they are provided by       Kubernetes.\n - Security\n    - Firebase Authentication\n    - JWT Token verfication for API Endpoints\n    - Protected Links\n    - Password Encryption\n - DX\n   - RESTFul API Design Using Postman Guidelines\n   - Return meaningful HTTP response codes\n   - Documented Code & Postman Documentation\n\n##  Architecture\n![System Architecture](https://i.ibb.co/bLBDcrH/system-design.jpg)\n\n## API Documentation\n[Postman API Documentation](https://documenter.getpostman.com/view/8064086/Szmb5z6H)\n\n## Google Cloud Platform Project\nCreate a new Project if you haven't done so already.\n```\n$ export PROJECT_ID=...\n$ gcloud project create $PROJECT_ID\n```\n\nSet the default Project ID:\n```\n$ gcloud config set core/project $PROJECT_ID\n```\n\n## Kubernetes Engine Cluster\nUse `gcloud` to provision a multi-zone Kubernetes Engine cluster.\n\n```\n$ gcloud services enable compute.googleapis.com container.googleapis.com\n$ gcloud beta container clusters create tinitron-cluster \\\n    --cluster-version=1.10.5 \\\n    --region=us-central1 \\\n    --num-nodes=2 \\\n    --machine-type=n1-standard-2 \\\n    --enable-autorepair \\\n    --enable-stackdriver-kubernetes\n```\n\n## Stackdriver Prometheus Scraper\nInstall Prometheus scraper to propagate Prometheus metrics to Stackdriver Monitoring.\n\n```\n$ kubectl apply -f https://storage.googleapis.com/stackdriver-prometheus-documentation/rbac-setup.yml --as=admin --as-group=system:masters\n$ curl -s https://storage.googleapis.com/stackdriver-prometheus-documentation/prometheus-service.yml | \\\n  sed -e \"s/\\(\\s*_kubernetes_cluster_name:*\\).*/\\1 'petclinic-cluster'/g\" | \\\n  sed -e \"s/\\(\\s*_kubernetes_location:*\\).*/\\1 'us-central1'/g\" | \\\n  sed -e \"s/\\(\\s*_stackdriver_project_id:*\\).*/\\1 '${PROJECT_ID}'/g\" | \\\n  kubectl apply -f -\n```\n\n## Debugging and Profiling\n```\n$ gcloud services enable cloudprofiler.googleapis.com clouddebugger.googleapis.com\n```\n\n## Generate Service Account\nCreate a new Service Account for the microservices:\n```\n$ gcloud iam service-accounts create petclinic --display-name \"Tinitron Service Account\"\n```\n\nGrant IAM Roles to the Service Account:\n```\n$ gcloud projects add-iam-policy-binding $PROJECT_ID \\\n     --member serviceAccount:tinitron@$PROJECT_ID.iam.gserviceaccount.com \\\n     --role roles/cloudprofiler.agent\n$ gcloud projects add-iam-policy-binding $PROJECT_ID \\\n     --member serviceAccount:tinitron@$PROJECT_ID.iam.gserviceaccount.com \\\n     --role roles/clouddebugger.agent\n$ gcloud projects add-iam-policy-binding $PROJECT_ID \\\n     --member serviceAccount:tinitron@$PROJECT_ID.iam.gserviceaccount.com \\\n     --role roles/cloudtrace.agent\n$ gcloud projects add-iam-policy-binding $PROJECT_ID \\\n     --member serviceAccount:tinitron@$PROJECT_ID.iam.gserviceaccount.com \\\n     --role roles/spanner.databaseUser\n```\n\nCreate a new JSON Service Account Key. Keep it secure!\n```\n$ gcloud iam service-accounts keys create ~/tinitron-service-account.json \\\n    --iam-account tinitron@$PROJECT_ID.iam.gserviceaccount.com\n```\n\n## Build\n### Compile and Install to Maven\n```\n$ ./mvnw install\n```\n\n### Build Docker Images\nBuild all microservices:\n```\n$ ./mvnw clean compile jib:build\n```\n\n## Run\n### Spring Boot\n\n```\n$ ./mvnw clean spring-boot:run\n```\n\n### Kubernetes\nStore Service Account as a Kubenetes Secret:\n```\n$ kubectl create secret generic tinitron-credentials --from-file=$HOME/tinitron-service-account.json\n```\n\nDeploy Application:\n```\n$ kubectl apply -f ~/Tinitron-Microservices/kubernetes/\n```\n\n### Try It Out\nFind the Ingress IP address\n```\n$ kubectl get ingress\ntinitron-ingress   *         X.X.X.X   80        \n```\n\nOpen the browser to see if the app is working!\n\n## License\nTinitron is licensed under the GNU Public License, version 2.0. See [LICENSE](LICENSE) for more information.","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":false,"owner":"8064086","collectionId":"174bf3b2-0e55-43a6-8f48-29bfbf94ee3c","publishedId":"Szmb5z6H","public":true,"publicUrl":"https://documenter-api.postman.tech/view/8064086/Szmb5z6H","privateUrl":"https://go.postman.co/documentation/8064086-174bf3b2-0e55-43a6-8f48-29bfbf94ee3c","customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"documentationLayout":"classic-double-column","customisation":null,"version":"8.10.1","publishDate":"2020-05-04T11:52:31.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{},"logos":{}},"statusCode":200},"environments":[],"user":{"authenticated":false,"permissions":{"publish":false}},"run":{"button":{"js":"https://run.pstmn.io/button.js","css":"https://run.pstmn.io/button.css"}},"web":"https://www.getpostman.com/","team":{"logo":"https://res.cloudinary.com/postman/image/upload/t_team_logo_pubdoc/v1/team/768118b36f06c94b0306958b980558e6915839447e859fe16906e29d683976f0","favicon":""},"isEnvFetchError":false,"languages":"[{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"HttpClient\"},{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"RestSharp\"},{\"key\":\"curl\",\"label\":\"cURL\",\"variant\":\"cURL\"},{\"key\":\"dart\",\"label\":\"Dart\",\"variant\":\"http\"},{\"key\":\"go\",\"label\":\"Go\",\"variant\":\"Native\"},{\"key\":\"http\",\"label\":\"HTTP\",\"variant\":\"HTTP\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"OkHttp\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"Unirest\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"Fetch\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"jQuery\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"XHR\"},{\"key\":\"c\",\"label\":\"C\",\"variant\":\"libcurl\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Axios\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Native\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Request\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Unirest\"},{\"key\":\"objective-c\",\"label\":\"Objective-C\",\"variant\":\"NSURLSession\"},{\"key\":\"ocaml\",\"label\":\"OCaml\",\"variant\":\"Cohttp\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"cURL\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"Guzzle\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"HTTP_Request2\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"pecl_http\"},{\"key\":\"powershell\",\"label\":\"PowerShell\",\"variant\":\"RestMethod\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"http.client\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"Requests\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"httr\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"RCurl\"},{\"key\":\"ruby\",\"label\":\"Ruby\",\"variant\":\"Net::HTTP\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"Httpie\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"wget\"},{\"key\":\"swift\",\"label\":\"Swift\",\"variant\":\"URLSession\"}]","languageSettings":[{"key":"csharp","label":"C#","variant":"HttpClient"},{"key":"csharp","label":"C#","variant":"RestSharp"},{"key":"curl","label":"cURL","variant":"cURL"},{"key":"dart","label":"Dart","variant":"http"},{"key":"go","label":"Go","variant":"Native"},{"key":"http","label":"HTTP","variant":"HTTP"},{"key":"java","label":"Java","variant":"OkHttp"},{"key":"java","label":"Java","variant":"Unirest"},{"key":"javascript","label":"JavaScript","variant":"Fetch"},{"key":"javascript","label":"JavaScript","variant":"jQuery"},{"key":"javascript","label":"JavaScript","variant":"XHR"},{"key":"c","label":"C","variant":"libcurl"},{"key":"nodejs","label":"NodeJs","variant":"Axios"},{"key":"nodejs","label":"NodeJs","variant":"Native"},{"key":"nodejs","label":"NodeJs","variant":"Request"},{"key":"nodejs","label":"NodeJs","variant":"Unirest"},{"key":"objective-c","label":"Objective-C","variant":"NSURLSession"},{"key":"ocaml","label":"OCaml","variant":"Cohttp"},{"key":"php","label":"PHP","variant":"cURL"},{"key":"php","label":"PHP","variant":"Guzzle"},{"key":"php","label":"PHP","variant":"HTTP_Request2"},{"key":"php","label":"PHP","variant":"pecl_http"},{"key":"powershell","label":"PowerShell","variant":"RestMethod"},{"key":"python","label":"Python","variant":"http.client"},{"key":"python","label":"Python","variant":"Requests"},{"key":"r","label":"R","variant":"httr"},{"key":"r","label":"R","variant":"RCurl"},{"key":"ruby","label":"Ruby","variant":"Net::HTTP"},{"key":"shell","label":"Shell","variant":"Httpie"},{"key":"shell","label":"Shell","variant":"wget"},{"key":"swift","label":"Swift","variant":"URLSession"}],"languageOptions":[{"label":"C# - HttpClient","value":"csharp - HttpClient - C#"},{"label":"C# - RestSharp","value":"csharp - RestSharp - C#"},{"label":"cURL - cURL","value":"curl - cURL - cURL"},{"label":"Dart - http","value":"dart - http - Dart"},{"label":"Go - Native","value":"go - Native - Go"},{"label":"HTTP - HTTP","value":"http - HTTP - HTTP"},{"label":"Java - OkHttp","value":"java - OkHttp - Java"},{"label":"Java - Unirest","value":"java - Unirest - Java"},{"label":"JavaScript - Fetch","value":"javascript - Fetch - JavaScript"},{"label":"JavaScript - jQuery","value":"javascript - jQuery - JavaScript"},{"label":"JavaScript - XHR","value":"javascript - XHR - JavaScript"},{"label":"C - libcurl","value":"c - libcurl - C"},{"label":"NodeJs - Axios","value":"nodejs - Axios - NodeJs"},{"label":"NodeJs - Native","value":"nodejs - Native - NodeJs"},{"label":"NodeJs - Request","value":"nodejs - Request - NodeJs"},{"label":"NodeJs - Unirest","value":"nodejs - Unirest - NodeJs"},{"label":"Objective-C - NSURLSession","value":"objective-c - NSURLSession - Objective-C"},{"label":"OCaml - Cohttp","value":"ocaml - Cohttp - OCaml"},{"label":"PHP - cURL","value":"php - cURL - PHP"},{"label":"PHP - Guzzle","value":"php - Guzzle - PHP"},{"label":"PHP - HTTP_Request2","value":"php - HTTP_Request2 - PHP"},{"label":"PHP - pecl_http","value":"php - pecl_http - PHP"},{"label":"PowerShell - RestMethod","value":"powershell - RestMethod - PowerShell"},{"label":"Python - http.client","value":"python - http.client - Python"},{"label":"Python - Requests","value":"python - Requests - Python"},{"label":"R - httr","value":"r - httr - R"},{"label":"R - RCurl","value":"r - RCurl - R"},{"label":"Ruby - Net::HTTP","value":"ruby - Net::HTTP - Ruby"},{"label":"Shell - Httpie","value":"shell - Httpie - Shell"},{"label":"Shell - wget","value":"shell - wget - Shell"},{"label":"Swift - URLSession","value":"swift - URLSession - Swift"}],"layoutOptions":[{"value":"classic-single-column","label":"Single Column"},{"value":"classic-double-column","label":"Double Column"}],"versionOptions":[],"environmentOptions":[{"value":"0","label":"No Environment"}],"canonicalUrl":"https://documenter.gw.postman.com/view/metadata/Szmb5z6H"}