• Stars
    star
    117
  • Rank 301,828 (Top 6 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 7 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Example application that shows how to use Cowboy 2.0 in conjunction with React and Redux to create data driven Single Page Applications

Cowboy + React SPA Example

This is an example application that shows how to use Cowboy 2.0 in conjunction with React and Redux to create data driven Single Page Applications.

This project has been developed using the following technologies:

Features

This repository contains the source code of a Todo list web application that pretends to serve as a mid size example to learn how to build modern SPAs with Elixir (not Phoenix) and React. In this project you will find how to implement important features and services such as:

Backend

  • Anonymous authentication (encoding and signing user with JWT)
  • RESTful JSON API (Cowboy REST handlers)
  • Serve static files (Cowboy static handler)
  • Authorization (decoding and verifying JWT)
  • Data modeling and persistency (Ecto + PostgreSQL)

Frontend

  • Component based SPA (React)
  • Application state management (Redux)
  • Async operations handling (Redux Saga)

Demo

Demo available here.

Demo#1 Demo#2 Mobile#1 Mobile#2

Setup

To start this application locally:

  1. Make sure you have installed Elixir, Erlang, Node, Yarn and PostgreSQL
  2. Install the Mix dependencies: $ mix deps.get
  3. Create and migrate the development database: $ mix ecto.setup
  4. Start the application with all its dependencies: $ iex -S mix
  5. Install the Node packages $ cd client/ && yarn install
  6. Start the web development server: $ yarn start

To build the JavaScript application for production:

  • In the client directory, run $ yarn build

Deployment with Docker

To run this application in production with Docker:

  1. Make sure both docker and docker-compose are installed on your production server.
  2. Create a .env file anywhere in your server:
  • Copy the information from this file.
  • Replace the placeholders with the data you want.
  1. Create a docker-compose.yml file in the same directory that you created the .env file:
  • Copy the information from this file.
  1. Start the services by running $ docker-compose up -d.

License

MIT

More Repositories

1

Loopa-News

Realtime social news app developed from scratch with Elixir, Phoenix, Vue and Vuex
JavaScript
319
star
2

phoenix-vue-demo

Basic app developed with Phoenix and Vue 2.0, including authentication.
JavaScript
77
star
3

realtime-todo-app

Realtime Todo application developed with Kemal, React, ES2015 and PostgreSQL
JavaScript
19
star
4

chat-app-demo

Chat application developed with Kemal, React, ES2015 and PostgreSQL
Crystal
16
star
5

kemal-ws-todo-app

Realtime Todo application developed with Kemal and Websockets
JavaScript
6
star
6

quick-xml2js-parser

XML to JS parser written in Rust, using the Neon bindings https://neon-bindings.com
Rust
4
star
7

Population.ex

Elixir OTP application library for the World Population API
Elixir
4
star
8

elm-crystal-chat

JavaScript
2
star
9

udemy_courses_scraping

Ruby
2
star
10

elm-subscriptions-basics

Elm
2
star
11

es6-simple-curry

simple curry javascript function
JavaScript
2
star
12

codility-lessons

My solutions for the Codility.com lessons problems
JavaScript
2
star
13

elm-role-players-app

Elm
2
star
14

example-basic-todo-list

1
star
15

elm-list-functions

Elm
1
star
16

jscodeshift-core-api

Lean package containing a subset of the jscodeshift core api
JavaScript
1
star
17

extract-metadata

JavaScript
1
star
18

elm-commands-basics

Elm
1
star
19

react-redux-express-crud

JavaScript
1
star
20

elm-first-steps

Elm
1
star
21

naive-translate-cli

JavaScript
1
star
22

elm-ascii-store

Elm
1
star
23

basic-cowboy-rest

Erlang
1
star
24

kemal-ws-pg-todo-app

Realtime Todo application developed with Kemal, Websockets, ES2015 and PostgreSQL
JavaScript
1
star
25

learning_rust_collections_exercises

Rust
1
star
26

elixir-concurrent-scraper

Concurrent scraper developed with Elixir
Elixir
1
star
27

learning_rust-2_guessing_game

Rust
1
star