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

Carlotta branch #8

Open
wants to merge 77 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
0dc7add
npm install
karin-lu Dec 5, 2022
227e78d
Create WYSIWYG_editor.js
Totta-Git Jan 17, 2023
232714e
WYSIWYG_editor vers 2
Totta-Git Jan 17, 2023
0172f1b
create_comment
sast5859 Jan 20, 2023
dcea0d7
nav bar
karin-lu Jan 21, 2023
43369bb
Delete footer.jsx
karin-lu Jan 21, 2023
c238922
Merge pull request #1 from karin-lu/karin_test4
karin-lu Jan 23, 2023
d19b5ed
Delete OLD WYSIWYG Editor
Totta-Git Jan 27, 2023
9db9377
back improvment
sast5859 Jan 28, 2023
6ed0e72
add post,get functions
sast5859 Feb 4, 2023
309df1b
Merge branch 'master' into sam_Test
sast5859 Feb 4, 2023
fd80d65
adding front to back code
sast5859 Feb 4, 2023
e34f5c6
initial changes
karin-lu Feb 5, 2023
bf0abf1
Merge pull request #2 from karin-lu/karin_test5
karin-lu Feb 5, 2023
a6c9185
update discover page
karin-lu Feb 5, 2023
2ab92af
post component
karin-lu Feb 5, 2023
fe40258
Merge branch 'master' into karin_test5
karin-lu Feb 6, 2023
19a81e0
scrollable div
karin-lu Feb 6, 2023
648a0b5
sticky nav and post component changes
karin-lu Feb 6, 2023
816eb57
Merge pull request #4 from karin-lu/karin_test7
karin-lu Feb 6, 2023
dc4f1c2
STEP 1: Create Page Figma to React
Totta-Git Feb 7, 2023
3641264
Comment: Terminology of Figma with explanations
Totta-Git Feb 7, 2023
ce463de
STEP 2: Improved code but still buggy
Totta-Git Feb 8, 2023
5163016
STEP 3: Meme Editor vers 2 (Youtube video)
Totta-Git Feb 8, 2023
8b68b7e
Merge branch 'sam_Test' of https://github.com/karin-lu/meme-generator…
sast5859 Feb 8, 2023
9d9e284
Merge pull request #5 from karin-lu/sam_Test
sast5859 Feb 8, 2023
f7685fe
Merge branch 'master' into sam_Test
sast5859 Feb 8, 2023
37b6cea
STEP 4: Edit Text and movable (To complete)
Totta-Git Feb 10, 2023
3af854b
STEP 5: Finished the Video Tutorial
Totta-Git Feb 10, 2023
0693f23
update
sast5859 Feb 12, 2023
8a5ea62
hello
sast5859 Feb 13, 2023
9d0fae0
hello
sast5859 Feb 13, 2023
d4c0863
discover page
sast5859 Feb 16, 2023
fb0f46a
Merge pull request #6 from karin-lu/Sam_Test2
sast5859 Feb 16, 2023
f9d7a54
Create Update
Totta-Git Feb 16, 2023
1439d53
Create Update Fine tuning 1
Totta-Git Feb 16, 2023
07931ff
Merge branch 'master' into Carlotta-Branch
Totta-Git Feb 16, 2023
0353c1f
Merge pull request #7 from karin-lu/Carlotta-Branch
Totta-Git Feb 16, 2023
7967249
Update package.json
Totta-Git Feb 16, 2023
94d680f
Merge pull request #8 from karin-lu/Carlotta-Branch
Totta-Git Feb 16, 2023
41c6630
add post and comments mechanism
sast5859 Feb 21, 2023
98308e4
resolved comments issue
sast5859 Feb 21, 2023
85717db
Improved Layout of the Create Page (still to improve)
Totta-Git Feb 21, 2023
afd1428
Small Update of the create layout
Totta-Git Feb 21, 2023
5a6316a
Image upload from device, Image upload from URL, Take a Picture from …
Totta-Git Feb 21, 2023
3cdc1d0
Complete Task 5 - To improve point 1 and 3
Totta-Git Feb 22, 2023
88352ba
likes bug
sast5859 Feb 22, 2023
930ba36
login ?
sast5859 Feb 22, 2023
431b455
can create comments on post
sast5859 Feb 22, 2023
fc15b86
login and sign up functions
karin-lu Feb 22, 2023
3119ae5
login layout
karin-lu Feb 22, 2023
7e7da65
colour change
karin-lu Feb 22, 2023
7cda26a
EDITOR: Need to implement The change between the templates
Totta-Git Feb 22, 2023
569ae6c
Changed the URL image upload (To Do: Switch Buttons for Templates)
Totta-Git Feb 22, 2023
fe8d228
TO DO: Improve Switch Buttons and maintain changes when switching
Totta-Git Feb 23, 2023
768b294
Merge branch 'sam_Test'
sast5859 Feb 23, 2023
af19f0f
login and signup done
sast5859 Feb 23, 2023
9669606
Merge pull request #10 from karin-lu/sam_Test
sast5859 Feb 23, 2023
5112b85
gethistory done
sast5859 Feb 23, 2023
52dece4
ToDo: "Keep already entered text or other settings"
Totta-Git Feb 24, 2023
438e160
Merge branch 'master' into Carlotta-Branch
Totta-Git Feb 24, 2023
912e90d
Merge pull request #11 from karin-lu/Carlotta-Branch
Totta-Git Feb 24, 2023
6547bea
Changed the App.js (NO LOGIN)
Totta-Git Feb 24, 2023
39fc6c2
SOLVED: Keep already entered text or other settings
Totta-Git Feb 24, 2023
44f0535
part 2
sast5859 Feb 24, 2023
8d269b7
Grid with 5 memes per row
Totta-Git Feb 24, 2023
e484282
Merge pull request #12 from karin-lu/Carlotta-Branch
Totta-Git Feb 24, 2023
8f98bae
login bug
sast5859 Feb 24, 2023
ff5db4e
login
karin-lu Feb 24, 2023
f63d3aa
editor and styles changes
karin-lu Feb 24, 2023
88db3f3
Design final tuning
Totta-Git Feb 24, 2023
3401470
Merge pull request #13 from karin-lu/Carlotta-Branch
Totta-Git Feb 24, 2023
4b435a7
mongoserver
sast5859 Feb 24, 2023
74c8ba8
Merge branch 'master' of https://github.com/karin-lu/meme-generator
sast5859 Feb 24, 2023
819e398
Merge branch 'sam_Test'
sast5859 Feb 24, 2023
ebb3c39
Re-labeling and Save Button
Totta-Git Feb 24, 2023
90932db
Merge branch 'master' into Carlotta-Branch
Totta-Git Feb 24, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
169 changes: 168 additions & 1 deletion mememuc-launcher/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion mememuc-launcher/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
"author": "LMU Mediainformatics Group",
"license": "ISC",
"dependencies": {
"concurrently": "^7.5.0"
"all": "^0.0.0",
"concurrently": "^7.5.0",
"react-router-dom": "^6.7.0"
}
}
Binary file added mongoserver/data/comments.bson
Binary file not shown.
1 change: 1 addition & 0 deletions mongoserver/data/comments.metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"38e59f8d34f84596800922ea1d837163","collectionName":"comments","type":"collection"}
Binary file added mongoserver/data/likes.bson
Binary file not shown.
1 change: 1 addition & 0 deletions mongoserver/data/likes.metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"6146485db81c413e843008590e3e5254","collectionName":"likes","type":"collection"}
Binary file added mongoserver/data/meme.bson
Binary file not shown.
1 change: 1 addition & 0 deletions mongoserver/data/meme.metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"384edd84ae224654a6cc81e251bd1412","collectionName":"meme","type":"collection"}
Binary file added mongoserver/data/posts.bson
Binary file not shown.
1 change: 1 addition & 0 deletions mongoserver/data/posts.metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"455d84bb3cbb4eeb84bdab8f674397f9","collectionName":"posts","type":"collection"}
Binary file modified mongoserver/data/users.bson
Binary file not shown.
2 changes: 1 addition & 1 deletion mongoserver/data/users.metadata.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"8957b8f4ab1143fea5465e72a7d69fbe","collectionName":"users","type":"collection"}
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"f9db79df35c24616a8caa4c46374aeed","collectionName":"users","type":"collection"}
8 changes: 7 additions & 1 deletion mongoserver/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,10 @@ const uri = mongod.getUri();
console.log(uri)


await mongoose.connect(uri, {});
await mongoose.connect(uri, {})
.then(() => {
console.log('Connected to the database successfully');
})
.catch(error => {
console.error(`Error connecting to the database: ${error}`);
});
2 changes: 1 addition & 1 deletion mongoserver/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "index.js",
"type": "module",
"scripts": {
"start": "concurrently-await \"node --experimental-modules index.mjs\" \"mongorestore mongodb://127.0.0.1:65535 --db omm-ws2223 data\\ await --delay 2000\""
"start": "concurrently-await \"node --experimental-modules index.mjs\" \"mongorestore mongodb://127.0.0.1:65535 --db omm-2223 data\\ await --delay 2000\""
},
"keywords": [],
"author": "",
Expand Down
57 changes: 34 additions & 23 deletions node-backend/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,70 +3,81 @@ var express = require('express');
var path = require('path');
var cookieParser = require('cookie-parser');
var logger = require('morgan');

const fs = require('fs');
const cors = require('cors');
// ##### IMPORTANT
// ### Your backend project has to switch the MongoDB port like this
// ### Thus copy paste this block to your project
const MONGODB_PORT = process.env.DBPORT || '27017';
const db = require('monk')(`127.0.0.1:${MONGODB_PORT}/omm-ws2223`); // connect to database omm-2021

const db = require('monk')(`127.0.0.1:${MONGODB_PORT}/omm-2223`);// connect to database omm-2021
db.then(() => {
console.log('Successfully connected to the database omm-2223');
db.listCollections().then(collections => {
console.log('Collections in the database omm-2223:');
collections.forEach(collection => {
console.log(collection.name);
});
});
}).catch(error => {
console.error('Error connecting to the database: ', error);
});

console.log(`Connected to MongoDB at port ${MONGODB_PORT}`)

// ######

var indexRouter = require('./routes/index');
var usersRouter = require('./routes/users');
var commentRouter = require('./routes/comment');
var likeRouter = require('./routes/like');
var postRouter = require('./routes/post');


var app = express();

// view engine setup
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'jade');

app.use(cors());
app.use(logger('dev'));
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
app.use(cookieParser());



app.use(function(req,res,next){ req.db = db;
next();
});


// the login middleware. Requires BasicAuth authentication
app.use((req,res,next) => {
const users = db.get('users');
users.findOne({basicauthtoken: req.headers.authorization}).then(user => {
if (user) {
req.username = user.username; // test test => Basic dGVzdDp0ZXN0
next()
}
else {
res.set('WWW-Authenticate', 'Basic realm="401"')
res.status(401).send()
}
}).catch(e => {
console.error(e)
res.set('WWW-Authenticate', 'Basic realm="401"')
res.status(401).send()
})
})



app.use(express.static(path.join(__dirname, 'public')));
app.use('/', indexRouter);
app.use('/users', usersRouter);
app.use('/comments',commentRouter);
app.use('/posts',postRouter);
app.use('/likes',likeRouter);



// catch 404 and forward to error handler
app.use(function(req, res, next) {

next(createError(404));
});

// error handler
app.use(function(err, req, res, next) {
// set locals, only providing error in development
console.log("error status"+err.status);
res.locals.message = err.message;
console.log("in the error handler");
console.log(err.message);
res.locals.error = req.app.get('env') === 'development' ? err : {};

// render the error page
res.status(err.status || 500);
res.render('error');
Expand Down
Loading