No Description

Matt Baer c001ce6eea Move LESS files out of `css` to `less` directory 1 month ago
keys 39f73573d3 Add backend ability to save/get a house 2 years ago
less c001ce6eea Move LESS files out of `css` to `less` directory 1 month ago
main 5cc9623628 Move import path to writeas/htmlhouse 2 years ago
static c001ce6eea Move LESS files out of `css` to `less` directory 1 month ago
templates 7a8a89a788 Self-host jQuery 1 month ago
.gitignore c3a3f24a20 Add package build script 9 months ago
CONTRIBUTING.md b077f425a1 Add contributing guidelines 1 month ago
INSTALL 3e8a22eb4a Add install instructions 9 months ago
README.md ea418c9533 Add IRC badge to README 1 year ago
app.go c20a51dfff Add public houses endpoint 1 year ago
build.sh 3e8a22eb4a Add install instructions 9 months ago
config.go 00a731b8cc Support posting new public houses to Twitter 2 years ago
construction.go 1c4a462301 Return stats with public houses 1 year ago
database.go 39f73573d3 Add backend ability to save/get a house 2 years ago
house.go 39f73573d3 Add backend ability to save/get a house 2 years ago
init.sql 00a731b8cc Support posting new public houses to Twitter 2 years ago
keys.sh 526891d9db Prevent running keys.sh with no params 2 years ago
makefile c001ce6eea Move LESS files out of `css` to `less` directory 1 month ago
models.go 1c4a462301 Return stats with public houses 1 year ago
session.go 17bbe49b30 Fix session to work with jwt-go library v3 1 year ago
templates.go ac07e3dfee Add Browse page 2 years ago
twitter.go ded8e33677 Skip tweeting pages with "HTMLhouse" title 2 years ago

README.md

HTMLhouse

Publish HTML quickly.

HTMLhouse screenshot

HTMLhouse uses ACE editor for modifying HTML and shows a live preview of what you've created in an iframe alongside the source code.

No user signup is required -- authorization to modify an individual published page is saved on the creator's device in local storage as an ID and JWT generated by the server.

It is also available as a Chrome extension and browsable on Android.

Public Slack discussion

Development

Requirements

  • Go
  • Node.js
  • MySQL

Setup

  1. Clone the repo
  2. Run go get -d to get necessary dependencies
  3. Run make install to install LESS compiler locally and generate the CSS files
  4. Run the queries in init.sql to set up the database
  5. Optional. Run ./keys.sh prod to create a new keypair

Running the server

  • Run go run main/main.go in the top level directory, optionally by creating a simple run script ```bash #!/bin/bash

DB_USER=dbuser DB_PASSWORD=pass DB_DB=htmlhouse PRIVATE_KEY=keys/dev PUBLIC_KEY=keys/dev.pub go run main/main.go ```

Environment Variables

Variable What it is Default value
DB_USER Database user None. Required
DB_PASSWORD Database password None. Required
DB_DB Database name None. Required
DB_HOST Database host localhost
PRIVATE_KEY Generated private key None. Required
PUBLIC_KEY Generated public key None. Required
PORT Port to run app on 8080
STATIC_DIR Relative dir where static files are stored static
AUTO_APPROVE Automatically approves public posts false
TWITTER_KEY Twitter consumer key notreal
TWITTER_SECRET Twitter consumer secret notreal
TWITTER_TOKEN Twitter access token of the posting Twitter account notreal
TWITTER_TOKEN_SECRET Twitter access token secret of the posting Twitter account notreal

Notes

Changing CSS. Run make after all changes to update the stylesheets.

When you don't need to reload the app. When you make changes to any files in static/ you can simply refresh the resource without restarting the app.

When to reload the app. If you change any of the templates in templates/ or any .go file, you'll need to re-run the app.