Compare commits
7
Commits
8121dbcb7c
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
66d95ef5c0 | ||
|
|
e2296574ac | ||
|
|
5dfe58ec2e | ||
|
|
dbf63ab634 | ||
|
|
7feae0ae48 | ||
|
|
c55037869d | ||
|
|
24c43c543d |
@@ -0,0 +1,7 @@
|
|||||||
|
Copyright 2023 Franz Dietrich
|
||||||
|
|
||||||
|
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.
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
# Make Uhle
|
||||||
|
|
||||||
|
Dieses Repository enthält eine Webseite, die dazu verwendet wird, sich zur Make-AG der Uhlandshöhe zu registrieren. Es wird Rust, SQLx, und Axum verwendet, um eine Webanwendung zu entwickeln. Das Projekt verwendet SQLite als Datenbank und enthält bereits den entsprechenden Code. In diesem Readme erfährst du, wie du das Projekt auf deinem System einrichten und starten kannst.
|
||||||
|
|
||||||
|
## Voraussetzungen
|
||||||
|
|
||||||
|
Vor der Verwendung dieses Projekts musst du sicherstellen, dass die folgenden Softwarekomponenten auf deinem System installiert sind:
|
||||||
|
|
||||||
|
- Rust: Installiere Rust, indem du die offizielle Rust-Website besuchst oder einen Paketmanager wie `rustup` verwendest.
|
||||||
|
- sqlx-cli: Installiere sqlx-cli mit `cargo install sqlx-cli --features rustls`
|
||||||
|
|
||||||
|
## Setup
|
||||||
|
|
||||||
|
1. Klone das Repository auf deinen lokalen Computer:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone https://git.uhle.cloud/dietrich/make_uhle.git
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Navigiere in das Projektverzeichnis:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd make_uhle
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Installiere die erforderlichen Abhängigkeiten und kompiliere das Projket:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cargo build
|
||||||
|
```
|
||||||
|
|
||||||
|
4. (optional) Modifiziere die `.env`-Datei, sodass der Datenbankpfad deinen Wünschen entspricht. Wenn die Datei nicht existiert, wird sie automatisch erstellt (Ordner werden jedoch nicht angelegt).
|
||||||
|
|
||||||
|
5. Führe das SQLx-Setup aus, um die SQLite-Datenbank einzurichten:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cargo sqlx setup
|
||||||
|
```
|
||||||
|
|
||||||
|
6. Die erstellte Binärdatei liegt in `target/debug/make_uhle`
|
||||||
|
|
||||||
|
## Starten der Anwendung
|
||||||
|
|
||||||
|
Sobald das Setup abgeschlossen ist, kannst du die Anwendung starten, indem du den folgenden Befehl ausführst:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cargo run
|
||||||
|
```
|
||||||
|
|
||||||
|
Die Anwendung wird gestartet und ist über die Adresse `http://localhost:8035` erreichbar.
|
||||||
|
|
||||||
|
## Beitrag leisten
|
||||||
|
|
||||||
|
Wenn du einen Fehler findest oder einen Beitrag zu diesem Projekt leisten möchtest, freuen wir uns über Pull Requests. Bitte erstelle einen Fork dieses Repositories, führe deine Änderungen durch und reiche dann einen Pull Request ein.
|
||||||
|
|
||||||
|
## Lizenz
|
||||||
|
|
||||||
|
Dieses Projekt ist unter der MIT-Lizenz lizenziert. Weitere Informationen findest du in der [Lizenzdatei](/dietrich/make_uhle/src/branch/main/LICENSE).
|
||||||
@@ -75,6 +75,7 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// A Registration form has a name an email and a class
|
||||||
#[derive(Deserialize)]
|
#[derive(Deserialize)]
|
||||||
struct RegistrationForm {
|
struct RegistrationForm {
|
||||||
name: String,
|
name: String,
|
||||||
@@ -101,6 +102,7 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// register a user
|
||||||
async fn register(
|
async fn register(
|
||||||
DatabaseConnection(conn): DatabaseConnection,
|
DatabaseConnection(conn): DatabaseConnection,
|
||||||
Form(form): Form<RegistrationForm>,
|
Form(form): Form<RegistrationForm>,
|
||||||
|
|||||||
Reference in New Issue
Block a user