{"id":17183349,"url":"https://github.com/teodutu/sprc","last_synced_at":"2026-04-09T16:14:42.803Z","repository":{"id":121179200,"uuid":"303376537","full_name":"teodutu/SPRC","owner":"teodutu","description":"Sisteme de Programe pentru Retele de Calculatoare - UPB 2020-2021","archived":false,"fork":false,"pushed_at":"2021-12-05T15:51:53.000Z","size":171,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-25T02:40:32.737Z","etag":null,"topics":["docker","docker-compose","http","http-client","http-server","microservices","mqtt","remote-procedure-call","rest","rest-api","rpc"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/teodutu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-12T11:55:09.000Z","updated_at":"2023-10-15T20:34:39.000Z","dependencies_parsed_at":"2024-06-12T01:46:50.866Z","dependency_job_id":null,"html_url":"https://github.com/teodutu/SPRC","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/teodutu/SPRC","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teodutu%2FSPRC","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teodutu%2FSPRC/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teodutu%2FSPRC/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teodutu%2FSPRC/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/teodutu","download_url":"https://codeload.github.com/teodutu/SPRC/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teodutu%2FSPRC/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260288463,"owners_count":22986666,"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":["docker","docker-compose","http","http-client","http-server","microservices","mqtt","remote-procedure-call","rest","rest-api","rpc"],"created_at":"2024-10-15T00:40:19.330Z","updated_at":"2026-04-09T16:14:42.758Z","avatar_url":"https://github.com/teodutu.png","language":"Java","readme":"# SPRC\nSisteme de Programe pentru Retele de Calculatoare - UPB 2020-2021\n\n## Laboratoare\n### Laborator 1 - HTTP\n#### Task 1\nSe trimite un `POST` request catre `https://sprc.dfilip.xyz/lab1/task1/check`\ncu headerul `secret2: SPRCisBest`, parametrii `nume=\u003cnume\u003e\u0026grupa=\u003cgrupa\u003e` si\ndatele `secret: SPRCisNice` encodate ca `form`. Se obtine urmatorul raspuns,\nce contine si tokenul JWT cerut:\n```json\n{\n    \"status\": \"ok\",\n    \"proof\": \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ3aG8iOnsibnVtZSI6WyJUZW9kb3ItU3RlZmFuIER1dHUiXSwiZ3J1cGEiOlsiMzQxQzMiXX0sImRpZCI6InRhc2sxIn0.zP6gL5EOQBp-jc79FBa1Sughh2R-wwrA86pnMvQUGgk\"\n}\n```\n\n#### Task 2\nSe trimite o cerere `POST` catre `https://sprc.dfilip.xyz/lab1/task2` care\ncontine JSON-ul urmator:\n```json\n{\n\t\"username\": \"sprc\",\n\t\"password\": \"admin\",\n\t\"nume\": \u003cnume\u003e\n}\n```\nSe primeste urmatorul raspuns:\n```json\n{\n    \"status\": \"ok\",\n    \"proof\": \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ3aG8iOnsibnVtZSI6IlRlb2Rvci1TdGVmYW4gRHV0dSJ9LCJkaWQiOiJ0YXNrMiJ9.k_kcAPhC78_NmVEq1u2VTphmSPZFusWY8igZnp47qLc\"\n}\n```\n\n#### Task 3\nSe foloseste requestul de la [Task 2](#task-2) pentru a se initia o sesiune\ncatre `https://sprc.dfilip.xyz/lab1/task3/login`. A\ndoua cerere HTTPS din aceasta sesiune reprezinta o cerere `GET` catre\n`https://sprc.dfilip.xyz/lab1/task3/check`, in urma careia se primeste\nraspunsul:\n```json\n{\n    \"status\": \"ok\",\n    \"proof\": \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ3aG8iOnsibnVtZSI6IlRlb2Rvci1TdGVmYW4gRHV0dSJ9LCJkaWQiOiJ0YXNrMyJ9.K8Oxp2wINIkScaOiepDnSbMmLz_bPS5lsugFe1mBHzM\"\n}\n```\n\n\n### Laborator 2 - RPC\nSe implementeaza perechi de clienti si servere *RPC* folosind API-ul `rpc` din\nPOSIX.\n\n#### Get Sum\nServerul calculeaza suma a 2 numere. Duh...\n\n#### Check\nSe implementeaza doar clientul care trimite catre `sprc2.dfilip.xyz` un *RPC* ce\nare ca parametru o structura care contine 2 stringuri: `nume` si `grupa`, iar\nserverul intoarce `Well done \u003cnume\u003e (\u003cgrupa\u003e)`.\n\n#### Closest Prime\nClientul ii da serverului un numar, iar serverul intoarce numarul prim cel mai\napropiat de cel primit de la client. Serverul foloseste\n[ciurul lui Atkin](https://en.wikipedia.org/wiki/Sieve_of_Atkin) (luat din\n[tema la AA](https://github.com/teodutu/PA/blob/master/Teme/Tema1_AA/tester.cpp)\n) pentru a verifica daca un numar este prim in `O(1)`.\n\n#### Remote Shell\nServerul actioneaza ca un shell remote permitand clientilor sa ruleze comenzi pe\nacesta. Fiind vorba despre *RPC*, shellul este *stateless*, iar lungimea\noutputului comenzii este setata de catre client (maximum `8192` octeti).\n\n\n### Laborator 3 - REST Web Server\nSe implementeaza, folosind [Flask](https://flask.palletsprojects.com/en/1.1.x/),\nun server web care gestioneaza o colectie de filme si suporta metodele `GET`,\n`POST`, `PUT`, `DELETE`.\n\n\n### Laborator 4 - Docker\nNimicuri cu dockere. Pana acum era mai misto.\n\n#### Task 1\nSe descarca fisierele necesare de\n[aici](https://static.dfilip.xyz/sprc_lab_docker_task1.zip), dupa care se\ncreeaza dockerul cu `sudo docker build . -t task1`. Apoi se ruleaza dockerul\ncreat legandu-l la portul `8080` al hostului astfel:\n```bash\nsudo docker run -it -p 8080:80 task1\n```\n\n#### Task 2\nSe creeaza o suita de servicii capabile sa stocheze date persistent, folosind\n`docker-compose`.\n\n\n### Laborator 5 - MQTT\nSe foloseste protocolul [MQTT](https://mqtt.org/) pentru a simula un chat de\n*IRC* practic :))) Protocolul functioneaza pe baza modelului\n*Publisher-Subscriber*. Topicul la care clientul se aboneaza este\n`chat/sprc/#`, iar cel pe care publica este `chat/sprc/\u003cNumeStudent\u003e`.\n\nAlt lab degeaba.\n\n\n### Laborator 6 - Web Cache in Java\nPrimul lab mai de Doamne-ajuta. Se modifica cache-ul **LRU** dat in schelet cu\nunul **LFU** si se adauga o serie de cereri web care sa demonstreze aceasta\npolitica.\n\n\n\n## Teme\n### Tema 1 - RPC\nSe implementeaza o aplicatie client-server care gestioneaza o baza de date.\nServerul retine baza de date atat in fisiere cat si in memorie, iar clientii\npot efectua actiuni asupra acesteia prin intermediul unor *RPC*-uri descrise\nin `README`-ul temei.\n\n\n### Tema 2 - Docker + microservicii\nSe implementeaza o aplicatie web (kms) care gestioneaza o baza de date ce\ncontine temperaturi masurate la anumite coordonate. Fiecare coordonata e\nasociata unui oras, care si el se afla la randul lui intr-o tara. Aplicatia\nsuporta metodele `GET`, `POST`, `PUT` si `DELETE` ce permit modificarea\ntabelelor ce contin tarile, orasele si temperaturile, cu mentiunea ca stergerile\nse fac in cascada.\n\nDe asemenea, aplicatia contine si un GUI\n([mysql-workbench](https://hub.docker.com/r/linuxserver/mysql-workbench)) cu\ncare se poate inspecta baza de date. Toate componentele sunt create in cadrul\nunor containere folosind `docker-compose`.\n\nPe scurt, tema e un jeg in care e mai mult *BD* si bulaneala in\n`docker-compose.yml` decat cod scris pe bune...\n\n### Tema 3 - Tot docker...\nCam la fel ca tema 2, dar cu *InfluxDB* in loc de *MySQL* si cu\n[Grafana](https://grafana.com/) in loc de *mysql-workbench*. Practic aceeasi\nmizerie ca la tema 2, dar cu un cancer extra, adica *Grafana*... De ce pula mea\nfacem la *SPRC* mai mult BD decat orice altceva?\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteodutu%2Fsprc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fteodutu%2Fsprc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteodutu%2Fsprc/lists"}