Skip to content
This repository was archived by the owner on Sep 18, 2021. It is now read-only.

Commit b86dbcd

Browse files
committed
starting as umbrella project, phoenix in lambdex_server and a base for lambdex_core
1 parent 25d3fab commit b86dbcd

File tree

92 files changed

+13637
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+13637
-0
lines changed

.formatter.exs

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[
2+
import_deps: [:ecto, :phoenix],
3+
inputs: ["*.{ex,exs}", "priv/*/seeds.exs", "{config,lib,test}/**/*.{ex,exs}"],
4+
subdirectories: ["priv/*/migrations"]
5+
]

.gitignore

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# The directory Mix will write compiled artifacts to.
2+
/_build/
3+
4+
# If you run "mix test --cover", coverage assets end up here.
5+
/cover/
6+
7+
# The directory Mix downloads your dependencies sources to.
8+
/deps/
9+
10+
# Where 3rd-party dependencies like ExDoc output generated docs.
11+
/doc/
12+
13+
# Ignore .fetch files in case you like to edit your project deps locally.
14+
/.fetch
15+
16+
# If the VM crashes, it generates a dump, let's ignore it too.
17+
erl_crash.dump
18+
19+
# Also ignore archive artifacts (built via "mix archive.build").
20+
*.ez
21+
22+
# Ignore package tarball (built via "mix hex.build").
23+
lambdex-*.tar
24+
25+
# If NPM crashes, it generates a log, let's ignore it too.
26+
npm-debug.log
27+
28+
.elixir_ls
29+
30+
lambdex.iml
31+
.idea/

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Lambdex
2+
3+
**TODO: Add description**
4+

apps/lambdex_core/.formatter.exs

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Used by "mix format"
2+
[
3+
inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"]
4+
]

apps/lambdex_core/.gitignore

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# The directory Mix will write compiled artifacts to.
2+
/_build/
3+
4+
# If you run "mix test --cover", coverage assets end up here.
5+
/cover/
6+
7+
# The directory Mix downloads your dependencies sources to.
8+
/deps/
9+
10+
# Where 3rd-party dependencies like ExDoc output generated docs.
11+
/doc/
12+
13+
# Ignore .fetch files in case you like to edit your project deps locally.
14+
/.fetch
15+
16+
# If the VM crashes, it generates a dump, let's ignore it too.
17+
erl_crash.dump
18+
19+
# Also ignore archive artifacts (built via "mix archive.build").
20+
*.ez
21+
22+
# Ignore package tarball (built via "mix hex.build").
23+
lambdex_core-*.tar
24+

apps/lambdex_core/README.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# LambdexCore
2+
3+
**TODO: Add description**
4+
5+
## Installation
6+
7+
If [available in Hex](https://hex.pm/docs/publish), the package can be installed
8+
by adding `lambdex_core` to your list of dependencies in `mix.exs`:
9+
10+
```elixir
11+
def deps do
12+
[
13+
{:lambdex_core, "~> 0.1.0"}
14+
]
15+
end
16+
```
17+
18+
Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)
19+
and published on [HexDocs](https://hexdocs.pm). Once published, the docs can
20+
be found at [https://hexdocs.pm/lambdex_core](https://hexdocs.pm/lambdex_core).
21+

apps/lambdex_core/config/config.exs

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# This file is responsible for configuring your application
2+
# and its dependencies with the aid of the Mix.Config module.
3+
use Mix.Config
4+
5+
# This configuration is loaded before any dependency and is restricted
6+
# to this project. If another project depends on this project, this
7+
# file won't be loaded nor affect the parent project. For this reason,
8+
# if you want to provide default values for your application for
9+
# 3rd-party users, it should be done in your "mix.exs" file.
10+
11+
# You can configure your application as:
12+
#
13+
# config :lambdex_core, key: :value
14+
#
15+
# and access this configuration in your application as:
16+
#
17+
# Application.get_env(:lambdex_core, :key)
18+
#
19+
# You can also configure a 3rd-party app:
20+
#
21+
# config :logger, level: :info
22+
#
23+
24+
# It is also possible to import configuration files, relative to this
25+
# directory. For example, you can emulate configuration per environment
26+
# by uncommenting the line below and defining dev.exs, test.exs and such.
27+
# Configuration from the imported file will override the ones defined
28+
# here (which is why it is important to import them last).
29+
#
30+
# import_config "#{Mix.env()}.exs"

apps/lambdex_core/lib/lambdex_core.ex

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
defmodule LambdexCore do
2+
@moduledoc """
3+
Documentation for LambdexCore.
4+
"""
5+
6+
@doc """
7+
Hello world.
8+
9+
## Examples
10+
11+
iex> LambdexCore.hello()
12+
:world
13+
14+
"""
15+
def hello do
16+
:world
17+
end
18+
end

apps/lambdex_core/mix.exs

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
defmodule LambdexCore.MixProject do
2+
use Mix.Project
3+
4+
def project do
5+
[
6+
app: :lambdex_core,
7+
version: "0.1.0",
8+
build_path: "../../_build",
9+
config_path: "../../config/config.exs",
10+
deps_path: "../../deps",
11+
lockfile: "../../mix.lock",
12+
elixir: "~> 1.7",
13+
start_permanent: Mix.env() == :prod,
14+
deps: deps()
15+
]
16+
end
17+
18+
# Run "mix help compile.app" to learn about applications.
19+
def application do
20+
[
21+
extra_applications: [:logger]
22+
]
23+
end
24+
25+
# Run "mix help deps" to learn about dependencies.
26+
defp deps do
27+
[
28+
# {:dep_from_hexpm, "~> 0.3.0"},
29+
# {:dep_from_git, git: "https://github.com/elixir-lang/my_dep.git", tag: "0.1.0"},
30+
# {:sibling_app_in_umbrella, in_umbrella: true},
31+
]
32+
end
33+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
defmodule LambdexCoreTest do
2+
use ExUnit.Case
3+
doctest LambdexCore
4+
5+
test "greets the world" do
6+
assert LambdexCore.hello() == :world
7+
end
8+
end
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ExUnit.start()

apps/lambdex_server/.formatter.exs

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[
2+
import_deps: [:ecto, :phoenix],
3+
inputs: ["*.{ex,exs}", "priv/*/seeds.exs", "{config,lib,test}/**/*.{ex,exs}"],
4+
subdirectories: ["priv/*/migrations"]
5+
]

apps/lambdex_server/.gitignore

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# The directory Mix will write compiled artifacts to.
2+
/_build/
3+
4+
# If you run "mix test --cover", coverage assets end up here.
5+
/cover/
6+
7+
# The directory Mix downloads your dependencies sources to.
8+
/deps/
9+
10+
# Where 3rd-party dependencies like ExDoc output generated docs.
11+
/doc/
12+
13+
# Ignore .fetch files in case you like to edit your project deps locally.
14+
/.fetch
15+
16+
# If the VM crashes, it generates a dump, let's ignore it too.
17+
erl_crash.dump
18+
19+
# Also ignore archive artifacts (built via "mix archive.build").
20+
*.ez
21+
22+
# Ignore package tarball (built via "mix hex.build").
23+
lambdex-*.tar
24+
25+
# If NPM crashes, it generates a log, let's ignore it too.
26+
npm-debug.log
27+
28+
# The directory NPM downloads your dependencies sources to.
29+
/assets/node_modules/
30+
31+
# Since we are building assets from assets/,
32+
# we ignore priv/static. You may want to comment
33+
# this depending on your deployment strategy.
34+
/priv/static/
35+
36+
# Files matching config/*.secret.exs pattern contain sensitive
37+
# data and you should not commit them into version control.
38+
#
39+
# Alternatively, you may comment the line below and commit the
40+
# secrets files as long as you replace their contents by environment
41+
# variables.
42+
/config/*.secret.exs
43+
44+
.elixir_ls
45+
46+
lambdex.iml
47+
.idea/

apps/lambdex_server/README.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# LambdexServer
2+
3+
LambdexServer is a Lambda server for running remote functions without provisioning or managing servers done in Elixir.
4+
5+
To start your Phoenix server:
6+
7+
* Install dependencies with `mix deps.get`
8+
* Create and migrate your database with `mix ecto.setup`
9+
* Install Node.js dependencies with `cd assets && npm install`
10+
* Start Phoenix endpoint with `mix phx.server`
11+
12+
Now you can visit [`localhost:4000`](http://localhost:4000) from your browser.
13+
14+
Ready to run in production? Please [check our deployment guides](https://hexdocs.pm/phoenix/deployment.html).
15+

apps/lambdex_server/assets/.babelrc

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"presets": [
3+
"@babel/preset-env",
4+
"@babel/preset-react"
5+
]
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@import '~bulma/sass/utilities/initial-variables.sass'
2+
3+
// ADD HERE variables you want to override
4+
5+
@import '~bulma/sass/utilities/_all.sass'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@import "~react-bulma-components/src/index.sass";

apps/lambdex_server/assets/js/App.js

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import React, {Component} from 'react';
2+
import Navbar from "react-bulma-components/lib/components/navbar";
3+
import AppRouter from "./AppRouter";
4+
5+
class App extends Component {
6+
render() {
7+
return (
8+
<div>
9+
<Navbar color="light" fixed="top" active>
10+
<Navbar.Brand>
11+
<Navbar.Item renderAs="h1" href="#">
12+
lambdex
13+
</Navbar.Item>
14+
</Navbar.Brand>
15+
<Navbar.Menu>
16+
</Navbar.Menu>
17+
</Navbar>
18+
<AppRouter/>
19+
</div>
20+
);
21+
}
22+
}
23+
24+
export default App;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import React from 'react';
2+
import ReactDOM from 'react-dom';
3+
import App from './App';
4+
5+
it('renders without crashing', () => {
6+
const div = document.createElement('div');
7+
ReactDOM.render(<App />, div);
8+
ReactDOM.unmountComponentAtNode(div);
9+
});
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import React, {Fragment} from 'react';
2+
import Home from "./components/pages/Home";
3+
import {Route, BrowserRouter as Router} from "react-router-dom";
4+
import Login from "./components/pages/Login";
5+
6+
const AppRouter = () => (
7+
<Router>
8+
<Fragment>
9+
<Route path="/" exact component={Home}/>
10+
<Route path="/login/" component={Login}/>
11+
</Fragment>
12+
</Router>
13+
);
14+
15+
export default AppRouter
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import React from 'react';
2+
3+
const Home = () => <h1>Home</h1>;
4+
5+
6+
export default Home
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import React from 'react';
2+
import Section from "react-bulma-components/lib/components/section";
3+
import Columns from "react-bulma-components/lib/components/columns";
4+
import Container from "react-bulma-components/lib/components/container";
5+
import Box from "react-bulma-components/lib/components/box";
6+
7+
import {Field, Input, Control} from "react-bulma-components/lib/components/form";
8+
import Button from "react-bulma-components/lib/components/button";
9+
10+
const Login = () => (
11+
<Section>
12+
<Container >
13+
<Columns>
14+
<Columns.Column size={4} offset={4}>
15+
<Box>
16+
<Field>
17+
<Control>
18+
<Input type="text" placeholder="username" />
19+
</Control>
20+
</Field>
21+
<Field>
22+
<Control>
23+
<Input type="text" placeholder="password" />
24+
</Control>
25+
</Field>
26+
<Button color={"info"} fullwidth size={"large"}>Login</Button>
27+
</Box>
28+
</Columns.Column>
29+
</Columns>
30+
</Container>
31+
</Section>
32+
);
33+
34+
35+
export default Login
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import React from 'react';
2+
import ReactDOM from 'react-dom';
3+
import '../css/index.scss';
4+
import App from './App';
5+
6+
ReactDOM.render(<App />, document.getElementById('root'));
7+
+7
Loading

0 commit comments

Comments
 (0)