diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6d4c0aa --- /dev/null +++ b/.gitignore @@ -0,0 +1,21 @@ +# build output +dist/ + +# generated types +.astro/ + +# dependencies +node_modules/ + +# logs +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* + +# environment variables +.env +.env.production + +# macOS-specific files +.DS_Store diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..22a1505 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,4 @@ +{ + "recommendations": ["astro-build.astro-vscode"], + "unwantedRecommendations": [] +} diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..d642209 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,11 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "command": "./node_modules/.bin/astro dev", + "name": "Development server", + "request": "launch", + "type": "node-terminal" + } + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..0013f78 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,8 @@ +{ + "editor.formatOnSave": true, + "[astro]": { + "editor.defaultFormatter": "astro-build.astro-vscode" + }, + "editor.defaultFormatter": "biomejs.biome", + "typescript.tsdk": "node_modules/typescript/lib" +} \ No newline at end of file diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 8194f1c..0000000 --- a/LICENSE +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) 2024 qpismont - -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. diff --git a/README.md b/README.md index 007d77c..1db3fb3 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,54 @@ -# trepa-web +# Astro Starter Kit: Basics +```sh +npm create astro@latest -- --template basics +``` + +[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/basics) +[![Open with CodeSandbox](https://assets.codesandbox.io/github/button-edit-lime.svg)](https://codesandbox.io/p/sandbox/github/withastro/astro/tree/latest/examples/basics) +[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/withastro/astro?devcontainer_path=.devcontainer/basics/devcontainer.json) + +> 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun! + +![just-the-basics](https://github.com/withastro/astro/assets/2244813/a0a5533c-a856-4198-8470-2d67b1d7c554) + +## 🚀 Project Structure + +Inside of your Astro project, you'll see the following folders and files: + +```text +/ +├── public/ +│ └── favicon.svg +├── src/ +│ ├── components/ +│ │ └── Card.astro +│ ├── layouts/ +│ │ └── Layout.astro +│ └── pages/ +│ └── index.astro +└── package.json +``` + +Astro looks for `.astro` or `.md` files in the `src/pages/` directory. Each page is exposed as a route based on its file name. + +There's nothing special about `src/components/`, but that's where we like to put any Astro/React/Vue/Svelte/Preact components. + +Any static assets, like images, can be placed in the `public/` directory. + +## 🧞 Commands + +All commands are run from the root of the project, from a terminal: + +| Command | Action | +| :------------------------ | :----------------------------------------------- | +| `npm install` | Installs dependencies | +| `npm run dev` | Starts local dev server at `localhost:4321` | +| `npm run build` | Build your production site to `./dist/` | +| `npm run preview` | Preview your build locally, before deploying | +| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` | +| `npm run astro -- --help` | Get help using the Astro CLI | + +## 👀 Want to learn more? + +Feel free to check [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat). diff --git a/astro.config.mjs b/astro.config.mjs new file mode 100644 index 0000000..ffde277 --- /dev/null +++ b/astro.config.mjs @@ -0,0 +1,12 @@ +// astro.config.mjs +import { defineConfig } from "astro/config"; +import react from "@astrojs/react"; +import node from "@astrojs/node"; + +export default defineConfig({ + integrations: [react()], + output: "server", + adapter: node({ + mode: "standalone", + }), +}); diff --git a/biome.json b/biome.json new file mode 100644 index 0000000..f8702e4 --- /dev/null +++ b/biome.json @@ -0,0 +1,12 @@ +{ + "$schema": "https://biomejs.dev/schemas/1.5.3/schema.json", + "organizeImports": { + "enabled": true + }, + "linter": { + "enabled": true, + "rules": { + "recommended": true + } + } +} diff --git a/bun.lockb b/bun.lockb new file mode 100755 index 0000000..58f2b5d Binary files /dev/null and b/bun.lockb differ diff --git a/package.json b/package.json new file mode 100644 index 0000000..9844e54 --- /dev/null +++ b/package.json @@ -0,0 +1,27 @@ +{ + "name": "trepa-web", + "type": "module", + "version": "0.0.1", + "scripts": { + "dev": "bunx --bun astro dev", + "start": "bunx --bun astro dev", + "build": "rm -rf dist && bunx --bun astro check && bunx --bun astro build", + "preview": "bunx --bun astro preview", + "astro": "astro" + }, + "dependencies": { + "@astrojs/check": "^0.7.0", + "@astrojs/node": "^8.2.5", + "@astrojs/react": "^3.3.4", + "@types/react": "^18.3.2", + "@types/react-dom": "^18.3.0", + "astro": "^4.8.4", + "bootstrap": "^5.3.3", + "react": "^18.3.1", + "react-dom": "^18.3.1", + "typescript": "^5.3.3" + }, + "devDependencies": { + "@biomejs/biome": "1.7.3" + } +} diff --git a/public/favicon.svg b/public/favicon.svg new file mode 100644 index 0000000..f157bd1 --- /dev/null +++ b/public/favicon.svg @@ -0,0 +1,9 @@ + + + + diff --git a/src/components/forms/LoginForm.tsx b/src/components/forms/LoginForm.tsx new file mode 100644 index 0000000..f97fefa --- /dev/null +++ b/src/components/forms/LoginForm.tsx @@ -0,0 +1,24 @@ +export default function LoginForm() { + return ( +
+
+
+
+ + +
+
+ + +
+ +
+ +
+
+
+
+ ); +} diff --git a/src/env.d.ts b/src/env.d.ts new file mode 100644 index 0000000..f964fe0 --- /dev/null +++ b/src/env.d.ts @@ -0,0 +1 @@ +/// diff --git a/src/layouts/EmptyLayout.astro b/src/layouts/EmptyLayout.astro new file mode 100644 index 0000000..d271c22 --- /dev/null +++ b/src/layouts/EmptyLayout.astro @@ -0,0 +1,17 @@ +--- +import RootLayout from "./RootLayout.astro"; + +interface Props { + title: string; +} + +const { title } = Astro.props; +--- + + +
+
+ +
+
+
diff --git a/src/layouts/RootLayout.astro b/src/layouts/RootLayout.astro new file mode 100644 index 0000000..b1fcb9e --- /dev/null +++ b/src/layouts/RootLayout.astro @@ -0,0 +1,38 @@ +--- +interface Props { + title: string; +} + +const { title } = Astro.props; + +import "bootstrap/dist/css/bootstrap.min.css"; +--- + + + + + + + + + + {title} + + +
+ +
+ + + + + + diff --git a/src/pages/index.astro b/src/pages/index.astro new file mode 100644 index 0000000..a7a4901 --- /dev/null +++ b/src/pages/index.astro @@ -0,0 +1,10 @@ +--- +import EmptyLayout from "../layouts/EmptyLayout.astro"; + +const jwt = Astro.cookies.get("jwt"); +if (!jwt) { + Astro.redirect("/login"); +} +--- + + diff --git a/src/pages/login.astro b/src/pages/login.astro new file mode 100644 index 0000000..7f63113 --- /dev/null +++ b/src/pages/login.astro @@ -0,0 +1,9 @@ +--- +import RootLayout from "../layouts/RootLayout.astro"; +import LoginForm from "../components/forms/LoginForm"; +import EmptyLayout from "../layouts/EmptyLayout.astro"; +--- + + + + diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..2cdbdaf --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "astro/tsconfigs/strict", + "compilerOptions": { + "jsx": "react-jsx" + } +} \ No newline at end of file