Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature/project #476

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
71 changes: 71 additions & 0 deletions staff/joel-suarez/isdigram/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# ISDIGram by Joel

## Functional Description

### Functionalities

- create a post (with picture and text)
- take a picture with camera
- upload a picture from phone
- apply filter to picture
- view posts reel
- send message (to a user)
- follow a user
- search a user (by username)
- toggle like a post
- search posts by hashtag
- toggle save a post
- comment a post
- video-call a user
- live video streaming
- publish a story
- tag a user (in post)

### UI Design

#### Layout

Login

| **Login** |
|--------|
| User |
| Pass |
| [Login] |
| _Register_ |

Register

| **Register** |
|--------|
| Name |
| Age |
| User |
| Email |
| Pass |
| [Register] |
| _Login_ |

Home

| Header |
|--------|
| Post |
| Post |
| Footer |

#### Prototype

[Figma](https://www.figma.com/file/cw8K38zpv36iQkjQA5fVXC/App?type=design&node-id=0-1&mode=design&t=893BElnIYe0ToB5c-0)

[Prototype](https://www.figma.com/proto/cw8K38zpv36iQkjQA5fVXC/App?type=design&node-id=1-2&t=893BElnIYe0ToB5c-0&scaling=scale-down&page-id=0%3A1&starting-point-node-id=1%3A2)


## Technical Description

### Technologies

- HTML
- CSS (Sass)
- JS
- Figma
40 changes: 40 additions & 0 deletions staff/joel-suarez/isdigram/home.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Home</title>
</head>

<body>
<header>
<nav>
<li>Home</li>
<li><a href="login.html">Login</a></li>
<li><a href="register.html">Register</a></li>
</nav>
</header>
<table bgcolor="#FF0000">
<tbody>
<tr>
<td>Post 1</td>
</tr>
</tbody>
</table>
<table bgcolor="#001eff">
<tbody>
<tr>
<td>Post 2</td>
</tr>
</tbody>
</table>


</div>
<footer>
<a>Copyright by isdicoder 2024</a>
</footer>
</body>

</html>
22 changes: 22 additions & 0 deletions staff/joel-suarez/isdigram/login.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login</title>
</head>

<body>
<h1>Login</h1>
<form action="">
<label for="email">E-mail</label><br>
<input type="email" name="" id="email"><br><br>
<label for="password">Password</label><br>
<input type="password" name="" id="password"><br><br>
<button type="submit"><a href="home.html">Login</a></button><br><br>
<a href="register.html">Register</a>
</form>
</body>

</html>
28 changes: 28 additions & 0 deletions staff/joel-suarez/isdigram/register.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Register</title>
</head>

<body>
<h1>Register</h1>
<form action="">
<label for="name">Name</label><br>
<input type="text" name="" id="email"><br><br>
<label for="age">Age</label><br>
<input type="number" name="" id="age"><br><br>
<label for="user">User</label><br>
<input type="text" name="" id="user"><br><br>
<label for="email">E-mail</label><br>
<input type="email" name="" id="email"><br><br>
<label for="password">Password</label><br>
<input type="password" name="" id="password"><br><br>
<button type="submit">Register</button><br><br>
<a href="login.html">Go to Login</a>
</form>
</body>

</html>
1 change: 1 addition & 0 deletions staff/joel-suarez/objects/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Objects Joel
2 changes: 2 additions & 0 deletions staff/joel-suarez/project/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/api/node_modules/
/app/node_modules/
5 changes: 5 additions & 0 deletions staff/joel-suarez/project/api/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
MONGODB_URL = mongodb://localhost:27017/arenaofhonor
MONGODB_TEST_URL = mongodb://localhost:27017/arenaofhonor
PORT = 9000
JWT_SECRET = i killed kenny
JWT_EXP = 999999999999999999s
10 changes: 10 additions & 0 deletions staff/joel-suarez/project/api/.mocharc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"require": "ts-node/register",
"loader": "ts-node/esm",
"extensions": [
"ts"
],
"spec": [
"logic/*.spec.*"
]
}
156 changes: 156 additions & 0 deletions staff/joel-suarez/project/api/data/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
import mongoose, { Schema, model, Document } from 'mongoose';

type UserType = {
name: string;
surname: string;
email: string;
password: string;
honor_points: number;
arena_points: number;
inventory: Array<InventoryItemType>;
};

type InventoryItemType = {
itemId: mongoose.Types.ObjectId;
name: string;
quantity: number;
};

type CreateCharacterType = {
name: string;
clase: string;
win_streak: number;
max_win_streak: number;
user_id: mongoose.Types.ObjectId;
};

type CreateShopType = {
name: string;
price: number;
type: string;
};

interface Character extends Document {
name: string;
clase: string;
win_streak: number;
max_win_streak: number;
honor_points: number;
arena_points: number;
user_id: mongoose.Types.ObjectId;
}

interface Shop extends Document {
name: string;
price: number;
type: string;
}

interface InventoryItem extends Document {
itemId: mongoose.Types.ObjectId;
name: string;
quantity: number;
}

const inventoryItemSchema = new Schema<InventoryItemType>({
itemId: {
type: Schema.Types.ObjectId,
required: true,
ref: 'Shop'
},
name: {
type: String,
required: true
},
quantity: {
type: Number,
required: true,
min: 1
}
});

const userSchema = new Schema<UserType>({
name: {
type: String,
required: true
},
surname: {
type: String,
required: true
},
email: {
type: String,
required: true,
unique: true,
index: true
},
password: {
type: String,
required: true
},
honor_points: {
type: Number,
required: true
},
arena_points: {
type: Number,
required: true
},
inventory: [inventoryItemSchema]
});

const createCharacterSchema = new Schema<CreateCharacterType>({
name: {
type: String,
required: true
},
clase: {
type: String,
required: true
},
win_streak: {
type: Number,
required: true
},
max_win_streak: {
type: Number,
required: true
},
user_id: {
type: Schema.Types.ObjectId,
ref: 'User',
required: true,
index: true
}
});

const shopSchema = new Schema<Shop>({
name: {
type: String,
required: true
},
price: {
type: Number,
required: true
},
type: {
type: String,
required: true,
enum: ['arena_points', 'honor_points']
}
});

const User = model<UserType & Document>('User', userSchema);
const Character = model<Character & Document>('Character', createCharacterSchema);
const Shop = model<Shop & Document>('Shop', shopSchema);

export {
UserType,
User,
InventoryItemType,
InventoryItem,
CreateCharacterType,
Character,
CreateShopType,
Shop
};
11 changes: 11 additions & 0 deletions staff/joel-suarez/project/api/data/populate.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import mongoose from 'mongoose'

import { Shop } from './index.ts'


mongoose.connect('mongodb://localhost:27017/arenaofhonor')
.then(() => Shop.create({name: 'Sword Shop',price: 1000,type: ['arena_points', 'honor_points']})

.then(() => mongoose.disconnect())
.then(() => console.log('populated'))
.catch(console.error))
Loading