signup & login & dashboard

This commit is contained in:
mi1468 2025-04-14 16:39:00 +03:30
commit 6a7ffb1756
24 changed files with 13420 additions and 0 deletions

23
xroom-dashboard/.gitignore vendored Normal file
View File

@ -0,0 +1,23 @@
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

24
xroom-dashboard/README.md Normal file
View File

@ -0,0 +1,24 @@
# xroom-dashboard
## Project setup
```
npm install
```
### Compiles and hot-reloads for development
```
npm run serve
```
### Compiles and minifies for production
```
npm run build
```
### Lints and fixes files
```
npm run lint
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).

View File

@ -0,0 +1,5 @@
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}

View File

@ -0,0 +1,19 @@
{
"compilerOptions": {
"target": "es5",
"module": "esnext",
"baseUrl": "./",
"moduleResolution": "node",
"paths": {
"@/*": [
"src/*"
]
},
"lib": [
"esnext",
"dom",
"dom.iterable",
"scripthost"
]
}
}

12301
xroom-dashboard/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,48 @@
{
"name": "xroom-dashboard",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"axios": "^1.8.4",
"core-js": "^3.8.3",
"vue": "^3.2.13",
"vue-router": "^4.5.0"
},
"devDependencies": {
"@babel/core": "^7.12.16",
"@babel/eslint-parser": "^7.12.16",
"@vue/cli-plugin-babel": "~5.0.0",
"@vue/cli-plugin-eslint": "~5.0.0",
"@vue/cli-service": "~5.0.0",
"autoprefixer": "^10.4.21",
"eslint": "^7.32.0",
"eslint-plugin-vue": "^8.0.3",
"postcss": "^8.5.3",
"tailwindcss": "^4.1.3"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/vue3-essential",
"eslint:recommended"
],
"parserOptions": {
"parser": "@babel/eslint-parser"
},
"rules": {}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead",
"not ie 11"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 171 KiB

View File

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>

View File

@ -0,0 +1,71 @@
<template>
<div id="app">
<!-- Main App Layout -->
<h1 class="app-title">XRoom Dashboard</h1>
<!-- The router-view here will display the active route's component -->
<router-view></router-view>
</div>
</template>
<script>
export default {
name: 'App',
}
</script>
<style scoped>
/* Global Styles */
body {
/* font-family: 'Arial', sans-serif; */
background-color: #f4f7fa;
margin: 0;
padding: 0;
font-family: 'Yekan', sans-serif;
}
/* Styling for the header */
header {
background-color: #4A90E2; /* Blue color */
padding: 20px;
text-align: center;
}
.app-title {
color: white;
font-size: 32px;
font-weight: bold;
margin: 0;
}
/* Additional styling for the whole app */
#app {
display: flex;
flex-direction: column;
min-height: 100vh;
}
router-view {
flex-grow: 1;
padding: 20px;
}
</style>
<style>
@font-face {
font-family: 'Yekan';
src: url('@/assets/fonts/Yekan.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
/* Apply the font globally */
body {
font-family: 'Yekan', sans-serif;
}
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 171 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

View File

@ -0,0 +1,150 @@
<template>
<div class="dashboard-container">
<SidebarMenu />
<div class="content">
<div class="header">
<button class="btn-subscribe">خرید اشتراک</button>
<div class="search-bar">
<input type="text" placeholder="جستجو..." />
</div>
</div>
<div class="dashboard-body">
<div class="quick-actions">
<button class="btn-action">ایجاد جلسه جدید +</button>
<div class="guide">
<button class="btn-guide">راهنمای شروع</button>
<button class="btn-guide">آموزشها</button>
<button class="btn-guide">تغییرات نسخه</button>
</div>
</div>
<div class="latest-files">
<h3>آخرین فایلها</h3>
<div class="files-grid">
<div class="file-card" v-for="file in files" :key="file.id">
<img :src="file.image" alt="file" />
<p>{{ file.name }}</p>
<span>{{ file.date }}</span>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import SidebarMenu from '@/components/SidebarMenu.vue';
export default {
components: {
SidebarMenu,
},
data() {
return {
files: [
{ id: 1, name: 'Flash Back', date: '24 تیر 1403', image: '@/assets/file1.jpg' },
{ id: 2, name: 'Design Artist', date: '24 تیر 1403', image: '@/assets/file2.jpg' },
{ id: 3, name: 'Fakor Sanat Tehran', date: '24 تیر 1403', image: '@/assets/file3.jpg' },
{ id: 4, name: 'Pico Control', date: '24 تیر 1403', image: '@/assets/file4.jpg' },
],
};
},
};
</script>
<style scoped>
.dashboard-container {
display: flex;
direction: rtl;
}
.content {
flex: 1;
padding: 20px;
}
.header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 30px;
}
.btn-subscribe {
background-color: #1a73e8;
color: white;
padding: 10px 20px;
border: none;
cursor: pointer;
}
.search-bar input {
padding: 10px;
width: 300px;
}
.dashboard-body {
margin-top: 20px;
}
.quick-actions {
margin-bottom: 30px;
}
.btn-action {
background-color: #1a73e8;
color: white;
padding: 15px;
font-size: 16px;
border: none;
cursor: pointer;
}
.guide {
display: flex;
gap: 10px;
margin-top: 20px;
}
.btn-guide {
background-color: #f1f1f1;
color: #333;
padding: 10px 20px;
border: none;
cursor: pointer;
}
.latest-files {
margin-top: 50px;
}
.files-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 20px;
}
.file-card {
background-color: #fff;
padding: 20px;
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
text-align: center;
}
.file-card img {
width: 100%;
border-radius: 10px;
height: 180px;
object-fit: cover;
}
.file-card p {
margin-top: 10px;
font-weight: bold;
}
</style>

View File

@ -0,0 +1,157 @@
<template>
<div class="files-page">
<SidebarMenu /> <!-- Sidebar remains the same -->
<div class="content">
<div class="header">
<button class="btn-subscribe">خرید اشتراک</button>
<div class="search-bar">
<input type="text" placeholder="جستجو..." />
</div>
</div>
<div class="files-body">
<div class="files-header">
<h2>مدیریت فایل ها</h2>
<button class="btn-upload">فایل جدید</button>
</div>
<div class="file-actions">
<div class="file-actions-menu">
<button class="action-btn">فایلهای آخر</button>
<button class="action-btn">یادداشتهای آخر</button>
<button class="action-btn">فایلهای شخصی</button>
<button class="action-btn">فایلهای تیمی</button>
</div>
</div>
<div class="file-cards">
<div class="file-card" v-for="file in files" :key="file.id">
<img :src="file.image" alt="file" />
<p>{{ file.name }}</p>
<span>{{ file.date }}</span>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import SidebarMenu from '@/components/SidebarMenu.vue';
export default {
components: {
SidebarMenu,
},
data() {
return {
files: [
{ id: 1, name: 'نام فایل', date: '24 تیر 1403', image: '@/assets/file1.jpg' },
{ id: 2, name: 'نام فایل', date: '24 تیر 1403', image: '@/assets/file2.jpg' },
{ id: 3, name: 'نام فایل', date: '24 تیر 1403', image: '@/assets/file3.jpg' },
{ id: 4, name: 'نام فایل', date: '24 تیر 1403', image: '@/assets/file4.jpg' },
{ id: 5, name: 'نام فایل', date: '24 تیر 1403', image: '@/assets/file5.jpg' },
{ id: 6, name: 'نام فایل', date: '24 تیر 1403', image: '@/assets/file6.jpg' },
],
};
},
};
</script>
<style scoped>
.files-page {
display: flex;
direction: rtl;
}
.content {
flex: 1;
padding: 20px;
}
.header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 30px;
}
.btn-subscribe {
background-color: #1a73e8;
color: white;
padding: 10px 20px;
border: none;
cursor: pointer;
}
.search-bar input {
padding: 10px;
width: 300px;
}
.files-body {
margin-top: 20px;
}
.files-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 30px;
}
.btn-upload {
background-color: #1a73e8;
color: white;
padding: 10px 20px;
font-size: 16px;
border: none;
cursor: pointer;
}
.file-actions {
margin-bottom: 30px;
}
.file-actions-menu {
display: flex;
gap: 10px;
}
.action-btn {
background-color: #f1f1f1;
color: #333;
padding: 10px 20px;
border: none;
cursor: pointer;
}
.file-cards {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 20px;
}
.file-card {
background-color: #fff;
padding: 20px;
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
text-align: center;
}
.file-card img {
width: 100%;
border-radius: 10px;
height: 180px;
object-fit: cover;
}
.file-card p {
margin-top: 10px;
font-weight: bold;
}
</style>

View File

@ -0,0 +1,58 @@
<template>
<div class="hello">
<h1>{{ msg }}</h1>
<p>
For a guide and recipes on how to configure / customize this project,<br>
check out the
<a href="https://cli.vuejs.org" target="_blank" rel="noopener">vue-cli documentation</a>.
</p>
<h3>Installed CLI Plugins</h3>
<ul>
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel" target="_blank" rel="noopener">babel</a></li>
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint" target="_blank" rel="noopener">eslint</a></li>
</ul>
<h3>Essential Links</h3>
<ul>
<li><a href="https://vuejs.org" target="_blank" rel="noopener">Core Docs</a></li>
<li><a href="https://forum.vuejs.org" target="_blank" rel="noopener">Forum</a></li>
<li><a href="https://chat.vuejs.org" target="_blank" rel="noopener">Community Chat</a></li>
<li><a href="https://twitter.com/vuejs" target="_blank" rel="noopener">Twitter</a></li>
<li><a href="https://news.vuejs.org" target="_blank" rel="noopener">News</a></li>
</ul>
<h3>Ecosystem</h3>
<ul>
<li><a href="https://router.vuejs.org" target="_blank" rel="noopener">vue-router</a></li>
<li><a href="https://vuex.vuejs.org" target="_blank" rel="noopener">vuex</a></li>
<li><a href="https://github.com/vuejs/vue-devtools#vue-devtools" target="_blank" rel="noopener">vue-devtools</a></li>
<li><a href="https://vue-loader.vuejs.org" target="_blank" rel="noopener">vue-loader</a></li>
<li><a href="https://github.com/vuejs/awesome-vue" target="_blank" rel="noopener">awesome-vue</a></li>
</ul>
</div>
</template>
<script>
export default {
name: 'HelloWorld',
props: {
msg: String
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h3 {
margin: 40px 0 0;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
</style>

View File

@ -0,0 +1,200 @@
<template>
<div class="signup-page">
<div class="signup-form">
<h2 class="title">
<img :src="require('@/assets/img/logo.png')" alt="Logo" />
</h2>
<h3 class="subtitle">ورود به حساب کاربری</h3>
<form @submit.prevent="handleSubmit">
<!-- Mobile Number -->
<div class="form-group">
<label for="phone">شماره تماس</label>
<input v-model="form.mobileNumber" type="text" id="phone" placeholder="شماره تماس" />
</div>
<!-- Password -->
<div class="form-group">
<label for="password">گذرواژه</label>
<input v-model="form.password" type="password" id="password" placeholder="گذرواژه" />
</div>
<!-- Submit Button -->
<button type="submit" class="submit-btn">
ورود
</button>
</form>
<!-- Login Link -->
<div class="login-link">
<router-link to="/signup">ساخت حساب کاربری</router-link>
</div>
</div>
</div>
</template>
<script>
import axios from 'axios';
export default {
data() {
return {
form: {
firstName: '',
lastName: '',
mobileNumber: '',
password: '',
terms: false,
},
};
},
methods: {
async handleSubmit() {
// Prepare the data to match API format
const signupData = {
first_name: this.form.firstName,
last_name: this.form.lastName,
mobile_number: this.form.mobileNumber,
password: this.form.password,
};
try {
const response = await axios.post('http://194.62.43.230:8000/login', signupData);
console.log('Signup success:', response.data);
// Redirect to login page upon successful signup
this.$router.push('/dashboard');
} catch (error) {
console.error('Signup error:', error);
// Handle error, show alert or error message
}
},
},
};
</script>
<style scoped>
/* Add your styles here */
</style>
<style scoped>
/* Basic reset */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
/* Body and Background Styling */
.signup-page {
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background-image: url('@/assets/background.jpg'); /* Correct path */
background-size: cover;
background-position: center;
}
.signup-form {
direction: rtl;
background-color: rgba(255, 255, 255, 1); /* Semi-transparent white background */
padding: 40px;
border-radius: 20px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
width: 100%;
max-width: 900px;
}
.title {
font-size: 36px;
font-weight: bold;
color: #4A90E2;
text-align: center;
}
.subtitle {
font-size: 24px;
color: #444;
text-align: right;
margin-bottom: 30px;
}
.form-group {
margin-bottom: 20px;
}
.form-group label {
font-size: 14px;
font-weight: bold;
color: #555;
display: block;
margin-bottom: 5px;
}
.form-group input {
width: 100%;
padding: 12px;
border-radius: 6px;
border: 1px solid #ccc;
font-size: 16px;
outline: none;
}
.form-group input:focus {
border-color: #4A90E2;
}
.terms-checkbox {
display: flex;
align-items: center;
margin-bottom: 20px;
}
.terms-checkbox input {
margin-right: 10px;
}
.submit-btn {
width: 100%;
padding: 12px;
background-color: #4A90E2;
color: white;
font-size: 16px;
font-weight: bold;
border-radius: 6px;
border: none;
cursor: pointer;
transition: background-color 0.3s ease;
}
.submit-btn:disabled {
background-color: #ccc;
cursor: not-allowed;
}
.submit-btn:hover:enabled {
background-color: #357ABD;
}
.login-link {
text-align: center;
margin-top: 20px;
}
.login-link a {
color: #4A90E2;
text-decoration: none;
}
.login-link a:hover {
text-decoration: underline;
}
</style>

View File

@ -0,0 +1,94 @@
<template>
<div class="sidebar">
<div class="sidebar-header">
<img src="@/assets/logo.png" alt="XRoom" class="logo" />
<div class="profile">
<img src="@/assets/img/profile.png" alt="User" class="profile-img" />
<span class="username">دانیال پژوهش کیا</span>
</div>
</div>
<div class="sidebar-nav">
<router-link to="/" class="nav-link">داشبورد</router-link>
<router-link to="/sessions" class="nav-link">جلسات</router-link>
<router-link to="/downloads" class="nav-link">دانلود</router-link>
<router-link to="/files" class="nav-link">فایلها</router-link>
<router-link to="/teams" class="nav-link">تیمها</router-link>
</div>
<div class="sidebar-footer">
<router-link to="/settings" class="footer-link">پشتیبانی</router-link>
</div>
</div>
</template>
<script>
export default {
name: 'SidebarMenu',
};
</script>
<style scoped>
.sidebar {
width: 250px;
height: 100vh;
background-color: #2f2f2f;
color: white;
padding: 20px;
}
.sidebar-header {
display: flex;
flex-direction: column;
align-items: center;
margin-bottom: 40px;
}
.logo {
width: 100px;
margin-bottom: 20px;
}
.profile {
text-align: center;
}
.profile-img {
width: 50px;
border-radius: 50%;
margin-bottom: 10px;
}
.username {
font-size: 14px;
font-weight: bold;
}
.sidebar-nav {
margin-bottom: 20px;
}
.nav-link {
display: block;
color: white;
padding: 10px 0;
text-decoration: none;
margin: 10px 0;
font-size: 16px;
}
.nav-link:hover {
background-color: #444;
}
.sidebar-footer {
margin-top: auto;
}
.footer-link {
color: white;
text-decoration: none;
font-size: 14px;
}
</style>

View File

@ -0,0 +1,208 @@
<template>
<div class="signup-page">
<div class="signup-form">
<h2 class="title">
<img :src="require('@/assets/img/logo.png')" alt="Logo" />
</h2>
<h3 class="subtitle">ساخت حساب کاربری</h3>
<form @submit.prevent="handleSubmit">
<!-- First Name -->
<div class="form-group">
<label for="firstName">نام</label>
<input v-model="form.firstName" type="text" id="firstName" placeholder="نام" />
</div>
<!-- Last Name -->
<div class="form-group">
<label for="lastName">نام خانوادگی</label>
<input v-model="form.lastName" type="text" id="lastName" placeholder="نام خانوادگی" />
</div>
<!-- Mobile Number -->
<div class="form-group">
<label for="phone">شماره تماس</label>
<input v-model="form.mobileNumber" type="text" id="phone" placeholder="شماره تماس" />
</div>
<!-- Password -->
<div class="form-group">
<label for="password">گذرواژه</label>
<input v-model="form.password" type="password" id="password" placeholder="گذرواژه" />
</div>
<!-- Terms and Conditions -->
<div class="terms-checkbox">
<input type="checkbox" id="terms" v-model="form.terms" />
<label for="terms">کلیه قوانین داده شده و شرایط حریم خصوصی را مطالعه کرده و تایید میکنم.</label>
</div>
<!-- Submit Button -->
<button type="submit" :disabled="!form.terms" class="submit-btn">
ثبت نام
</button>
</form>
<!-- Login Link -->
<div class="login-link">
<router-link to="/login">حساب کاربری دارید؟ وارد شوید</router-link>
</div>
</div>
</div>
</template>
<script>
import axios from 'axios';
export default {
data() {
return {
form: {
firstName: '',
lastName: '',
mobileNumber: '',
password: '',
terms: false,
},
};
},
methods: {
async handleSubmit() {
// Prepare the data to match API format
const signupData = {
first_name: this.form.firstName,
last_name: this.form.lastName,
mobile_number: this.form.mobileNumber,
password: this.form.password,
};
try {
const response = await axios.post('http://194.62.43.230:8000/signup', signupData);
console.log('Signup success:', response.data);
// Redirect to login page upon successful signup
this.$router.push('/login');
} catch (error) {
console.error('Signup error:', error);
// Handle error, show alert or error message
}
},
},
};
</script>
<style scoped>
/* Basic reset */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
/* Body and Background Styling */
.signup-page {
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background-image: url('@/assets/background.jpg'); /* Correct path */
background-size: cover;
background-position: center;
}
.signup-form {
direction: rtl;
background-color: rgba(255, 255, 255, 1); /* Semi-transparent white background */
padding: 40px;
border-radius: 20px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
width: 100%;
max-width: 900px;
}
.title {
font-size: 36px;
font-weight: bold;
color: #4A90E2;
text-align: center;
}
.subtitle {
font-size: 24px;
color: #444;
text-align: right;
margin-bottom: 30px;
}
.form-group {
margin-bottom: 20px;
}
.form-group label {
font-size: 14px;
font-weight: bold;
color: #555;
display: block;
margin-bottom: 5px;
}
.form-group input {
width: 100%;
padding: 12px;
border-radius: 6px;
border: 1px solid #ccc;
font-size: 16px;
outline: none;
}
.form-group input:focus {
border-color: #4A90E2;
}
.terms-checkbox {
display: flex;
align-items: center;
margin-bottom: 20px;
}
.terms-checkbox input {
margin-right: 10px;
}
.submit-btn {
width: 100%;
padding: 12px;
background-color: #4A90E2;
color: white;
font-size: 16px;
font-weight: bold;
border-radius: 6px;
border: none;
cursor: pointer;
transition: background-color 0.3s ease;
}
.submit-btn:disabled {
background-color: #ccc;
cursor: not-allowed;
}
.submit-btn:hover:enabled {
background-color: #357ABD;
}
.login-link {
text-align: center;
margin-top: 20px;
}
.login-link a {
color: #4A90E2;
text-decoration: none;
}
.login-link a:hover {
text-decoration: underline;
}
</style>

View File

@ -0,0 +1,7 @@
import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
createApp(App)
.use(router) // Make sure you use the router here
.mount('#app')

View File

@ -0,0 +1,34 @@
import { createRouter, createWebHistory } from 'vue-router'
import SignupPage from '../components/SignupPage.vue' // Renamed
import LoginPage from '../components/LoginPage.vue' // Renamed
import DashboardPage from '../components/DashboardPage.vue'
import FilesPage from '@/components/FilesPage.vue'; // import the new page
const routes = [
{
path: '/signup',
name: 'SignupPage', // Renamed
component: SignupPage
},
{
path: '/login',
name: 'LoginPage', // Renamed
component: LoginPage
},
{
path: '/dashboard',
name: 'DashboardPage', // Renamed
component: DashboardPage
},{
path: '/files',
name: 'files',
component: FilesPage, // link the files page
}
]
const router = createRouter({
history: createWebHistory(process.env.BASE_URL),
routes
})
export default router

View File

@ -0,0 +1,4 @@
const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
transpileDependencies: true
})