Skip to content
This repository has been archived by the owner on Aug 14, 2024. It is now read-only.

Commit

Permalink
feat: add Houdini dependancy and basic course list on home page [Fixes
Browse files Browse the repository at this point in the history
…#58] (#59)

* adding notes file

* Add Houdini and configs.

* Add CORS responses to the backend.

* Add simple graphql response to home page.

* Change the CORS comment to a FIXME with a link to the issue.

* Allow FIXME comments.
  • Loading branch information
zorn authored Sep 30, 2023
1 parent 98b6575 commit d925a14
Show file tree
Hide file tree
Showing 18 changed files with 6,008 additions and 4,518 deletions.
2 changes: 1 addition & 1 deletion backend-elixir/.credo.exs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
# set this value to 0 (zero).
#
{Credo.Check.Design.TagTODO, [exit_status: 2]},
{Credo.Check.Design.TagFIXME, []},
{Credo.Check.Design.TagFIXME, false},

#
## Readability Checks
Expand Down
3 changes: 3 additions & 0 deletions backend-elixir/lib/study_hall/application.ex
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ defmodule StudyHall.Application do
# {StudyHall.Worker, arg}
]

# https://hexdocs.pm/corsica/Corsica.Telemetry.html#attach_default_handler/1
Corsica.Telemetry.attach_default_handler(log_levels: [rejected: :warning])

# See https://hexdocs.pm/elixir/Supervisor.html
# for other strategies and supported options
opts = [strategy: :one_for_one, name: StudyHall.Supervisor]
Expand Down
7 changes: 7 additions & 0 deletions backend-elixir/lib/study_hall_web/endpoint.ex
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ defmodule StudyHallWeb.Endpoint do
same_site: "Lax"
]

# FIXME: Make this more restrictive.
# https://github.com/studyhall-project/studyhall/issues/61
# The current frontend is at: localhost:5173
plug Corsica,
origins: "*",
allow_headers: ["content-type", "accept"]

socket "/live", Phoenix.LiveView.Socket, websocket: [connect_info: [session: @session_options]]

# Serve at "/" the static files from "priv/static" directory.
Expand Down
1 change: 1 addition & 0 deletions backend-elixir/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ defmodule StudyHall.MixProject do
{:ash_phoenix, "~> 1.2"},
{:ash_postgres, "~> 1.3"},
{:ash, "~> 2.14"},
{:corsica, "~> 2.0"},
{:credo, "~> 1.7", only: [:dev, :test], runtime: false},
{:dialyxir, "~> 1.3", only: [:dev], runtime: false},
{:ecto_sql, "~> 3.10"},
Expand Down
1 change: 1 addition & 0 deletions backend-elixir/mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"bunt": {:hex, :bunt, "0.2.1", "e2d4792f7bc0ced7583ab54922808919518d0e57ee162901a16a1b6664ef3b14", [:mix], [], "hexpm", "a330bfb4245239787b15005e66ae6845c9cd524a288f0d141c148b02603777a5"},
"castore": {:hex, :castore, "1.0.3", "7130ba6d24c8424014194676d608cb989f62ef8039efd50ff4b3f33286d06db8", [:mix], [], "hexpm", "680ab01ef5d15b161ed6a95449fac5c6b8f60055677a8e79acf01b27baa4390b"},
"comparable": {:hex, :comparable, "1.0.0", "bb669e91cedd14ae9937053e5bcbc3c52bb2f22422611f43b6e38367d94a495f", [:mix], [{:typable, "~> 0.1", [hex: :typable, repo: "hexpm", optional: false]}], "hexpm", "277c11eeb1cd726e7cd41c6c199e7e52fa16ee6830b45ad4cdc62e51f62eb60c"},
"corsica": {:hex, :corsica, "2.1.2", "0f1bc7648f9a41abca557c8158c110269d61a1465468be2416621991e316ff56", [:mix], [{:plug, "~> 1.0", [hex: :plug, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "c778c6ded25ec78c57c64a7b769edb388ec8f162ea3b6f10fa2580fb13fb2afb"},
"cowboy": {:hex, :cowboy, "2.10.0", "ff9ffeff91dae4ae270dd975642997afe2a1179d94b1887863e43f681a203e26", [:make, :rebar3], [{:cowlib, "2.12.1", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "1.8.0", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "3afdccb7183cc6f143cb14d3cf51fa00e53db9ec80cdcd525482f5e99bc41d6b"},
"cowboy_telemetry": {:hex, :cowboy_telemetry, "0.4.0", "f239f68b588efa7707abce16a84d0d2acf3a0f50571f8bb7f56a15865aae820c", [:rebar3], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "7d98bac1ee4565d31b62d59f8823dfd8356a169e7fcbb83831b8a5397404c9de"},
"cowlib": {:hex, :cowlib, "2.12.1", "a9fa9a625f1d2025fe6b462cb865881329b5caff8f1854d1cbc9f9533f00e1e1", [:make, :rebar3], [], "hexpm", "163b73f6367a7341b33c794c4e88e7dbfe6498ac42dcd69ef44c5bc5507c8db0"},
Expand Down
2 changes: 2 additions & 0 deletions frontend-sveltekit/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ node_modules
!.env.example
vite.config.js.timestamp-*
vite.config.ts.timestamp-*

$houdini
9 changes: 9 additions & 0 deletions frontend-sveltekit/.graphqlrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
projects:
default:
schema:
- ./schema.graphql
- ./$houdini/graphql/schema.graphql
documents:
- '**/*.gql'
- '**/*.svelte'
- ./$houdini/graphql/documents.gql
13 changes: 13 additions & 0 deletions frontend-sveltekit/houdini.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/// <references types="houdini-svelte">

/** @type {import('houdini').ConfigFile} */
const config = {
"watchSchema": {
"url": "http://localhost:4000/gql"
},
"plugins": {
"houdini-svelte": {}
}
}

export default config
Loading

0 comments on commit d925a14

Please sign in to comment.