Skip to content

Commit 4ec98d7

Browse files
committed
web init
1 parent 5eed0ba commit 4ec98d7

22 files changed

+4793
-13
lines changed

.github/workflows/deploy.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: 'main'
6+
7+
jobs:
8+
build_site:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
14+
- name: Install Node.js
15+
uses: actions/setup-node@v4
16+
with:
17+
node-version: 22
18+
cache: npm
19+
20+
- name: Install dependencies
21+
run: npm install
22+
23+
- name: build
24+
env:
25+
BASE_PATH: '/${{ github.event.repository.name }}'
26+
run: npm run build
27+
working-directory: ./usr-web
28+
29+
- name: Upload Artifacts
30+
uses: actions/upload-pages-artifact@v3
31+
with:
32+
# this should match the `pages` option in your adapter-static options
33+
path: './usr-web/build/'
34+
35+
deploy:
36+
needs: build_site
37+
runs-on: ubuntu-latest
38+
39+
permissions:
40+
pages: write
41+
id-token: write
42+
43+
environment:
44+
name: github-pages
45+
url: ${{ steps.deployment.outputs.page_url }}
46+
47+
steps:
48+
- name: Deploy
49+
id: deployment
50+
uses: actions/deploy-pages@v4

usr-backend/src/scheduler.rs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::{collections::{hash_map::Entry, HashMap, HashSet}, sync::Arc};
22

33
use axum::{extract::State, http::StatusCode, response::{IntoResponse, Response}, routing::{delete, get, post}, Json, Router};
4-
use sea_orm::{sea_query::Table, ActiveModelTrait, ActiveValue, ColumnTrait, ConnectionTrait, DatabaseConnection, EntityTrait, ModelTrait, QueryFilter, QuerySelect, Schema, TransactionTrait};
4+
use sea_orm::{sea_query::Table, ActiveModelTrait, ActiveValue, ColumnTrait, ConnectionTrait, DatabaseConnection, EntityTrait, QueryFilter, Schema, TransactionTrait};
55
use serde::{Deserialize, Serialize};
66
use tracing::error;
77

@@ -64,20 +64,8 @@ struct SetTeam {
6464

6565
#[axum::debug_handler]
6666
async fn set_team(State(db): State<Arc<DatabaseConnection>>, Json(set_team): Json<SetTeam>) -> (StatusCode, &'static str) {
67-
// let result = team::Entity::find().filter(team::Column::Name.eq(set_team.name.clone())).column(team::Column::Team).all(&*db).await;
68-
// let to_delete = match result {
69-
// Ok(x) => x,
70-
// Err(e) => {
71-
// error!("Failed to find schedule: {e}");
72-
// return (StatusCode::INTERNAL_SERVER_ERROR, "");
73-
// }
74-
// };
75-
7667
let result = db.transaction(|tx| Box::pin(async move {
7768
team::Entity::delete_many().filter(team::Column::Name.eq(set_team.name.clone())).exec(tx).await?;
78-
// for model in to_delete {
79-
// model.delete(tx).await?;
80-
// }
8169
for team in set_team.teams {
8270
let active_model = team::ActiveModel {
8371
name: ActiveValue::Set(set_team.name.clone()),

usr-web/.gitignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
node_modules
2+
3+
# Output
4+
.output
5+
.vercel
6+
.netlify
7+
.wrangler
8+
/.svelte-kit
9+
/build
10+
11+
# OS
12+
.DS_Store
13+
Thumbs.db
14+
15+
# Env
16+
.env
17+
.env.*
18+
!.env.example
19+
!.env.test
20+
21+
# Vite
22+
vite.config.js.timestamp-*
23+
vite.config.ts.timestamp-*

usr-web/.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
engine-strict=true

usr-web/.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Package Managers
2+
package-lock.json
3+
pnpm-lock.yaml
4+
yarn.lock

usr-web/.prettierrc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"useTabs": true,
3+
"singleQuote": true,
4+
"trailingComma": "none",
5+
"printWidth": 100,
6+
"plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"],
7+
"overrides": [
8+
{
9+
"files": "*.svelte",
10+
"options": {
11+
"parser": "svelte"
12+
}
13+
}
14+
]
15+
}

usr-web/README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# sv
2+
3+
Everything you need to build a Svelte project, powered by [`sv`](https://github.com/sveltejs/cli).
4+
5+
## Creating a project
6+
7+
If you're seeing this, you've probably already done this step. Congrats!
8+
9+
```bash
10+
# create a new project in the current directory
11+
npx sv create
12+
13+
# create a new project in my-app
14+
npx sv create my-app
15+
```
16+
17+
## Developing
18+
19+
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
20+
21+
```bash
22+
npm run dev
23+
24+
# or start the server and open the app in a new browser tab
25+
npm run dev -- --open
26+
```
27+
28+
## Building
29+
30+
To create a production version of your app:
31+
32+
```bash
33+
npm run build
34+
```
35+
36+
You can preview the production build with `npm run preview`.
37+
38+
> To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment.

usr-web/eslint.config.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import prettier from 'eslint-config-prettier';
2+
import js from '@eslint/js';
3+
import { includeIgnoreFile } from '@eslint/compat';
4+
import svelte from 'eslint-plugin-svelte';
5+
import globals from 'globals';
6+
import { fileURLToPath } from 'node:url';
7+
import ts from 'typescript-eslint';
8+
const gitignorePath = fileURLToPath(new URL('./.gitignore', import.meta.url));
9+
10+
export default ts.config(
11+
includeIgnoreFile(gitignorePath),
12+
js.configs.recommended,
13+
...ts.configs.recommended,
14+
...svelte.configs['flat/recommended'],
15+
prettier,
16+
...svelte.configs['flat/prettier'],
17+
{
18+
languageOptions: {
19+
globals: {
20+
...globals.browser,
21+
...globals.node
22+
}
23+
}
24+
},
25+
{
26+
files: ['**/*.svelte'],
27+
28+
languageOptions: {
29+
parserOptions: {
30+
parser: ts.parser
31+
}
32+
}
33+
}
34+
);

0 commit comments

Comments
 (0)