{"id":13567920,"url":"https://github.com/abulte/dokku-simple-python-vue-spa","last_synced_at":"2026-01-28T10:19:03.753Z","repository":{"id":39132711,"uuid":"262291021","full_name":"abulte/dokku-simple-python-vue-spa","owner":"abulte","description":"Demonstrates a simple python api with a postgres database and a vuejs SPA, deployed on dokku.","archived":false,"fork":false,"pushed_at":"2022-12-12T17:30:36.000Z","size":4016,"stargazers_count":4,"open_issues_count":20,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-04T23:35:31.321Z","etag":null,"topics":["dokku","flask","postgresql","python","vuejs"],"latest_commit_sha":null,"homepage":null,"language":"Vue","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abulte.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}},"created_at":"2020-05-08T10:12:36.000Z","updated_at":"2021-10-14T03:12:22.000Z","dependencies_parsed_at":"2023-01-27T23:00:45.185Z","dependency_job_id":null,"html_url":"https://github.com/abulte/dokku-simple-python-vue-spa","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abulte%2Fdokku-simple-python-vue-spa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abulte%2Fdokku-simple-python-vue-spa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abulte%2Fdokku-simple-python-vue-spa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abulte%2Fdokku-simple-python-vue-spa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abulte","download_url":"https://codeload.github.com/abulte/dokku-simple-python-vue-spa/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247111809,"owners_count":20885500,"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":["dokku","flask","postgresql","python","vuejs"],"created_at":"2024-08-01T13:02:49.533Z","updated_at":"2026-01-28T10:19:03.722Z","avatar_url":"https://github.com/abulte.png","language":"Vue","funding_links":[],"categories":["Vue"],"sub_categories":[],"readme":"# dokku-simple-python-vue-spa\n\nDemonstrates a simple python api with a postgres database and a vuejs SPA, deployed on dokku.\n\n## Usage\n\n### Development\n\nLaunch backend:\n\n```\npython3 -mvenv pyenv\n. pyenv/bin/activate\ncd backend\npython cli.py init-db\nFLASK_DEBUG=1 FLASK_APP=app flask run\n```\n\nLaunch frontend:\n\n```\ncd frontend\nyarn\nyarn serve\n```\n\nThe frontend is available on http://localhost:8080 and uses the API available at http://localhost:5000.\n\n### Production (dokku)\n\nThis project uses two buildpacks, `node` and `python`, to build and install both frontend and backend.\n\nOn the dokku server, prepare the postgres database and create the app:\n\n```\ndokku apps:create simple-spa\ndokku postgres:create simple-spa\ndokku postgres:link simple-spa simple-spa\n```\n\nOn local copy:\n\n```\ngit remote add dokku dokku@{host}:simple-spa\ngit push dokku master\n```\n\nThe deployment process will run `init-db` thanks to the Procfile.\n\nGet a SSL certificate and redirect to https:\n\n```\ndokku letsencrypt simple-spa\n```\n\n:rocket: https://simple-spa.{host}/api\n\n### Tweaks\n\n- Use multiple buildpacks, cf `.buildpacks` file.\n- Double `package.json`: node buildpack only works with a `package.json` at the root of the project. The root `package.json` \"proxies\" installation to the `frontend` dir through the `post-install` script. The first `yarn install` install dev dependencies w/ `production=false`, then runs the build in `frontend`, then installs again w/ `production=true` to prune dev dependencies (similar to what the buildpack should be doing on its own but doesn't because our frontend is in a subdirectory).\n- `requirements.txt` is kept at the root of the project for the same reasons.\n- `Procfile` uses `--chdir` for `gunicorn` and `package.json` uses `--cwd` for `yarn`.\n\n## Initial setup\n\nHow this repo has been built (result is commited).\n\n### frontend\n\n```\nyarn global add @vue/cli @vue/cli-service-global\nvue create frontend\n# vue features: vuex, router w/ history mode\n```\n\n```\nrm -rf frontend/.git\ngit init\n```\n\nIn `frontend/vue.config.js`:\n\n```javascript\nmodule.exports = {\n  outputDir: '../dist',\n  assetsDir: 'static'\n}\n```\n\n```\ncd frontend \u0026\u0026 yarn build\n```\n\n### backend\n\n```\npython3 -mvenv pyenv\n. pyenv/bin/activate\nmkdir backend \u0026\u0026 cd backend\n# write code :-)\n```\n\n### Credits\n\nInspiration: https://github.com/oleg-agapov/flask-vue-spa\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabulte%2Fdokku-simple-python-vue-spa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabulte%2Fdokku-simple-python-vue-spa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabulte%2Fdokku-simple-python-vue-spa/lists"}