Skip to content

Commit

Permalink
oh shit the frontend and backend are talking to each other!
Browse files Browse the repository at this point in the history
  • Loading branch information
bshlgrs committed Nov 3, 2016
1 parent c87a409 commit 21d4537
Show file tree
Hide file tree
Showing 22 changed files with 1,352 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -123,7 +123,7 @@ but can also do other things...

These are all eminently doable.

There might be some trickiness in making it easy for users to find all those methods--maybe they won't guess the name of `find_mode` or `pop!` or something like that.
There might be some trickiness in making it easy for users to find all those methods--maybe they won't guess the name of `find_mode` or `pop!` or something like that. I will probably make a web app with descriptions for each method and data structure, and then send them to be backend with each request.

----

Expand Down
50 changes: 48 additions & 2 deletions build.sbt
Expand Up @@ -8,13 +8,59 @@ mainClass in Compile := Some("webapp.WebApp")

scalaVersion := "2.11.8"

resolvers ++= List(
Resolver.sonatypeRepo("releases"),
"Typesafe Repo" at "http://repo.typesafe.com/typesafe/releases/"
)


libraryDependencies += "org.parboiled" %% "parboiled" % "2.1.3"
libraryDependencies ++= Seq(
"com.chuusai" %% "shapeless" % "2.3.1",
"org.scalatest" % "scalatest_2.11" % "3.0.0"// % "test"
, "com.lihaoyi" %%% "fastparse" % "0.4.1",
"org.scalatest" % "scalatest_2.11" % "3.0.0",
"com.lihaoyi" %%% "fastparse" % "0.4.1",
"org.scalacheck" %% "scalacheck" % "1.13.2"
)

libraryDependencies += "org.scala-js" %%% "scalajs-dom" % "0.9.0"

scalaJSUseRhino in Global := false

javaOptions ++= Seq(
"-Dlog.service.output=/dev/stderr",
"-Dlog.access.output=/dev/stderr")

resolvers ++= Seq(
Resolver.sonatypeRepo("releases"),
"Twitter Maven" at "https://maven.twttr.com")

lazy val versions = new {
val finatra = "2.3.0"
val guice = "4.0"
val logback = "1.1.7"
val mockito = "1.9.5"
val scalatest = "2.2.6"
val specs2 = "2.3.12"
}

libraryDependencies ++= Seq(
"com.twitter" %% "finatra-http" % versions.finatra,
"ch.qos.logback" % "logback-classic" % versions.logback,
"ch.qos.logback" % "logback-classic" % versions.logback % "test",

"com.twitter" %% "finatra-http" % versions.finatra % "test",
"com.twitter" %% "inject-server" % versions.finatra % "test",
"com.twitter" %% "inject-app" % versions.finatra % "test",
"com.twitter" %% "inject-core" % versions.finatra % "test",
"com.twitter" %% "inject-modules" % versions.finatra % "test",
"com.google.inject.extensions" % "guice-testlib" % versions.guice % "test",

"com.twitter" %% "finatra-http" % versions.finatra % "test" classifier "tests",
"com.twitter" %% "inject-server" % versions.finatra % "test" classifier "tests",
"com.twitter" %% "inject-app" % versions.finatra % "test" classifier "tests",
"com.twitter" %% "inject-core" % versions.finatra % "test" classifier "tests",
"com.twitter" %% "inject-modules" % versions.finatra % "test" classifier "tests",

"org.mockito" % "mockito-core" % versions.mockito % "test",
"org.scalatest" %% "scalatest" % versions.scalatest % "test",
"org.specs2" %% "specs2" % versions.specs2 % "test")
7 changes: 7 additions & 0 deletions data/data_structures.txt
Expand Up @@ -87,3 +87,10 @@ ds InvertibleReductionMemoizer[f] if f.invertible, f.commutative {
deleteNode! <- 1 + getByIndex
}

ds EquivalenceClassPopularityHeap[f] {
updateNode! <- 1
deleteAtIndex! <- 1
insertAtIndex! <- 1
countOfEquivalenceClass[f] <- 1
mostNumerousEquivalenceClass[f] <- 1
}
4 changes: 2 additions & 2 deletions data/implementations.txt
Expand Up @@ -67,8 +67,8 @@ getMinimum <- getLastBy[valueOrdering]
getMinimum <- getFirstBy[valueOrdering]
deleteFirstBy![f] <- getFirstBy[f] + deleteNode!
deleteLastBy![f] <- getLastBy[f] + deleteNode!
deleteFirst! <- deleteFirstBy![valueOrdering]
deleteLast! <- deleteLastBy![valueOrdering]
deleteSmallest! <- deleteFirstBy![valueOrdering]
deleteBiggest! <- deleteLastBy![valueOrdering]
getFirstNodeWithValue[f] <- unorderedEach[f]
// The obvious implementation for getNearest is to just loop over everything
getNearest[f] <- unorderedEach[f]
Expand Down
17 changes: 17 additions & 0 deletions nginx-configuration
@@ -0,0 +1,17 @@
server {
listen 8081;
server_name localhost;

#access_log logs/host.access.log main;

location /api/ {
proxy_pass http://127.0.0.1:8888/;
}

location / {
proxy_pass http://127.0.0.1:3000/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
15 changes: 15 additions & 0 deletions react-frontend/.gitignore
@@ -0,0 +1,15 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.

# dependencies
node_modules

# testing
coverage

# production
build

# misc
.DS_Store
.env
npm-debug.log

0 comments on commit 21d4537

Please sign in to comment.