This repository has been archived by the owner on Aug 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: adds new Phoenix application that will serve as the backend [F…
…ixes #4] (#13) * Add explicit asdf `.tool-versions` file with current erlang and elixir. * Adds a Phoenix 1.7.7 application project to be the backend of the platform. * Update the README to hint at the use of asdf for tool version management.
- Loading branch information
Showing
925 changed files
with
5,323 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
erlang 26.0.2 | ||
elixir 1.15.5-otp-26 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
# StudyHall | ||
|
||
The intent of this repo is to serve as a monorepo which shall house both the backend (Elixir), frontend (SvelteKit), as well as various project documentation and issues. | ||
|
||
## Tools We Use | ||
|
||
* [asdf](https://asdf-vm.com/) is a version management system for command line tools. You'll find a `.tool-versions` file at the root of this project that helps define the expected versions of thinks like Erlang and Elixir. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[ | ||
import_deps: [:ecto, :ecto_sql, :phoenix], | ||
subdirectories: ["priv/*/migrations"], | ||
plugins: [Phoenix.LiveView.HTMLFormatter], | ||
inputs: ["*.{heex,ex,exs}", "{config,lib,test}/**/*.{heex,ex,exs}", "priv/*/seeds.exs"] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# The directory Mix will write compiled artifacts to. | ||
/_build/ | ||
|
||
# If you run "mix test --cover", coverage assets end up here. | ||
/cover/ | ||
|
||
# The directory Mix downloads your dependencies sources to. | ||
/deps/ | ||
|
||
# Where 3rd-party dependencies like ExDoc output generated docs. | ||
/doc/ | ||
|
||
# Ignore .fetch files in case you like to edit your project deps locally. | ||
/.fetch | ||
|
||
# If the VM crashes, it generates a dump, let's ignore it too. | ||
erl_crash.dump | ||
|
||
# Also ignore archive artifacts (built via "mix archive.build"). | ||
*.ez | ||
|
||
# Temporary files, for example, from tests. | ||
/tmp/ | ||
|
||
# Ignore package tarball (built via "mix hex.build"). | ||
study_hall-*.tar | ||
|
||
# Ignore assets that are produced by build tools. | ||
/priv/static/assets/ | ||
|
||
# Ignore digested assets cache. | ||
/priv/static/cache_manifest.json | ||
|
||
# In case you use Node.js/npm, you want to ignore these. | ||
npm-debug.log | ||
/assets/node_modules/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# StudyHall | ||
|
||
To start your Phoenix server: | ||
|
||
* Run `mix setup` to install and setup dependencies | ||
* Start Phoenix endpoint with `mix phx.server` or inside IEx with `iex -S mix phx.server` | ||
|
||
Now you can visit [`localhost:4000`](http://localhost:4000) from your browser. | ||
|
||
Ready to run in production? Please [check our deployment guides](https://hexdocs.pm/phoenix/deployment.html). | ||
|
||
## Learn more | ||
|
||
* Official website: https://www.phoenixframework.org/ | ||
* Guides: https://hexdocs.pm/phoenix/overview.html | ||
* Docs: https://hexdocs.pm/phoenix | ||
* Forum: https://elixirforum.com/c/phoenix-forum | ||
* Source: https://github.com/phoenixframework/phoenix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@import "tailwindcss/base"; | ||
@import "tailwindcss/components"; | ||
@import "tailwindcss/utilities"; | ||
|
||
/* This file is for your main application CSS */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// If you want to use Phoenix channels, run `mix help phx.gen.channel` | ||
// to get started and then uncomment the line below. | ||
// import "./user_socket.js" | ||
|
||
// You can include dependencies in two ways. | ||
// | ||
// The simplest option is to put them in assets/vendor and | ||
// import them using relative paths: | ||
// | ||
// import "../vendor/some-package.js" | ||
// | ||
// Alternatively, you can `npm install some-package --prefix assets` and import | ||
// them using a path starting with the package name: | ||
// | ||
// import "some-package" | ||
// | ||
|
||
// Include phoenix_html to handle method=PUT/DELETE in forms and buttons. | ||
import "phoenix_html" | ||
// Establish Phoenix Socket and LiveView configuration. | ||
import {Socket} from "phoenix" | ||
import {LiveSocket} from "phoenix_live_view" | ||
import topbar from "../vendor/topbar" | ||
|
||
let csrfToken = document.querySelector("meta[name='csrf-token']").getAttribute("content") | ||
let liveSocket = new LiveSocket("/live", Socket, {params: {_csrf_token: csrfToken}}) | ||
|
||
// Show progress bar on live navigation and form submits | ||
topbar.config({barColors: {0: "#29d"}, shadowColor: "rgba(0, 0, 0, .3)"}) | ||
window.addEventListener("phx:page-loading-start", _info => topbar.show(300)) | ||
window.addEventListener("phx:page-loading-stop", _info => topbar.hide()) | ||
|
||
// connect if there are any LiveViews on the page | ||
liveSocket.connect() | ||
|
||
// expose liveSocket on window for web console debug logs and latency simulation: | ||
// >> liveSocket.enableDebug() | ||
// >> liveSocket.enableLatencySim(1000) // enabled for duration of browser session | ||
// >> liveSocket.disableLatencySim() | ||
window.liveSocket = liveSocket | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
// See the Tailwind configuration guide for advanced usage | ||
// https://tailwindcss.com/docs/configuration | ||
|
||
const plugin = require("tailwindcss/plugin") | ||
const fs = require("fs") | ||
const path = require("path") | ||
|
||
module.exports = { | ||
content: [ | ||
"./js/**/*.js", | ||
"../lib/*_web.ex", | ||
"../lib/*_web/**/*.*ex" | ||
], | ||
theme: { | ||
extend: { | ||
colors: { | ||
brand: "#FD4F00", | ||
} | ||
}, | ||
}, | ||
plugins: [ | ||
require("@tailwindcss/forms"), | ||
// Allows prefixing tailwind classes with LiveView classes to add rules | ||
// only when LiveView classes are applied, for example: | ||
// | ||
// <div class="phx-click-loading:animate-ping"> | ||
// | ||
plugin(({addVariant}) => addVariant("phx-no-feedback", [".phx-no-feedback&", ".phx-no-feedback &"])), | ||
plugin(({addVariant}) => addVariant("phx-click-loading", [".phx-click-loading&", ".phx-click-loading &"])), | ||
plugin(({addVariant}) => addVariant("phx-submit-loading", [".phx-submit-loading&", ".phx-submit-loading &"])), | ||
plugin(({addVariant}) => addVariant("phx-change-loading", [".phx-change-loading&", ".phx-change-loading &"])), | ||
|
||
// Embeds Heroicons (https://heroicons.com) into your app.css bundle | ||
// See your `CoreComponents.icon/1` for more information. | ||
// | ||
plugin(function({matchComponents, theme}) { | ||
let iconsDir = path.join(__dirname, "./vendor/heroicons/optimized") | ||
let values = {} | ||
let icons = [ | ||
["", "/24/outline"], | ||
["-solid", "/24/solid"], | ||
["-mini", "/20/solid"] | ||
] | ||
icons.forEach(([suffix, dir]) => { | ||
fs.readdirSync(path.join(iconsDir, dir)).map(file => { | ||
let name = path.basename(file, ".svg") + suffix | ||
values[name] = {name, fullPath: path.join(iconsDir, dir, file)} | ||
}) | ||
}) | ||
matchComponents({ | ||
"hero": ({name, fullPath}) => { | ||
let content = fs.readFileSync(fullPath).toString().replace(/\r?\n|\r/g, "") | ||
return { | ||
[`--hero-${name}`]: `url('data:image/svg+xml;utf8,${content}')`, | ||
"-webkit-mask": `var(--hero-${name})`, | ||
"mask": `var(--hero-${name})`, | ||
"mask-repeat": "no-repeat", | ||
"background-color": "currentColor", | ||
"vertical-align": "middle", | ||
"display": "inline-block", | ||
"width": theme("spacing.5"), | ||
"height": theme("spacing.5") | ||
} | ||
} | ||
}, {values}) | ||
}) | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2020 Refactoring UI Inc. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
You are running heroicons v2.0.16. To upgrade in place, you can run the following command, | ||
where your `HERO_VSN` export is your desired version: | ||
|
||
export HERO_VSN="2.0.16" ; \ | ||
curl -L "https://github.com/tailwindlabs/heroicons/archive/refs/tags/v${HERO_VSN}.tar.gz" | \ | ||
tar -xvz --strip-components=1 heroicons-${HERO_VSN}/optimized |
3 changes: 3 additions & 0 deletions
3
backend-elixir/assets/vendor/heroicons/optimized/20/solid/academic-cap.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
...nd-elixir/assets/vendor/heroicons/optimized/20/solid/adjustments-horizontal.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
backend-elixir/assets/vendor/heroicons/optimized/20/solid/adjustments-vertical.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
...nd-elixir/assets/vendor/heroicons/optimized/20/solid/archive-box-arrow-down.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions
4
backend-elixir/assets/vendor/heroicons/optimized/20/solid/archive-box-x-mark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions
4
backend-elixir/assets/vendor/heroicons/optimized/20/solid/archive-box.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
backend-elixir/assets/vendor/heroicons/optimized/20/solid/arrow-down-circle.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
backend-elixir/assets/vendor/heroicons/optimized/20/solid/arrow-down-left.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
...lixir/assets/vendor/heroicons/optimized/20/solid/arrow-down-on-square-stack.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
backend-elixir/assets/vendor/heroicons/optimized/20/solid/arrow-down-on-square.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
backend-elixir/assets/vendor/heroicons/optimized/20/solid/arrow-down-right.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions
4
backend-elixir/assets/vendor/heroicons/optimized/20/solid/arrow-down-tray.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
backend-elixir/assets/vendor/heroicons/optimized/20/solid/arrow-down.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions
10
backend-elixir/assets/vendor/heroicons/optimized/20/solid/arrow-left-circle.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions
4
...d-elixir/assets/vendor/heroicons/optimized/20/solid/arrow-left-on-rectangle.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
backend-elixir/assets/vendor/heroicons/optimized/20/solid/arrow-left.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
backend-elixir/assets/vendor/heroicons/optimized/20/solid/arrow-long-down.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
backend-elixir/assets/vendor/heroicons/optimized/20/solid/arrow-long-left.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
backend-elixir/assets/vendor/heroicons/optimized/20/solid/arrow-long-right.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
backend-elixir/assets/vendor/heroicons/optimized/20/solid/arrow-long-up.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
...elixir/assets/vendor/heroicons/optimized/20/solid/arrow-path-rounded-square.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
backend-elixir/assets/vendor/heroicons/optimized/20/solid/arrow-path.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
backend-elixir/assets/vendor/heroicons/optimized/20/solid/arrow-right-circle.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions
4
...-elixir/assets/vendor/heroicons/optimized/20/solid/arrow-right-on-rectangle.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
backend-elixir/assets/vendor/heroicons/optimized/20/solid/arrow-right.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.