{"id":15409588,"url":"https://github.com/bradymholt/koa-vuejs-template","last_synced_at":"2025-04-19T04:15:14.339Z","repository":{"id":66149772,"uuid":"93010439","full_name":"bradymholt/koa-vuejs-template","owner":"bradymholt","description":"Koa / Vue.js SPA Template App","archived":false,"fork":false,"pushed_at":"2022-05-24T13:24:21.000Z","size":1199,"stargazers_count":52,"open_issues_count":0,"forks_count":12,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-29T06:51:15.489Z","etag":null,"topics":["ansible","koa2","mocha","nginx","nodejs","postgressql","vue2"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":false,"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/bradymholt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"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},"funding":{"github":["bradymholt"]}},"created_at":"2017-06-01T02:58:15.000Z","updated_at":"2024-07-04T22:17:48.000Z","dependencies_parsed_at":"2023-03-10T19:16:04.409Z","dependency_job_id":null,"html_url":"https://github.com/bradymholt/koa-vuejs-template","commit_stats":{"total_commits":62,"total_committers":1,"mean_commits":62.0,"dds":0.0,"last_synced_commit":"56a11f482b105b87fc5708c54814771d86c12c17"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradymholt%2Fkoa-vuejs-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradymholt%2Fkoa-vuejs-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradymholt%2Fkoa-vuejs-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradymholt%2Fkoa-vuejs-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bradymholt","download_url":"https://codeload.github.com/bradymholt/koa-vuejs-template/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249191242,"owners_count":21227528,"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":["ansible","koa2","mocha","nginx","nodejs","postgressql","vue2"],"created_at":"2024-10-01T16:40:43.667Z","updated_at":"2025-04-19T04:15:14.332Z","avatar_url":"https://github.com/bradymholt.png","language":"TypeScript","funding_links":["https://github.com/sponsors/bradymholt"],"categories":[],"sub_categories":[],"readme":"# Koa / Vue.js SPA Template App\n\nThis app is a template application using Koa for a REST/JSON API server and Vue.js for a web client.\n\n![screen recording 2017-06-10 at 04 12 pm](https://user-images.githubusercontent.com/759811/27006360-bd3b8152-4df7-11e7-9011-f22204abe4d5.gif)\n\n## Overview of Stack\n- Server\n  - Koa\n  - PostgresSQL\n  - TypeScript\n  - [TypeORM](https://github.com/typeorm/typeorm) (data-mapper ORM)\n  - [routing-controllers](https://github.com/pleerock/routing-controllers) (decorated, class-based controllers in Koa)\n  - Docker used for development PostgresSQL database and MailHog server\n- Client\n  - Vue.js\n  - Single-file components (.vue)\n  - TypeScript\n  - Webpack for asset bundling and HMR (Hot Module Replacement)\n  - Bootstrap CSS\n  - Fetch API for REST requests\n- Testing\n  - Mocha\n  - Chai\n  - TypeScript\n  - MailHog for development email delivery\n- DevOps\n  - Ansible playbook for provisioning (Nginx reverse proxy, SSL via Let's Encrypt, PostgresSQL backups to S3)\n  - Ansible playbook for deployment\n\n## Development Setup\n\n1. Install the following:\n   - [Node.js \u003e= v7.8.0](https://nodejs.org/en/download/)\n   - [Ansible \u003e= 2.3.1.0](http://docs.ansible.com/ansible/intro_installation.html) (`pip install ansible --upgrade` to upgrade)\n   - [Docker](https://docs.docker.com/engine/installation/)\n2. Run `npm install \u0026\u0026 npm start`\n3. Open browser and navigate to [http://localhost:5000](http://localhost:5000).\n\n## Scripts\n\n### `npm install`\n\nWhen first cloning the repo or adding new dependencies, run this command.  This will:\n\n- Install Node dependencies from package.json\n\n### `npm start`\n\nTo start the app for development, run this command.  This will:\n\n- Run `docker-compose up` to ensure the PostgreSQL and MailHog Docker images are up and running\n- Run dotnet watch run which will build the app (if changed), watch for changes and start the web server on http://localhost:5000\n- Run Webpack dev middleware with HMR\n\n### `npm run migration:create [name]`\n\nCreates a new migration file in api/db/migrations/.  Migrations will be run each time the app starts (controlled with api/config/default.yml:autoMigrationsRun)\n\n### `npm test`\n\nThis will run the 2 test suites in test/.\n- **unit** - The unit tests are located in test/unit/\n- **integration** - The integration tests are located in test/integration/\n\n### `npm run provision:production`\n\n _Before running this script, you need to create an ops/config.yml file first.  See the [ops README](ops/) for instructions._\n\n This will run the ops/provision.yml Ansible playbook and provision hosts in ops/hosts inventory file.  This prepares the hosts to recieve deployments by doing the following:\n  - Install Nginx\n  - Generate a SSL certificate from [Let's Encrypt](https://letsencrypt.org/) and configure Nginx to use it\n  - Install Node.js\n  - Install Supervisor (will run/manage the Node.js/Koa app)\n  - Install PostgreSQL\n  - Setup a cron job to automatically backup the PostgresSQL database, compress it, and upload it to S3.\n  - Setup UFW (firewall) to lock everything down except inbound SSH and web traffic\n  - Create a deploy user, directory for deployments and configure Nginx to serve from this directory\n\n### `npm run deploy:production`\n\n_Before running this script, you need to create a ops/config.yml file first.  See the [ops README](ops/) for instructions._\n\nThis script will:\n - Build release Webpack bundles\n - Package the Koa application\n - Run the ops/deploy.yml Ansible playbook to deploy this app to hosts in /ops/config.yml inventory file.  This does the following:\n  - Copies the build assets to the remote host(s)\n  - Creates config/local-production.yml the `appsettings.json` file with PostgresSQL credentials specified in ops/hosts file and the app URL (needed for JWT tokens)\n  - Restarts the app so that changes will be picked up\n\n## Development Email Delivery\n\nThis template includes a [MailHog](https://github.com/mailhog/MailHog) Docker image so that when email is sent during development (i.e. new user registration), it can be viewed\nin the MailHog web interface at [http://localhost:8025/](http://localhost:8025/).\n\n## Visual Studio Code config\n\nThis project has [Visual Studio Code](https://code.visualstudio.com/) tasks and debugger launch config located in .vscode/.\n\n### Tasks\n\n- **Command+Shift+B** - Runs the \"build\" task which builds the api/ project and outputs to api/build/\n- **Command+Shift+T** - Runs the \"test\" task which runs the tests.\n\n### Debug Launcher\n\nWith the following debugger launch configs, you can set breakpoints and have full debugging support in [Visual Studio Code](https://code.visualstudio.com/)\n\n- **Debug api/** - Runs api (Node.js/Koa app) app with the VSCode debugger\n- **Debug test/integration/** - Runs the integration test suite with the VSCode debugger\n- **Debug test/unit/** - Runs the unit test suite with the VSCode debugger\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbradymholt%2Fkoa-vuejs-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbradymholt%2Fkoa-vuejs-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbradymholt%2Fkoa-vuejs-template/lists"}