Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closes #12 Examples section #29

Open
wants to merge 50 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
56955e5
add note about discussing changes
Oct 12, 2017
d1685dd
no more twitter
Oct 17, 2017
230a52f
use blob instead of file
Oct 17, 2017
ba86a25
elchemy 1
wende Oct 19, 2017
f1b7fad
Update setup
baransu Oct 19, 2017
f256f2c
Start adjusting view to our needs
baransu Oct 19, 2017
8d76974
More visual changes
baransu Oct 19, 2017
d8a8fa4
Everything configured to work properly with Elchemy
wende Oct 20, 2017
a7850c8
make file addition
wende Oct 20, 2017
b13dc9c
few naming impovements
wende Oct 20, 2017
8f3c8ad
Merge branch 'dev' into elchemy
wende Oct 20, 2017
bce397b
Merge pull request #1 from wende/elchemy
wende Oct 20, 2017
b9fdb55
more verbose vim mode
wende Oct 20, 2017
392ca98
elchemy 2
wende Oct 20, 2017
53d6cdd
Merge pull request #11 from wende/elchemy-2
wende Oct 20, 2017
5c0c75c
elchemy2
wende Oct 20, 2017
347b6e7
new style
wende Oct 20, 2017
c7328b7
Merge pull request #13 from wende/elchemy-2
wende Oct 20, 2017
87dc4dd
better font
wende Nov 6, 2017
0d8b541
Merge branch 'elchemy-2' into dev
wende Nov 6, 2017
99c5fd2
logs part 1
wende Nov 6, 2017
30b7f5c
dotenv sh
wende Nov 6, 2017
259dd3b
Update README.md
wende Nov 6, 2017
6227322
builds into container
Hajto Jan 4, 2018
43499e8
Cleanup
Hajto Jan 5, 2018
0fb2e11
Cleanup
Hajto Jan 6, 2018
c93fba8
cleanup outputs
wende Jan 6, 2018
2375649
Merge pull request #15 from Hajto/dev
wende Jan 6, 2018
52bdc21
Merge branch 'dev' of github.com:wende/elchemy-live into dev
wende Jan 6, 2018
3ad4abd
Makefile automation
wende Jan 6, 2018
0fc0130
Logs work properly
wende Jan 6, 2018
11bc648
test
wende Jan 6, 2018
3822c95
Introduce Elixir code output using Elchemy
baransu Jan 7, 2018
9f675d4
Add elm-install to make setup
baransu Jan 7, 2018
731a3ed
make all
wende Jan 7, 2018
8b98412
better colors
wende Jan 7, 2018
7c936b4
additional dopckerfile
wende Jan 7, 2018
1b6cc99
Merge pull request #17 from wende/add-elchemy-compilation
wende Jan 7, 2018
9b7c725
rm erl crash
wende Jan 7, 2018
94ba4b8
style is important
wende Jan 7, 2018
2c19296
Better colour for modules
wende Jan 7, 2018
22d889e
Remove buttons that don't work yet
wende Jan 8, 2018
370708d
erl crash ignore
wende Jan 8, 2018
0747fc9
tips
wende Jan 8, 2018
36590b0
live tips
wende Feb 8, 2018
a9cf933
Merge pull request #25 from wende/23-live-tips
wende Feb 8, 2018
2553f5e
Corrected typo (#27)
ShalokShalom Mar 19, 2018
78a2f0e
examples
wende May 7, 2018
11589b0
examples
wende May 7, 2018
32ff7f5
Add elm compiler
wende Sep 21, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
node_modules/
.mongodata/
elm-stuff/
.DS_Store
.secretenv
*.pyc
__pycache__/
npm-debug.log
env/
.packages_index/
.vscode
.*~
client/elm-stuff/generated-code
7 changes: 7 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
SERVER_HOSTNAME=http://0.0.0.0:5000
PACKAGE_SYNC_INTERVAL_MINUTES=1
ENV=development
NODE_ENV=development
FLASK_APP=server/server.py
FLASK_DEBUG=1
CDN_BASE="/"
32 changes: 0 additions & 32 deletions .github/CONTRIBUTING.md

This file was deleted.

14 changes: 0 additions & 14 deletions .github/ISSUE_TEMPLATE.md

This file was deleted.

24 changes: 0 additions & 24 deletions .github/PULL_REQUEST_TEMPLATE.md

This file was deleted.

8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ node_modules/
.mongodata/
elm-stuff/
.DS_Store
.env
.secretenv
build/
client_log
server_log
*.pyc
__pycache__/
npm-debug.log
Expand All @@ -13,3 +15,7 @@ env/
output/
bower_components/
.pulp-cache/
.vscode
.*~
.secretenv
erl_crash.dump
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM python:3

ADD . /app
WORKDIR "/app"
RUN pip3 install -r requirements.txt

CMD env && (yarn watch &) && flask run --host=0.0.0.0 --port=$PORT

EXPOSE 5000
9 changes: 9 additions & 0 deletions Dockerfile.web
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM python:3

ADD . /app
WORKDIR "/app"
RUN pip3 install -r requirements.txt

CMD env && (yarn watch &) && flask run --host=0.0.0.0 --port=$PORT

EXPOSE 5000
29 changes: 29 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
all:
make setup
make build-compiler
yarn elm-css
./dotenv yarn build:production

setup:
python3 -m venv ./env && . env/bin/activate && pip3 install -r requirements.txt
yarn
cd client && elm-install && cd ../

docker-build:
./dotenv yarn build:production
docker build . -t elchemy:dev

docker-run:
docker run --env-file .env --env-file .secretenv -p 5000:5000 -p 8000:8000 -e PORT=5000 -d --name elchemy elchemy:dev

heroku-publish:
heroku container:push web -a elchemy-live --recursive

start-server:
./dotenv flask run

start-client:
./dotenv yarn watch

build-compiler:
./dotenv npm run-script build:make
56 changes: 2 additions & 54 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,55 +1,3 @@
# Ellie
# Elchemy live

## Development

### Requirements
- [Python 3](https://www.python.org/downloads/)
- [Node.js LTS](https://nodejs.org/en/download/)
- [Elm 0.18.0](https://guide.elm-lang.org/install.html)

### Setup
1. Copy `.env.example` to `.env`, filling in the following required variables:
- `AWS_S3_BUCKET`: an S3 bucket to which you want to save revisions
- `AWS_ACCESS_KEY_ID`: an access key id for an AWS user that has write access to your S3 bucket
- `AWS_SECRET_ACCESS_KEY`: a secret access key for an AWS user that has write access to your S3 bucket

> I don't recommend that you change the CDN_BASE variable right now, it's needed for loading the compiler web worker and installing packages

2. Choose your favorite way to load `.env` files
- I have a shell function that does it:
```
function dotenv () {
env $(cat .env | xargs) $*
}
```
- There are various `dotenv` programs written in different languages that you can try

3. Give `http://localhost:5000` write access to your S3 bucket
![AWS Bucket CORS Config](docs/images/aws_bucket_cors.png)

4. Set up a virtual python environment and load it.
```
python3 -m venv ./env && . env/bin/activate
```

5. Install Python dependencies
```
pip install -r requirements.txt
```

6. Install frontend dependencies
```
npm install
```

7. Run the server
```
dotenv flask run
```

8. Run the client development server
```
dotenv npm run watch
```

9. Open `http://localhost:5000`
## PROJECT UNDER DEVELOPMENT. NO STABLE VERSION ACCESSIBLE YET
18 changes: 18 additions & 0 deletions bucket_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import boto3
from botocore.client import Config
from botocore.exceptions import ClientError

def test_bucket(bucket):
print 'testing bucket: ' + bucket
try:
s3 = boto3.resource('s3', config=Config(signature_version='s3v4'))
b = s3.Bucket(bucket)
objects = b.objects.all()

for obj in objects:
print obj.key
print 'bucket test SUCCESS'
except ClientError as e:
print 'Client Error'
print e
print 'bucket test FAIL'
55 changes: 46 additions & 9 deletions client/css/Colors.elm
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,47 @@ type alias BoxShadow =
}


borderGrey : Color
borderGrey =
hex "#606671"


boxShadow : BoxShadow
boxShadow =
{ right = boxShadow5 (px 2) zero (px 4) zero <| rgba 0 0 0 0.75
, bottom = boxShadow5 zero (px 2) (px 4) zero <| rgba 0 0 0 0.75
, left = boxShadow5 (px -2) zero (px 4) zero <| rgba 0 0 0 0.75
, bottomHover = boxShadow5 zero (px 3) (px 4) zero <| rgba 0 0 0 0.75
, popout = boxShadow5 zero (px 2) (px 8) (px 2) <| rgba 0 0 0 0.75
, top = boxShadow5 zero (px -2) (px 4) zero <| rgba 0 0 0 0.75
{ right = borderRight3 (px 0) solid borderGrey
, bottom = borderBottom3 (px 0) solid borderGrey
, left = borderLeft3 (px 0) solid borderGrey
, bottomHover = borderBottom3 (px 0) solid borderGrey
, popout = border3 (px 0) solid borderGrey
, top = borderTop3 (px 0) solid borderGrey
}



-- border3 (px 2) solid (hex "#bcc7d2")
-- boxShadow : BoxShadow
-- boxShadow =
-- { right = boxShadow5 (px 2) zero (px 4) zero <| rgba 0 0 0 0.75
-- , bottom = boxShadow5 zero (px 2) (px 4) zero <| rgba 0 0 0 0.75
-- , left = boxShadow5 (px -2) zero (px 4) zero <| rgba 0 0 0 0.75
-- , bottomHover = boxShadow5 zero (px 3) (px 4) zero <| rgba 0 0 0 0.75
-- , popout = boxShadow5 zero (px 2) (px 8) (px 2) <| rgba 0 0 0 0.75
-- , top = boxShadow5 zero (px -2) (px 4) zero <| rgba 0 0 0 0.75
-- }


elchemyGradient : BackgroundImage (ListStyle {})
elchemyGradient =
linearGradient2 toRight (stop <| hex "#272c35") (stop <| hex "#272c35") []



-- linearGradient2 toRight (stop <| hex "#4e2a8e") (stop <| hex "#60b5cc") []


darkMediumGray : Color
darkMediumGray =
hex "292929"
hex "#292929"


lightGray : Color
Expand All @@ -41,12 +68,12 @@ mediumGray =

pink : Color
pink =
hex "#FC6ECC"
hex "#5669aa"


darkGray : Color
darkGray =
hex "#1D1D1D"
hex "#272c35"


lightMediumGray : Color
Expand All @@ -72,3 +99,13 @@ blue =
red : Color
red =
hex "#ec5f67"


white : Color
white =
hex "#ffffff"


blueGrey : Color
blueGrey =
hex "#2F3541"
12 changes: 6 additions & 6 deletions client/css/Ellie/Ui/Button.elm
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ primary : UniqueClass
primary =
uniqueClass
[ backgroundColor Colors.mediumGray
, color Colors.lightGray
, color Colors.white
, backgroundShared
]

Expand All @@ -54,24 +54,24 @@ accent : UniqueClass
accent =
uniqueClass
[ backgroundColor Colors.pink
, color Colors.lightGray
, color Colors.white
, backgroundShared
]


link : UniqueClass
link =
uniqueClass
[ color Colors.lightMediumGray
[ color (hex "#606671")
, padding zero |> important
, property "background" "none"
, fontWeight bold
, property "transition" "color 150ms"
, hover
[ color Colors.lightGray
[ color Colors.white
]
, disabled
[ color Colors.lightMediumGray
[ color Colors.white
]
]

Expand Down Expand Up @@ -121,6 +121,6 @@ inner =
disabledLink : UniqueClass
disabledLink =
uniqueClass
[ hover [ color Colors.lightMediumGray |> important ]
[ hover [ color Colors.white |> important ]
, cursor notAllowed
]
Loading