{"id":19477299,"url":"https://github.com/nikkhvat/go-portfolio-back","last_synced_at":"2025-02-25T16:25:17.204Z","repository":{"id":41144799,"uuid":"439177156","full_name":"nikkhvat/go-portfolio-back","owner":"nikkhvat","description":"A project developed in golang. PostgreSQL as a database. GORM as an ORM. Core GIN Framewor. Back-end for open source website goportfolio","archived":false,"fork":false,"pushed_at":"2023-04-08T14:32:52.000Z","size":248,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-08T06:41:44.129Z","etag":null,"topics":["golang"],"latest_commit_sha":null,"homepage":"https://goportfolio.nik19ta.pro","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nikkhvat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2021-12-17T01:39:02.000Z","updated_at":"2023-09-25T06:01:25.000Z","dependencies_parsed_at":"2023-09-18T18:27:12.566Z","dependency_job_id":null,"html_url":"https://github.com/nikkhvat/go-portfolio-back","commit_stats":null,"previous_names":["nikkhvat/go-portfolio-back"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikkhvat%2Fgo-portfolio-back","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikkhvat%2Fgo-portfolio-back/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikkhvat%2Fgo-portfolio-back/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikkhvat%2Fgo-portfolio-back/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nikkhvat","download_url":"https://codeload.github.com/nikkhvat/go-portfolio-back/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240702604,"owners_count":19843952,"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":["golang"],"created_at":"2024-11-10T19:44:17.293Z","updated_at":"2025-02-25T16:25:17.177Z","avatar_url":"https://github.com/nikkhvat.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Back-end for goportfolio.nik19ta.pro\n\n## About the project\n\nA highly focused portfolio content management system\n\n- wiew my profile on [just-portfolio](https://goportfolio.nik19ta.pro/nik19ta)\n- wiew [front-end](https://github.com/nik19ta/goportfolio-front) reposit repository on github\n\n### Tools\n\n- Lang - GoLang\n- Framework - Gin\n- ORM - GORM\n- DB - PostgreSQL\n\n### DB Schame\n\n![Schame](./README/db.png)\n\n## How to run \n\n1. Get go packeges `go get`\n2. Make .env file `make env-prepare`\n2. Make images folder `make image-prepare`\n3. Create postgres schema: `just_portfolio`\n4. Build `make build`\n5. Start `make start`\n\n## How to run (Docker)\n\n1. replace `postgres_host` field in env file from  `localhost` to `fullstack-postgres`\n2. build docker `docker-compose build`\n3. run docker `docker-compose up -d`\n\n## Make as service (Ubuntu 20.04)\n\n1. make file `portfolio.service` into `/etc/systemd/system`\n\n2. paste code into `/etc/systemd/system/portfolio.service`\n\n```service\n[Unit]\nDescription=just-portfolio.com\nConditionPathExists=/home/user/just-portfolio/back-end\nAfter=network.target\n\n[Service]\nWorkingDirectory=/home/user/just-portfolio/back-end\nExecStart=/home/user/just-portfolio/back-end/.bin/app\n\nRestart=on-failure\nRestartSec=10\n\nStandardOutput=syslog\nStandardError=syslog\nSyslogIdentifier=appgoservice\n\n[Install]\nWantedBy=multi-user.target\n```\n\n3. start service `sudo service portfolio restart`\n4. you can wiew status `sudo service portfolio status`\n\n## Configuration Nginx \n\n1. create file /etc/nginx/sites-available/just-portfolio.com.conf \n\n2. paste the code \n\n```nginx\nserver {\n    listen 80;\n    listen [::]:80;\n\n    server_name just-portfolio.com www.just-portfolio.com;\n    return 301 https://just-portfolio.com$request_uri;\n}\n\nserver {\n    listen 443 ssl http2;\n    listen [::]:443 ssl http2;\n\n    server_name www.just-portfolio.com;\n    return 301 https://just-portfolio.com$request_uri;\n\n    ssl_certificate /etc/letsencrypt/live/just-portfolio.com/fullchain.pem;\n    ssl_certificate_key /etc/letsencrypt/live/just-portfolio.com/privkey.pem;\n    ssl_trusted_certificate /etc/letsencrypt/live/just-portfolio.com/chain.pem;\n\n    include snippets/ssl-params.conf;\n}\n\nserver {\n    listen 443 ssl http2;\n    listen [::]:443 ssl http2;\n\n    server_name just-portfolio.com;\n    root /var/www/just-portfolio.com/html;\n    index index.html index.xml;\n\n    location / {\n      try_files $uri /index.html;\n    }\n\n    index index.html index.xml;\n \n    location /images {\n      proxy_pass http://localhost:3070;\n    }\n\n    location /api {\n      proxy_pass http://localhost:3070;\n    }\n\n    ssl_certificate /etc/letsencrypt/live/just-portfolio.com/fullchain.pem;\n    ssl_certificate_key /etc/letsencrypt/live/just-portfolio.com/privkey.pem;\n    ssl_trusted_certificate /etc/letsencrypt/live/just-portfolio.com/chain.pem;\n\n    include snippets/ssl-params.conf;\n}\n```\n\n\u003e for https you need to make letsencrypt certificates\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikkhvat%2Fgo-portfolio-back","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnikkhvat%2Fgo-portfolio-back","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikkhvat%2Fgo-portfolio-back/lists"}