Skip to content
This repository was archived by the owner on Mar 9, 2021. It is now read-only.

Commit f944d96

Browse files
authored
Merge pull request #2 from coderplex/implement-models
Add models for Members and Projects
2 parents 1e18451 + 6c1f653 commit f944d96

File tree

4 files changed

+2110
-5
lines changed

4 files changed

+2110
-5
lines changed

Models/member.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
const mongoose, { Types: {
2+
ObjectId
3+
} } = require('mongoose');
4+
5+
const ProjectSchema = new mongoose.Schema({
6+
userID: ObjectId,
7+
projectName: String,
8+
projectDesc: String,
9+
techUsed: [String],
10+
projectLinks: {
11+
live: String,
12+
source: String,
13+
},
14+
});
15+
16+
const MemberSchema = new mongoose.Schema({
17+
userName: String,
18+
profilePic: String,
19+
bio: String,
20+
isLookingForWork: Boolean,
21+
socialMediaHandles: {
22+
facebook: String,
23+
discord: String,
24+
github: String,
25+
linkedin: String,
26+
twitter: String,
27+
},
28+
skills: [String],
29+
interestedIn: [String],
30+
projects: [String],
31+
})
32+
33+
module.exports = {
34+
Member: mongoose.model('Member', MemberSchema),
35+
Project: mongoose.model('Project', ProjectSchema),
36+
}

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@
2727
"dependencies": {
2828
"body-parser": "^1.18.3",
2929
"express": "^4.16.3",
30-
"mongodb": "^3.1.0",
31-
"nodemon": "^1.17.5",
3230
"express-jwt": "^3.0.1",
3331
"express-session": "^1.11.3",
34-
"jsonwebtoken": "^5.0.2"
35-
32+
"jsonwebtoken": "^5.0.2",
33+
"mongodb": "^3.1.0",
34+
"mongoose": "^5.2.3",
35+
"nodemon": "^1.17.5"
3636
}
3737
}

server.js

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,61 @@
11
const express = require('express');
22
const app = express();
33

4+
const profiles = [
5+
{
6+
username: 'testuser',
7+
pic: 'google.com/image',
8+
bio: 'Lorem Ipsum Generator provides a GTK+ graphical user interface, a command-line interface, and a Python module that generate random "lorem ipsum" text (a popular kind of dummy text) (BSD Original, Libraries, Utilities, Testing, Web).',
9+
isLookingForWork: false,
10+
socialMediaHandles: {
11+
facebook: '/testuser',
12+
discord: 'testuser',
13+
github: 'testuser',
14+
linkedin: 'testuser',
15+
twitter: 'testuser',
16+
},
17+
skills: [
18+
"html",
19+
"css",
20+
"javascript"
21+
],
22+
interested: [
23+
"nodejs",
24+
"react",
25+
],
26+
projects: [
27+
{
28+
name: 'project',
29+
description: 'echo echo 11',
30+
tech: ["html", "css", "javascript"],
31+
link: "now.sh",
32+
src: 'github.com/now'
33+
},
34+
{
35+
name: 'project',
36+
description: 'echo echo 11',
37+
tech: ["html", "css", "javascript"],
38+
link: "now.sh",
39+
src: 'github.com/now'
40+
},
41+
{
42+
name: 'project',
43+
description: 'echo echo 11',
44+
tech: ["html", "css", "javascript"],
45+
link: "now.sh",
46+
src: 'github.com/now'
47+
}
48+
]
49+
}
50+
];
451

52+
app.get('/:user', (req, res) => {
53+
console.log(req.params.user);
54+
})
555

656
app.get('/', (req, res) => {
757
res.send('Backend in progress');
858
});
9-
app.listen(process.env.PORT, function () {
59+
app.listen(process.env.PORT || 5000, function () {
1060
console.log(`Listening on ${process.env.PORT}`);
1161
});

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy