Code Monkey home page Code Monkey logo

site's Introduction

Code that powers my website, robsoko.com

Local dev

Assuming reasonably up-to-date node and npm, you should be good to run the dev server on your local machine without Docker.

Install elm prerequisites:

npm install -g elm elm-test elm-review elm-spa

Clone this repo, and cd into it. Then generate types used by elm-spa Pages code:

elm-spa gen

Run local dev server:

elm-spa server

elm-spa owns client-side routing, and build steps for deployment. Refer to elm-spa's guide for more information.

I usually open another console to run elm-test:

elm-test --watch

Local nginx debugging

To mimic the build process used by the deployment script do the following:

./scripts/build-local.sh

To run the nginx server:

docker-compose up site

You should be able to view the site in your browser at localhost (implicit port 80). If something is off you can run a sh shell (not bash, alpine is tiny!) by docker exec-ing into the running container

This is also useful to test UIs on mobile. I wasn't able to get elm-spa server to serve on my local network, but building the above dev image works. Note this requires allowing inbound traffic (on local-network!) on port 80.

Deployment

This app runs on GCP CloudRun, which is deployed to via CloudBuild triggers. All CloudBuild related code is located in .cloudbuild/. In order to keep CloudRun wakeup time quick, an nginx alpine image is used to serve the compiled code. This isn't necessary for the current deployment, but I am anticipating need for more complex deployments soon.

Triggers:

  • pr-build: triggered on all PRs issued in this repo
  • deploy-to-cloud-run: triggered on all cut tags for this repo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.