Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

hylang/hy-interpreter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Obsolete as of 2023. See https://github.com/hylang/hyhomepage instead.

Try Hy Online Repl

Install

# Clone the repo
git clone https://github.com/allison-casey/hy-interpreter.git
cd hy-interpreter

Backend

The backend is a serverless zappa flask app. Installation must happen inside a virtualenv to support Zappa.

# Create the server venv
cd server
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

# To run locally, export these env vars before
# running 'flask run'
export FLASK_APP=flaskr
export FLASK_ENV=development

flask run

Client

The client app is a clojurescript reagent application built with shadow-cljs and deployed to github pages.

# Return to the root repo dir
cd hy-interpreter

# Install the npm dependencies
npm install

# Start the development server
npx shadow-cljs watch app

Deploy

Backend

# Init Zappa Settings
# This requires aws cli to be installed, set up, and
# a valid ~/.aws/credentials file
zappa init

# Deploy the flask app to AWS Lambda
zappa deploy

zappa deploy will print out the base url that the backend can be reached at. Save this for setting up the client app.

Client

# To set the endpoint url for this deployment
# create a file called 'config.edn' that contains the end
# point url we saved when we ran 'zappa deploy' with the
# following command (Leave the surrounding double quotes in)
echo '{:closure-defines {hyinterpreter.events/REACT_APP_API_BASE "<ENDPOINT-URL>"}}' > config.edn

# Deploy the app to Github Pages
npm run deploy