-
-
{{entry.rank}}
-
{{entry.username}}
-
{{entry.score}}
-
+
+
+
{{ this.title() }}
+
+
+
+
+
+
+
+
+
+
+ Loading...
+
+
diff --git a/frontend/src/components/LeaderboardEntry.vue b/frontend/src/components/LeaderboardEntry.vue
new file mode 100644
index 0000000..d39a95f
--- /dev/null
+++ b/frontend/src/components/LeaderboardEntry.vue
@@ -0,0 +1,31 @@
+
+ {{this.entry.rank}}
+ {{this.entry.username}}
+ {{this.entry.score}}
+
+
+
+
+
\ No newline at end of file
diff --git a/frontend/src/components/Login.vue b/frontend/src/components/Login.vue
new file mode 100644
index 0000000..3be8534
--- /dev/null
+++ b/frontend/src/components/Login.vue
@@ -0,0 +1,65 @@
+
+ Enter a username
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/frontend/src/components/RRButton.vue b/frontend/src/components/RRButton.vue
new file mode 100644
index 0000000..454fb92
--- /dev/null
+++ b/frontend/src/components/RRButton.vue
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/frontend/src/model/Rest.ts b/frontend/src/model/Rest.ts
new file mode 100644
index 0000000..53b902e
--- /dev/null
+++ b/frontend/src/model/Rest.ts
@@ -0,0 +1,3 @@
+export class Rest {
+ static readonly URL = 'http://localhost:3000';
+}
\ No newline at end of file
diff --git a/frontend/src/model/User.ts b/frontend/src/model/User.ts
index fc21330..38f83be 100644
--- a/frontend/src/model/User.ts
+++ b/frontend/src/model/User.ts
@@ -1,4 +1,34 @@
-export interface User {
- id?: number,
- name: string,
+import {Rest} from "@/model/Rest";
+
+export class User {
+ id?: number;
+ name?: string;
+
+
+ constructor(id: number, name: string) {
+ this.name = name;
+ }
+
+ static async getByName(name: string): Promise
{
+ let res: Response = await fetch(Rest.URL + '/user/' + name, {method: 'GET'});
+
+ return await res.json();
+ }
+
+ static async create(name: string): Promise {
+ let body = {
+ name: name
+ };
+ let header = {
+ Accept: "application/json",
+ "Content-Type": "application/json",
+ };
+
+ let res: Response = await fetch( Rest.URL + '/user/register', {
+ method: 'POST',
+ body: JSON.stringify(body),
+ headers: header,
+ });
+ return await res.json();
+ }
}
\ No newline at end of file