{"id":20494842,"url":"https://github.com/apiko-dev/apiko-2021-spring-course-api","last_synced_at":"2025-03-05T17:48:12.009Z","repository":{"id":48278229,"uuid":"388044062","full_name":"apiko-dev/apiko-2021-spring-course-api","owner":"apiko-dev","description":null,"archived":false,"fork":false,"pushed_at":"2022-12-23T08:49:07.000Z","size":135,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-01-16T06:12:08.187Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/apiko-dev.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-07-21T08:12:19.000Z","updated_at":"2022-12-13T08:05:07.000Z","dependencies_parsed_at":"2022-08-23T15:20:53.280Z","dependency_job_id":null,"html_url":"https://github.com/apiko-dev/apiko-2021-spring-course-api","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/apiko-dev%2Fapiko-2021-spring-course-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apiko-dev%2Fapiko-2021-spring-course-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apiko-dev%2Fapiko-2021-spring-course-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apiko-dev%2Fapiko-2021-spring-course-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apiko-dev","download_url":"https://codeload.github.com/apiko-dev/apiko-2021-spring-course-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242076654,"owners_count":20068234,"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":[],"created_at":"2024-11-15T17:43:23.752Z","updated_at":"2025-03-05T17:48:11.989Z","avatar_url":"https://github.com/apiko-dev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Apiko 2021 spring courses API\n\nAPI - https://apiko-2021-spring-course-api.herokuapp.com/\n\nAPI Docs - https://apiko-2021-spring-course-api.herokuapp.com/documentation\n\n## Installation\n\nClone repository and install project dependencies\n```bash\ngit clone https://github.com/apiko-dev/apiko-2021-spring-course-api\ncd apiko-2021-spring-course-api\nnpm i\n```\n\n## Environment variables\nAdd your `.env` file with required environment variables e.g.\n\n```sh\nDATABASE_URL=postgres://apiko:apiko@db:5432/apiko\n# For deployed db - `TRUE`, for local db - `FALSE`\nPGSSL=FALSE\n# For deployed db - `no-verify`, for local db - `FALSE`\nPGSSLMODE=FALSE\n```\n\n## Docker\n\nDownload [Docker Desktop](https://www.docker.com/products/docker-desktop) for your system\n\n### Scripts\n\nBuild docker images:\n\n```bash\nnpm run docker:build\n```\n\nRun docker app:\n\n```bash\nnpm run docker:run\n```\n\nRun db migrations:\n\n```bash\nnpm run docker:migrate:update\nnpm run docker:migrate:rollback\nnpm run docker:migrate:rollback:all\n```\n\n### Connect to db container\n\nIf you want to connect to database from root machine, you can connect to database with a name `apiko` on `localhost:5452` with username/password `apiko` - `postgres://apiko:apiko@localhost:5452/apiko`.\n\nTo connect to database within docker network, connect to `db:5432`.\n\n### Connect to api container\n\nIf you want to connect to api from root machine, you can connect to `localhost:8090`.\n\nTo connect to api within docker network, connect to `api:8090`.\n\n## SQL syntax highlight in js files.\n\nUse [VS Code Extension](https://marketplace.visualstudio.com/items?itemName=dgadelha.vscode-sql-template-literal-with-prefixes) for\nSyntax highlighting for code like:\n\n```js\nconst query = sql`SELECT * FROM users`;\n```\n\n## Deploy on [Heroku](https://dashboard.heroku.com)\n\nCreate [free Heroku account](https://dashboard.heroku.com) and create new app from dashboard.\n\nDownload, install and login into [Heroku CLI](https://devcenter.heroku.com/articles/heroku-cli).\n\nSet and add the following buildpacks using heroku cli:\n```bash\n$ heroku buildpacks:set heroku/nodejs -a YOUR_HEROKU_PROJECT_NAME\n$ heroku buildpacks:add heroku/jvm -a YOUR_HEROKU_PROJECT_NAME\n```\n\nInstall [Heroku Postgres](https://elements.heroku.com/addons/heroku-postgresql) and provision it to your heroku app.\n\n### Config Vars\n\nOpen your heroku app `Settings` from dashboard and set following `Config Vars` from Heroku Postgres credentials:\n```sh\nDATABASE_URL=\nPGSSL=TRUE\nPGSSLMODE=no-verify\n```\n\nAlso set the following `Config Vars`:\n```sh\nHOST=YOUR_HEROKU_PROJECT_NAME.herokuapp.com\nSECRET1=\nSECRET2=\n```\n\n### Add the heroku remote to the git repository\n\n```bash\nheroku git:remote -a YOUR_PROJECT_HEROKU_GIT_URL\n```\n\n### Deploy your changes:\n\n```bash\ngit push heroku master\n```\n\nor\n\n```bash\ngit push heroku local_branch_name:master\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapiko-dev%2Fapiko-2021-spring-course-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapiko-dev%2Fapiko-2021-spring-course-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapiko-dev%2Fapiko-2021-spring-course-api/lists"}