Skip to content

Commit

Permalink
implement Hackernews app
Browse files Browse the repository at this point in the history
  • Loading branch information
mjarosie committed Jul 9, 2020
1 parent 6f14f64 commit 6029ca2
Show file tree
Hide file tree
Showing 6 changed files with 570 additions and 30 deletions.
21 changes: 18 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,36 @@
# Elmish Getting Started

This is a simple Fable application including an [Elmish](https://elmish.github.io/) counter. The repository is made for learning purposes and the generated Javascript output is not optimized. That said, the template shows you how easy it is to get started with Fable and Elmish using minimal configuration.
This is a simple Fable application which enables you to browse Hackernews stories. It was implemented when completing an excercise in [Elmish Book](https://zaid-ajaj.github.io/the-elmish-book/#/chapters/commands/elmish-hackernews).

The app uses [HackerNews API](https://github.com/HackerNews/API) and retrieves 4 different types of stories:

- new
- top
- best
- jobs

Stories are loaded lazily - you can retrieve 10 more stories to be displayed with a button at the bottom of the page.

## Building and running the app

First of all, start with installing the project's npm dependencies

```bash
npm install
```

Once this is finished, you can then build and compile the project:
```

```bash
npm run build
```

You can start developing the application in watch mode using the webpack development server:
```

```bash
npm start
```

After the first compilation is finished, navigate to http://localhost:8080 in your browser to see the application.

### VS Code
Expand Down
8 changes: 7 additions & 1 deletion dist/index.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
<!doctype html>
<!DOCTYPE html>
<html>
<head>
<title>Fable</title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.9.0/css/bulma.min.css" />
<link rel="stylesheet"
href="https://use.fontawesome.com/releases/v5.8.1/css/all.css"
integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf"
crossorigin="anonymous" />
<link rel="shortcut icon" href="fable.ico" />
</head>
<body>
Expand Down
131 changes: 131 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,19 @@
"private": true,
"scripts": {
"start": "webpack-dev-server",
"build": "webpack"
"build": "webpack",
"serve": "http-server ./dist"
},
"dependencies": {
"date-fns": "^2.14.0",
"react": "^16.8.0",
"react-dom": "^16.8.0"
},
"devDependencies": {
"@babel/core": "^7.1.2",
"fable-compiler": "^2.4.16",
"fable-loader": "^2.1.8",
"http-server": "^0.12.3",
"webpack": "^4.38.0",
"webpack-cli": "^3.3.6",
"webpack-dev-server": "^3.7.2"
Expand Down
Loading

0 comments on commit 6029ca2

Please sign in to comment.