Hello world! 11 | {% if not data.user %} 12 | Login 13 | {% endif %} 14 |
15 |This is a very bare bones Apostrophe project. Now, get to work and make a real website!
16 |├── .github ├── dependabot.yml ├── linters │ ├── .hadolint.yaml │ ├── .markdown-lint.yml │ └── .yaml-lint.yml └── workflows │ └── linter.yml ├── .gitignore ├── LICENSE ├── README.md ├── assignment-apostrophe ├── .gitignore ├── Dockerfile ├── LICENSE ├── README.md ├── app.js ├── deployment │ ├── .gitignore │ ├── README │ ├── dependencies │ ├── migrate │ ├── rsync_exclude.txt │ ├── settings.example │ ├── settings.production.example │ ├── start │ └── stop ├── lib │ └── modules │ │ ├── apostrophe-assets │ │ ├── index.js │ │ └── public │ │ │ ├── css │ │ │ ├── site.less │ │ │ └── utils │ │ │ │ └── reset.less │ │ │ └── js │ │ │ └── site.js │ │ ├── apostrophe-express │ │ └── index.js │ │ ├── apostrophe-pages │ │ ├── index.js │ │ └── views │ │ │ ├── notFound.html │ │ │ └── pages │ │ │ └── home.html │ │ ├── apostrophe-templates │ │ └── views │ │ │ └── outerLayout.html │ │ └── apostrophe-users │ │ └── index.js ├── local.example.js ├── package.json ├── scripts │ ├── sync-down │ └── sync-up └── views │ └── layout.html ├── assignment-dockerfile ├── Dockerfile ├── answer │ └── Dockerfile ├── app.js ├── package-lock.json └── package.json ├── assignment-mta ├── README.md ├── answer │ ├── .dockerignore │ └── Dockerfile ├── in │ ├── picard5.gif │ └── picard7.gif ├── index.js ├── out │ └── .gitignore ├── package-lock.json └── package.json ├── assignment-sweet-compose ├── README.md ├── answer │ └── docker-compose.yml ├── docker-compose.yml └── result │ ├── .dockerignore │ ├── .vscode │ └── launch.json │ ├── Dockerfile │ ├── package-lock.json │ ├── package.json │ ├── server.js │ ├── tests │ ├── Dockerfile │ ├── render.js │ └── tests.sh │ └── views │ ├── angular.min.js │ ├── app.js │ ├── index.html │ ├── socket.io.js │ └── stylesheets │ └── style.css ├── centos-node ├── Dockerfile └── answer │ └── Dockerfile ├── compose-tips ├── bad.yml └── good.yml ├── depends-on ├── docker-compose.yml └── healthy-compose.yml ├── dockerfile-labels ├── Dockerfile ├── build.sh └── index.js ├── healthchecks ├── Dockerfile ├── app.js ├── hc.js ├── package-lock.json └── package.json ├── multi-stage-deps ├── .dockerignore ├── .gitignore ├── .vscode │ └── launch.json ├── Dockerfile ├── app.js ├── bin │ └── www ├── docker-compose.yml ├── package-lock.json ├── package.json ├── public │ ├── images │ │ ├── picard0.gif │ │ ├── picard1.gif │ │ ├── picard2.gif │ │ ├── picard3.gif │ │ ├── picard4.gif │ │ ├── picard5.gif │ │ ├── picard6.gif │ │ ├── picard7.gif │ │ ├── picard8.gif │ │ └── picard9.gif │ └── stylesheets │ │ └── style.css ├── routes │ ├── index.js │ └── users.js └── views │ ├── error.hbs │ ├── index.hbs │ └── layout.hbs ├── multi-stage-scanning ├── .dockerignore ├── .eslintrc.yml ├── .gitignore ├── .vscode │ └── launch.json ├── Dockerfile ├── app.js ├── bin │ └── www ├── package-lock.json ├── package.json ├── public │ ├── images │ │ ├── picard0.gif │ │ ├── picard1.gif │ │ ├── picard2.gif │ │ ├── picard3.gif │ │ ├── picard4.gif │ │ ├── picard5.gif │ │ ├── picard6.gif │ │ ├── picard7.gif │ │ ├── picard8.gif │ │ └── picard9.gif │ └── stylesheets │ │ └── style.css ├── routes │ ├── index.js │ └── users.js ├── test │ └── smoke.js └── views │ ├── error.hbs │ ├── index.hbs │ └── layout.hbs ├── multi-stage-test ├── .dockerignore ├── .eslintrc.yml ├── .gitignore ├── .vscode │ └── launch.json ├── Dockerfile ├── app.js ├── bin │ └── www ├── package-lock.json ├── package.json ├── public │ ├── images │ │ ├── picard0.gif │ │ ├── picard1.gif │ │ ├── picard2.gif │ │ ├── picard3.gif │ │ ├── picard4.gif │ │ ├── picard5.gif │ │ ├── picard6.gif │ │ ├── picard7.gif │ │ ├── picard8.gif │ │ └── picard9.gif │ └── stylesheets │ │ └── style.css ├── routes │ ├── index.js │ └── users.js ├── test │ └── smoke.js └── views │ ├── error.hbs │ ├── index.hbs │ └── layout.hbs ├── sample-01 ├── Dockerfile ├── docker-compose.yml └── index.js ├── sample-02 ├── .dockerignore ├── .gitignore ├── .vscode │ └── launch.json ├── Dockerfile ├── app.js ├── bin │ └── www ├── docker-compose.yml ├── package-lock.json ├── package.json ├── public │ ├── images │ │ ├── picard0.gif │ │ ├── picard1.gif │ │ ├── picard2.gif │ │ ├── picard3.gif │ │ ├── picard4.gif │ │ ├── picard5.gif │ │ ├── picard6.gif │ │ ├── picard7.gif │ │ ├── picard8.gif │ │ └── picard9.gif │ └── stylesheets │ │ └── style.css ├── routes │ ├── index.js │ └── users.js └── views │ ├── error.hbs │ ├── index.hbs │ └── layout.hbs ├── sample-buildkit-cache ├── Dockerfile ├── package-lock.json └── package.json ├── sample-buildkit-ssh └── Dockerfile ├── sample-buildkit ├── .dockerignore ├── .gitignore ├── .vscode │ └── launch.json ├── Dockerfile ├── app.js ├── bin │ └── www ├── docker-compose.yml ├── package-lock.json ├── package.json ├── public │ ├── images │ │ ├── picard0.gif │ │ ├── picard1.gif │ │ ├── picard2.gif │ │ ├── picard3.gif │ │ ├── picard4.gif │ │ ├── picard5.gif │ │ ├── picard6.gif │ │ ├── picard7.gif │ │ ├── picard8.gif │ │ └── picard9.gif │ └── stylesheets │ │ └── style.css ├── routes │ ├── index.js │ └── users.js └── views │ ├── error.hbs │ ├── index.hbs │ └── layout.hbs ├── sample-express ├── .dockerignore ├── Dockerfile ├── app.js ├── bin │ └── www ├── docker-compose.yml ├── package-lock.json ├── package.json ├── public │ └── stylesheets │ │ └── style.css ├── routes │ ├── index.js │ └── users.js └── views │ ├── error.pug │ ├── index.pug │ └── layout.pug ├── sample-ghost └── docker-compose.yml ├── sample-graceful-shutdown └── sample.js ├── sample-kubernetes └── deployment-vote.yml ├── sample-local-proxy ├── nginx-proxy.yml └── traefik-proxy.yml ├── sample-multi-stage ├── .dockerignore ├── .gitignore ├── .vscode │ └── launch.json ├── Dockerfile ├── answer │ └── Dockerfile ├── app.js ├── bin │ └── www ├── package-lock.json ├── package.json ├── public │ ├── images │ │ ├── picard0.gif │ │ ├── picard1.gif │ │ ├── picard2.gif │ │ ├── picard3.gif │ │ ├── picard4.gif │ │ ├── picard5.gif │ │ ├── picard6.gif │ │ ├── picard7.gif │ │ ├── picard8.gif │ │ └── picard9.gif │ └── stylesheets │ │ └── style.css ├── routes │ ├── index.js │ └── users.js ├── test │ └── smoke.js └── views │ ├── error.hbs │ ├── index.hbs │ └── layout.hbs ├── sample-nodemon ├── Dockerfile ├── app.js ├── bin │ └── www ├── docker-compose.yml ├── package-lock.json ├── package.json ├── public │ └── stylesheets │ │ └── style.css ├── routes │ ├── index.js │ └── users.js └── views │ ├── error.pug │ ├── index.pug │ └── layout.pug ├── sample-result-orchestration ├── .dockerignore ├── .vscode │ └── launch.json ├── Dockerfile ├── package-lock.json ├── package.json ├── server.js ├── tests │ ├── Dockerfile │ ├── render.js │ └── tests.sh └── views │ ├── app.js │ ├── index.html │ └── stylesheets │ └── style.css ├── sample-sails ├── .editorconfig ├── .eslintignore ├── .eslintrc ├── .gitignore ├── .htmlhintrc ├── .lesshintrc ├── .npmrc ├── .sailsrc ├── Dockerfile ├── Gruntfile.js ├── README.md ├── api │ ├── controllers │ │ ├── account │ │ │ ├── logout.js │ │ │ ├── update-billing-card.js │ │ │ ├── update-password.js │ │ │ ├── update-profile.js │ │ │ ├── view-account-overview.js │ │ │ ├── view-edit-password.js │ │ │ └── view-edit-profile.js │ │ ├── dashboard │ │ │ └── view-welcome.js │ │ ├── deliver-contact-form-message.js │ │ ├── entrance │ │ │ ├── confirm-email.js │ │ │ ├── login.js │ │ │ ├── send-password-recovery-email.js │ │ │ ├── signup.js │ │ │ ├── update-password-and-login.js │ │ │ ├── view-forgot-password.js │ │ │ ├── view-login.js │ │ │ ├── view-new-password.js │ │ │ └── view-signup.js │ │ └── view-homepage-or-redirect.js │ ├── helpers │ │ └── send-template-email.js │ ├── hooks │ │ └── custom │ │ │ └── index.js │ ├── models │ │ └── User.js │ ├── policies │ │ ├── is-logged-in.js │ │ └── is-super-admin.js │ └── responses │ │ ├── expired.js │ │ └── unauthorized.js ├── app.js ├── assets │ ├── .eslintrc │ ├── dependencies │ │ ├── bootstrap-4 │ │ │ ├── bootstrap-4.bundle.js │ │ │ └── bootstrap-4.css │ │ ├── cloud.js │ │ ├── fontawesome.css │ │ ├── jquery.min.js │ │ ├── lodash.js │ │ ├── moment.js │ │ ├── parasails.js │ │ ├── sails.io.js │ │ ├── vue-router.js │ │ └── vue.js │ ├── favicon.ico │ ├── fonts │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.svg │ │ ├── fontawesome-webfont.ttf │ │ ├── fontawesome-webfont.woff │ │ └── fontawesome-webfont.woff2 │ ├── images │ │ ├── hero-cloud.png │ │ ├── hero-ship.png │ │ ├── hero-sky.png │ │ ├── hero-water.png │ │ ├── icon-close.png │ │ ├── logo.png │ │ ├── setup-customize.png │ │ ├── setup-email.png │ │ └── setup-payment.png │ ├── js │ │ ├── cloud.setup.js │ │ ├── components │ │ │ ├── ajax-button.component.js │ │ │ ├── ajax-form.component.js │ │ │ ├── js-timestamp.component.js │ │ │ └── modal.component.js │ │ ├── pages │ │ │ ├── 498.page.js │ │ │ ├── account │ │ │ │ ├── account-overview.page.js │ │ │ │ ├── edit-password.page.js │ │ │ │ └── edit-profile.page.js │ │ │ ├── contact.page.js │ │ │ ├── dashboard │ │ │ │ └── welcome.page.js │ │ │ ├── entrance │ │ │ │ ├── confirmed-email.page.js │ │ │ │ ├── forgot-password.page.js │ │ │ │ ├── login.page.js │ │ │ │ ├── new-password.page.js │ │ │ │ └── signup.page.js │ │ │ ├── faq.page.js │ │ │ ├── homepage.page.js │ │ │ └── legal │ │ │ │ ├── privacy.page.js │ │ │ │ └── terms.page.js │ │ └── utilities │ │ │ └── open-stripe-checkout.js │ ├── styles │ │ ├── bootstrap-overrides.less │ │ ├── importer.less │ │ ├── layout.less │ │ ├── pages │ │ │ ├── 404.less │ │ │ ├── 498.less │ │ │ ├── 500.less │ │ │ ├── account │ │ │ │ ├── account-overview.less │ │ │ │ ├── edit-password.less │ │ │ │ └── edit-profile.less │ │ │ ├── contact.less │ │ │ ├── dashboard │ │ │ │ └── welcome.less │ │ │ ├── entrance │ │ │ │ ├── confirmed-email.less │ │ │ │ ├── forgot-password.less │ │ │ │ ├── login.less │ │ │ │ ├── new-password.less │ │ │ │ └── signup.less │ │ │ ├── faq.less │ │ │ ├── homepage.less │ │ │ └── legal │ │ │ │ ├── privacy.less │ │ │ │ └── terms.less │ │ └── styleguide │ │ │ ├── animations.less │ │ │ ├── buttons.less │ │ │ ├── colors.less │ │ │ ├── containers.less │ │ │ ├── index.less │ │ │ └── typography.less │ └── templates │ │ └── .gitkeep ├── config │ ├── blueprints.js │ ├── bootstrap.js │ ├── custom.js │ ├── datastores.js │ ├── env │ │ ├── production.js │ │ └── staging.js │ ├── globals.js │ ├── http.js │ ├── i18n.js │ ├── locales │ │ ├── de.json │ │ ├── en.json │ │ ├── es.json │ │ └── fr.json │ ├── log.js │ ├── models.js │ ├── policies.js │ ├── routes.js │ ├── security.js │ ├── session.js │ ├── sockets.js │ └── views.js ├── package-lock.json ├── package.json ├── scripts │ └── rebuild-cloud-sdk.js ├── tasks │ ├── config │ │ ├── babel.js │ │ ├── clean.js │ │ ├── coffee.js │ │ ├── concat.js │ │ ├── copy.js │ │ ├── cssmin.js │ │ ├── hash.js │ │ ├── jst.js │ │ ├── less.js │ │ ├── sails-linker.js │ │ ├── sync.js │ │ ├── uglify.js │ │ └── watch.js │ ├── pipeline.js │ └── register │ │ ├── build.js │ │ ├── buildProd.js │ │ ├── compileAssets.js │ │ ├── default.js │ │ ├── linkAssets.js │ │ ├── linkAssetsBuild.js │ │ ├── linkAssetsBuildProd.js │ │ ├── polyfill.js │ │ ├── prod.js │ │ └── syncAssets.js └── views │ ├── .eslintrc │ ├── 404.ejs │ ├── 498.ejs │ ├── 500.ejs │ ├── emails │ ├── email-reset-password.ejs │ ├── email-verify-account.ejs │ ├── email-verify-new-email.ejs │ └── internal │ │ └── email-contact-form.ejs │ ├── layouts │ ├── layout-email.ejs │ └── layout.ejs │ └── pages │ ├── account │ ├── account-overview.ejs │ ├── edit-password.ejs │ └── edit-profile.ejs │ ├── contact.ejs │ ├── dashboard │ └── welcome.ejs │ ├── entrance │ ├── confirmed-email.ejs │ ├── forgot-password.ejs │ ├── login.ejs │ ├── new-password.ejs │ └── signup.ejs │ ├── faq.ejs │ ├── homepage.ejs │ └── legal │ ├── privacy.ejs │ └── terms.ejs ├── sample-strapi ├── .dockerignore ├── .editorconfig ├── .env.example ├── .eslintignore ├── .eslintrc ├── .gitignore ├── .strapi-updater.json ├── Dockerfile ├── README.md ├── api │ └── .gitkeep ├── config │ ├── database.js │ ├── functions │ │ ├── bootstrap.js │ │ ├── cron.js │ │ └── responses │ │ │ └── 404.js │ └── server.js ├── docker-compose.yml ├── extensions │ ├── .gitkeep │ └── users-permissions │ │ └── config │ │ └── jwt.js ├── favicon.ico ├── package-lock.json ├── package.json └── public │ ├── robots.txt │ └── uploads │ └── .gitkeep ├── sample-swarm └── stack-vote.yml ├── typescript ├── .dockerignore ├── .gitignore ├── .vscode │ └── launch.json ├── Dockerfile ├── docker-compose.yml ├── nodemon.json ├── package-lock.json ├── package.json ├── src │ └── app.ts └── tsconfig.json ├── ultimate-node-dockerfile ├── .dockerignore ├── Dockerfile ├── README.md ├── answer │ └── Dockerfile ├── docker-compose.yml ├── package-lock.json ├── package.json ├── server.js ├── tests │ ├── render.js │ └── tests.sh └── views │ ├── app.js │ ├── index.html │ └── stylesheets │ └── style.css └── user-node ├── .dockerignore ├── Dockerfile ├── answer └── Dockerfile ├── app.js ├── docker-compose.yml ├── package-lock.json └── package.json /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | # Maintain dependencies for GitHub Actions 4 | - package-ecosystem: "github-actions" 5 | directory: "/" 6 | schedule: 7 | interval: "monthly" 8 | -------------------------------------------------------------------------------- /.github/linters/.hadolint.yaml: -------------------------------------------------------------------------------- 1 | ignored: 2 | - DL3002 #learning: it's ok to be root sometimes 3 | - DL3003 #ignore that we use cd sometimes 4 | - DL3006 #image pin versions 5 | - DL3008 #apt pin versions 6 | - DL3009 #apt pin cleanups 7 | - DL3012 #learning: multiple HEALTHCHECKs ok 8 | - DL3016 # npm pin versions 9 | - DL3018 #apk add pin versions 10 | - DL3022 #bad rule for COPY --from 11 | - DL3028 #gem install pin versions 12 | - DL3059 #multiple consecutive runs 13 | - DL4006 #we don't need pipefail in this 14 | - SC2016 #we want single quotes sometimes -------------------------------------------------------------------------------- /.github/linters/.markdown-lint.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # MD013/line-length - Line length 3 | MD013: 4 | # Number of characters, default is 80 5 | line_length: 9999 6 | # check code blocks? 7 | code_blocks: false -------------------------------------------------------------------------------- /.github/linters/.yaml-lint.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ########################################### 3 | # These are the rules used for # 4 | # linting all the yaml files in the stack # 5 | # NOTE: # 6 | # You can disable line with: # 7 | # # yamllint disable-line # 8 | ########################################### 9 | rules: 10 | braces: 11 | level: warning 12 | min-spaces-inside: 0 13 | max-spaces-inside: 0 14 | min-spaces-inside-empty: 1 15 | max-spaces-inside-empty: 5 16 | brackets: 17 | level: warning 18 | min-spaces-inside: 0 19 | max-spaces-inside: 0 20 | min-spaces-inside-empty: 1 21 | max-spaces-inside-empty: 5 22 | colons: 23 | level: warning 24 | max-spaces-before: 0 25 | max-spaces-after: 1 26 | commas: 27 | level: warning 28 | max-spaces-before: 0 29 | min-spaces-after: 1 30 | max-spaces-after: 1 31 | comments: disable 32 | comments-indentation: disable 33 | document-end: disable 34 | document-start: disable 35 | empty-lines: 36 | level: warning 37 | max: 2 38 | max-start: 0 39 | max-end: 0 40 | hyphens: 41 | level: warning 42 | max-spaces-after: 1 43 | indentation: 44 | level: warning 45 | spaces: consistent 46 | indent-sequences: true 47 | check-multi-line-strings: false 48 | key-duplicates: enable 49 | line-length: disable 50 | new-line-at-end-of-file: disable 51 | new-lines: 52 | type: unix 53 | trailing-spaces: disable -------------------------------------------------------------------------------- /.github/workflows/linter.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # template source: https://github.com/bretfisher/super-linter-workflow/blob/main/templates/call-super-linter.yaml 3 | name: Lint Code Base 4 | 5 | on: 6 | 7 | push: 8 | branches: [main] 9 | 10 | pull_request: 11 | 12 | jobs: 13 | call-super-linter: 14 | 15 | name: Call Super-Linter 16 | 17 | permissions: 18 | contents: read # clone the repo to lint 19 | statuses: write #read/write to repo custom statuses 20 | 21 | ### use Reusable Workflows to call my workflow remotely 22 | ### https://docs.github.com/en/actions/learn-github-actions/reusing-workflows 23 | ### you can also call workflows from inside the same repo via file path 24 | 25 | uses: bretfisher/super-linter-workflow/.github/workflows/reusable-super-linter.yaml@main 26 | 27 | ### Optional settings examples 28 | 29 | with: 30 | ### For a DevOps-focused repository. Prevents some code-language linters from running 31 | ### defaults to false 32 | devops-only: true 33 | 34 | ### A regex to exclude files from linting 35 | ### defaults to empty 36 | filter-regex-exclude: .*assignment-apostrophe/.*,.*assignment-sweet-compose/result/.*,.*sample-result-orchestration/.*,.*assignment-mta/.*,.*sample-sails/.*,*test* 37 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Bret Fisher 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Docker Mastery for Node.js Projects From a Docker Captain 2 | 3 | [](https://github.com/BretFisher/docker-mastery-for-nodejs/actions/workflows/linter.yml) 4 | 5 | This repository is for use in my Udemy Course [bretfisher.com/docker-mastery-for-nodejs](https://www.bretfisher.com/docker-mastery-for-nodejs) 6 | 7 | Feel free to create issues or PRs if you find a problem with the repository. 8 | Please use the Udemy course for lecture-specific support. 9 | -------------------------------------------------------------------------------- /assignment-apostrophe/.gitignore: -------------------------------------------------------------------------------- 1 | package-lock.json 2 | /locales 3 | npm-debug.log 4 | /data 5 | /public/uploads 6 | /public/apos-minified 7 | /data/temp/uploadfs 8 | node_modules 9 | # This folder is created on the fly and contains symlinks updated at startup (we'll come up with a Windows solution that actually copies things) 10 | /public/modules 11 | # We don't commit CSS, only LESS 12 | /public/css/*.css 13 | /public/css/*.map 14 | # Don't commit masters generated on the fly at startup, these import all the rest 15 | /public/css/master-*.less 16 | .jshintrc 17 | /public/js/_site-compiled.js 18 | -------------------------------------------------------------------------------- /assignment-apostrophe/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:carbon 2 | 3 | # Create app directory 4 | RUN mkdir -p /app 5 | WORKDIR /app 6 | 7 | # Bundle app source 8 | COPY . /app 9 | RUN npm install 10 | 11 | # Mount persistent storage 12 | VOLUME /app/data 13 | VOLUME /app/public/uploads 14 | 15 | EXPOSE 3000 16 | CMD [ "npm", "start" ] 17 | -------------------------------------------------------------------------------- /assignment-apostrophe/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 P'unk Avenue LLC 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /assignment-apostrophe/README.md: -------------------------------------------------------------------------------- 1 | # Apostrophe Boilerplate v2.x 2 | 3 | Apostrophe Boilerplate is a minimal starting point for [Apostrophe 2](https://github.com/punkave/apostrophe) projects. 4 | 5 | To get started, we recommend taking a look at [our guide to creating your first project](http://apostrophecms.org/docs/tutorials/getting-started/creating-your-first-project.html). You could also take a look at [Apostrophe's CLI](https://github.com/punkave/apostrophe) or simply fork this repository. 6 | 7 | Once you have a local copy of this project to work from, make sure to install its dependencies with `npm install`. With Apostrophe installed, the first thing to do create an admin user account so you're able to log into the CMS. Run the following command (this will prompt you for a password). 8 | 9 | ```bash 10 | node app.js apostrophe-users:add admin admin 11 | ``` 12 | 13 | Now you're all set! Just run `node app.js` to start up the local server and head to `localhost:3000` in your web browser. 14 | 15 | --------------- 16 | 17 | For more documentation on Apostrophe, visit the [A2 documentation site](http://apostrophecms.com). 18 | -------------------------------------------------------------------------------- /assignment-apostrophe/app.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | 3 | var apos = require('apostrophe')({ 4 | shortName: 'here', 5 | 6 | // See lib/modules for basic project-level configuration of our modules 7 | // responsible for serving static assets, managing page templates and 8 | // configuring user accounts. 9 | 10 | modules: { 11 | 12 | // Apostrophe module configuration 13 | 14 | // Note: most configuration occurs in the respective 15 | // modules' directories. See lib/apostrophe-assets/index.js for an example. 16 | 17 | // However any modules that are not present by default in Apostrophe must at 18 | // least have a minimal configuration here: `moduleName: {}` 19 | 20 | // If a template is not found somewhere else, serve it from the top-level 21 | // `views/` folder of the project 22 | 23 | 'apostrophe-templates': { viewsFolderFallback: path.join(__dirname, 'views') } 24 | 25 | } 26 | }); 27 | -------------------------------------------------------------------------------- /assignment-apostrophe/deployment/.gitignore: -------------------------------------------------------------------------------- 1 | settings 2 | settings.production 3 | -------------------------------------------------------------------------------- /assignment-apostrophe/deployment/README: -------------------------------------------------------------------------------- 1 | This is a deployment folder for use with Stagecoach. 2 | 3 | You don't have to use Stagecoach. 4 | 5 | It's just a neat solution for deploying node apps. 6 | 7 | See: 8 | 9 | http://github.com/punkave/stagecoach 10 | -------------------------------------------------------------------------------- /assignment-apostrophe/deployment/migrate: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Run any necessary database migration tasks that should happen while the 4 | # site is paused here. 5 | 6 | node app apostrophe-migrations:migrate 7 | 8 | echo "Site migrated" 9 | -------------------------------------------------------------------------------- /assignment-apostrophe/deployment/rsync_exclude.txt: -------------------------------------------------------------------------------- 1 | # List files and folders that shouldn't be deployed (such as data folders and runtime status files) here. 2 | # In our projects .git and .gitignore are good candidates, also 'data' which contains persistent files 3 | # that are *not* part of deployment. A good place for things like data/port, data/pid, and any 4 | # sqlite databases or static web content you may need 5 | data 6 | temp 7 | public/uploads 8 | public/modules 9 | public/apos-minified 10 | .git 11 | .gitignore 12 | # We don't deploy these anymore, instead we always 'npm install' to ensure 13 | # that any compiled C++ modules are built for the right architecture 14 | node_modules 15 | -------------------------------------------------------------------------------- /assignment-apostrophe/deployment/settings.example: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Settings shared by all targets (staging, production, etc). Usually the 4 | # shortname of the project (which is also the hostname for the frontend 5 | # proxy server used for staging sites) and the directory name. For our 6 | # web apps that use sc-proxy we make sure each is a subdirectory 7 | # of /opt/stagecoach/apps 8 | 9 | PROJECT=apostrophe 10 | DIR=/opt/stagecoach/apps/$PROJECT 11 | 12 | # Adjust the PATH environment variable on the remote host. Here's an example 13 | # for deploying to MacPorts 14 | #ADJUST_PATH='export PATH=/opt/local/bin:$PATH' 15 | 16 | # ... But you probably won't need to on real servers. I just find it handy for 17 | # testing parts of stagecoach locally on a Mac. : is an acceptable "no-op" (do-nothing) statement 18 | ADJUST_PATH=':' 19 | 20 | # ssh port. Sensible people leave this set to 22 but it's common to do the 21 | # "security by obscurity" thing alas 22 | SSH_PORT=22 23 | -------------------------------------------------------------------------------- /assignment-apostrophe/deployment/settings.production.example: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Settings specific to the 'master' deployment target. 4 | # USER is the ssh user, SERVER is the ssh host. USER should 5 | # match the USER setting in /opt/stagecoach/settings on 6 | # the server 7 | 8 | USER=myuser 9 | SERVER=myserver.com 10 | 11 | -------------------------------------------------------------------------------- /assignment-apostrophe/deployment/stop: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Shut the site down, for instance by tweaking a .htaccess file to display 4 | # a 'please wait' notice, or stopping a node server 5 | 6 | if [ ! -f "app.js" ]; then 7 | echo "I don't see app.js in the current directory." 8 | exit 1 9 | fi 10 | 11 | # Stop the node app via 'forever'. You'll get a harmless warning if the app 12 | # was not already running. Use `pwd` to make sure we have a full path, 13 | # forever is otherwise easily confused and will stop every server with 14 | # the same filename 15 | forever stop `pwd`/app.js && echo "Site stopped" 16 | 17 | # Stop the app without 'forever'. We recommend using 'forever' for node apps, 18 | # but this may be your best bet for non-node apps 19 | # 20 | # if [ -f "data/pid" ]; then 21 | # kill `cat data/pid` 22 | # rm data/pid 23 | # echo "Site stopped" 24 | # else 25 | # echo "Site was not running" 26 | # fi 27 | 28 | -------------------------------------------------------------------------------- /assignment-apostrophe/lib/modules/apostrophe-assets/index.js: -------------------------------------------------------------------------------- 1 | // This configures the apostrophe-assets module to push a 'site.less' 2 | // stylesheet by default, and to use jQuery 3.x 3 | 4 | module.exports = { 5 | jQuery: 3, 6 | stylesheets: [ 7 | { 8 | name: 'site' 9 | } 10 | ], 11 | scripts: [ 12 | { 13 | name: 'site' 14 | } 15 | ] 16 | }; 17 | -------------------------------------------------------------------------------- /assignment-apostrophe/lib/modules/apostrophe-assets/public/css/site.less: -------------------------------------------------------------------------------- 1 | @import "utils/reset.less"; 2 | 3 | // Delete the boilerplate CSS below when you are ready to dive in and customize your sites: 4 | body { background-color: @apos-light; } 5 | 6 | .main-content { 7 | font-family: 'Karla', sans-serif; 8 | margin: 200px auto; 9 | padding: 20px; 10 | max-width: 500px; 11 | color: @apos-white; 12 | background-color: @apos-primary; 13 | .apos-drop-shadow; 14 | 15 | .login-link { 16 | float: right; 17 | color: @apos-white; 18 | } 19 | 20 | // Basic rich-text editor styles: 21 | h3 { 22 | font-size: 24px; 23 | margin-bottom: 12px; 24 | } 25 | 26 | h4 { 27 | font-size: 20px; 28 | margin-bottom: 10px; 29 | } 30 | 31 | strong { font-weight: bold; } 32 | em { font-style: italic; } 33 | } 34 | -------------------------------------------------------------------------------- /assignment-apostrophe/lib/modules/apostrophe-assets/public/js/site.js: -------------------------------------------------------------------------------- 1 | $(function() { 2 | // Start with your project-level client-side javascript here. 3 | // JQuery and lodash (_) are both included with Apostrophe, so no need to 4 | // worry about including them on your own. 5 | 6 | console.log('Hello world.'); 7 | }); 8 | -------------------------------------------------------------------------------- /assignment-apostrophe/lib/modules/apostrophe-express/index.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | session: { 3 | // If this still says `undefined`, set a real secret! 4 | secret: 'd845ae886244046a' 5 | } 6 | }; 7 | -------------------------------------------------------------------------------- /assignment-apostrophe/lib/modules/apostrophe-pages/index.js: -------------------------------------------------------------------------------- 1 | // This configures the apostrophe-pages module to add a "home" page type to the 2 | // pages menu 3 | 4 | module.exports = { 5 | types: [ 6 | { 7 | name: 'home', 8 | label: 'Home' 9 | } 10 | 11 | // Add more page types here, but make sure you create a corresponding 12 | // template in lib/modules/apostrophe-pages/views/pages! 13 | ] 14 | }; 15 | -------------------------------------------------------------------------------- /assignment-apostrophe/lib/modules/apostrophe-pages/views/notFound.html: -------------------------------------------------------------------------------- 1 | {# 2 | Use this template to build out your 404 error pages. Like page templates, 3 | it inherits a global layout. 4 | #} 5 | 6 | {% extends "layout.html" %} 7 | 8 | {% block title %}404 - Page not found{% endblock %} 9 | 10 | {% block main %} 11 | We're sorry. We couldn't find the page you're looking for. 12 | {% endblock %} 13 | -------------------------------------------------------------------------------- /assignment-apostrophe/lib/modules/apostrophe-pages/views/pages/home.html: -------------------------------------------------------------------------------- 1 | {# 2 | This is an example home page template. It inherits and extends a layout template 3 | that lives in the top-level views/ folder for convenience 4 | #} 5 | 6 | {% extends "layout.html" %} 7 | 8 | {% block main %} 9 |
This is a very bare bones Apostrophe project. Now, get to work and make a real website!
16 |