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

Styling profile #514

Open
wants to merge 156 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
156 commits
Select commit Hold shift + click to select a range
6a83034
Adding test docs folder and docs
Swright88 Jun 12, 2023
695b1a7
Reversed posts
Swright88 Jun 13, 2023
3cb3a40
Install dotenv
cutetofuu Jun 13, 2023
cdc17ed
Set up production environment
cutetofuu Jun 13, 2023
57982b6
Add first and last names
cutetofuu Jun 13, 2023
bb69b3d
Merge branch 'main' into mongodb-setup
cutetofuu Jun 13, 2023
322ac35
Merge pull request #1 from MMal87/mongodb-setup
cutetofuu Jun 13, 2023
cbc2ab1
changes
Chrishall17 Jun 13, 2023
05da992
working on posts and comments
MMal87 Jun 13, 2023
f609f27
working on comments
MMal87 Jun 14, 2023
be596ed
changes
Chrishall17 Jun 14, 2023
783fd87
add seed data to development, create profile page/routes
Jun 14, 2023
376c233
Add login and signup links
cutetofuu Jun 14, 2023
54aec43
Install bcrypt
cutetofuu Jun 14, 2023
a991cef
Add password hashing feature
cutetofuu Jun 14, 2023
eba3db6
comments working
MMal87 Jun 14, 2023
f17c9fa
draft posts tests
Swright88 Jun 14, 2023
87d82d0
implement list of friends and non-friends on profile page first draft
Jun 14, 2023
ed399e3
ability to add and remove friends from database and show on html page
Jun 14, 2023
9a21f63
Update seed data
cutetofuu Jun 14, 2023
2614eab
like button work
MMal87 Jun 14, 2023
9c6eee2
"css and password validation"
Chrishall17 Jun 14, 2023
983e89d
Merge branch 'tester-ch' into main
Chrishall17 Jun 15, 2023
2bd6624
Merge pull request #2 from MMal87/main
Chrishall17 Jun 15, 2023
23a92b1
ready to merge
Chrishall17 Jun 15, 2023
1274bb9
Merge pull request #3 from MMal87/tester-ch
Chrishall17 Jun 15, 2023
8eaafd9
Created a couple of tests, added input on show.hbs
PHagan23 Jun 15, 2023
11cd474
"changes"
Chrishall17 Jun 15, 2023
da65184
when user submits add friend it goes into friend requests section for…
Jun 15, 2023
7e92548
changes to likes
MMal87 Jun 15, 2023
b8e3bc9
likes
MMal87 Jun 15, 2023
916111c
"changes"
Chrishall17 Jun 15, 2023
f7eea29
Merge pull request #4 from MMal87/tester-ch
Chrishall17 Jun 15, 2023
70ffa0d
added tests
PHagan23 Jun 15, 2023
d91efa1
changes
Chrishall17 Jun 15, 2023
8b24f6b
Add login and signup error messages
cutetofuu Jun 15, 2023
4e85664
Merge pull request #5 from MMal87/tester-ch
Chrishall17 Jun 15, 2023
665f935
Merge branch 'main' into signup-validation
cutetofuu Jun 15, 2023
0b82e3e
likes and comments
MMal87 Jun 15, 2023
a4c7568
likes
MMal87 Jun 15, 2023
9d8f035
edited likebutton name
MMal87 Jun 15, 2023
5c05679
likebutton
MMal87 Jun 15, 2023
e6ef101
fix bug and page now updates after accepting friend request to reflec…
Jun 15, 2023
9e68988
Update stylesheet links
cutetofuu Jun 15, 2023
0b61a7b
Update error message
cutetofuu Jun 15, 2023
61fa331
likes on index page
MMal87 Jun 15, 2023
fa1ede2
Merge branch 'main' into tuesday
ClaudiaGC1339 Jun 15, 2023
9704f5c
Merge pull request #7 from MMal87/tuesday
ClaudiaGC1339 Jun 15, 2023
65e0f4a
Add form validation with regex
cutetofuu Jun 15, 2023
07a1111
Merge branch 'main' to signup-validation
cutetofuu Jun 15, 2023
22d62f9
fixed some styling issues
Jun 15, 2023
9ba2005
Merge branch 'main' into mongoose
AlexBuzea Jun 15, 2023
74f0516
Merge pull request #8 from MMal87/mongoose
AlexBuzea Jun 15, 2023
2b25996
Update routes
cutetofuu Jun 15, 2023
dc750fe
Merge branch 'main' into signup-validation
cutetofuu Jun 15, 2023
78803e8
Merge pull request #6 from MMal87/signup-validation
cutetofuu Jun 15, 2023
7ed740e
Update seed data with hashed passwords
cutetofuu Jun 16, 2023
e24fa8b
Merge pull request #9 from MMal87/update-seed-data
cutetofuu Jun 16, 2023
ebb2155
Add user to seed data
cutetofuu Jun 16, 2023
892919c
Merge branch 'main' of https://github.com/MMal87/acebook-neutral into…
cutetofuu Jun 16, 2023
037b447
Merge pull request #10 from MMal87/update-seed-data
cutetofuu Jun 16, 2023
d75a31f
fix remove friend
Jun 16, 2023
921eda1
added authors
MMal87 Jun 16, 2023
cd026f1
added names and timestamps to posts and comments
MMal87 Jun 16, 2023
8c968a1
fix bug where use
Jun 16, 2023
d232189
multer install
MMal87 Jun 16, 2023
e142210
add sentFriendRequests field to user model in order to evaluate wheth…
Jun 16, 2023
a8b9a09
"Added more tests"
Swright88 Jun 16, 2023
3a91d80
Merge pull request #11 from MMal87/mongoose2
AlexBuzea Jun 16, 2023
723330b
fixed commit
Swright88 Jun 16, 2023
adb630e
working on uploading images
MMal87 Jun 16, 2023
e689155
Merge pull request #12 from MMal87/authorsOnPosts
AlexBuzea Jun 16, 2023
a2f7395
added integration tests, started structing test folders, added test n…
PHagan23 Jun 16, 2023
0875f74
added tests
PHagan23 Jun 16, 2023
54ff535
data adding datato mongodb and uploading jpeg
MMal87 Jun 19, 2023
b61a846
most recent version
Jun 19, 2023
8ebfc58
updated version
Jun 19, 2023
b7372c4
images
MMal87 Jun 19, 2023
58166c2
Update user seed data
cutetofuu Jun 19, 2023
2dee8e6
Add logic to show friends posts
cutetofuu Jun 19, 2023
b4132db
fix bug with Add Friend button, friend request persists now
Jun 19, 2023
0457ac7
Remove comments
cutetofuu Jun 19, 2023
e226a92
tidied up code
Jun 19, 2023
563fabc
fixed issue with remove friend button so that it reflects the current…
Jun 19, 2023
18a3596
fixed bug where when adding a friend and removing another one, it was…
Jun 19, 2023
823515e
added tests
PHagan23 Jun 19, 2023
cb83026
Merge pull request #13 from MMal87/mongoose3
AlexBuzea Jun 19, 2023
5c82b33
Merge branch 'main' of https://github.com/MMal87/acebook-neutral into…
cutetofuu Jun 19, 2023
96f7aef
Update user seed data
cutetofuu Jun 19, 2023
e9257d3
Merge pull request #14 from MMal87/only-show-friends-posts
cutetofuu Jun 19, 2023
d28ae15
Merge pull request #15 from MMal87/phagan_testing
PHagan23 Jun 19, 2023
7f4685e
Added more unit tests
Swright88 Jun 19, 2023
69f406a
Merge branch 'main' into uploadingImagesAsPosts
cutetofuu Jun 19, 2023
719e162
styling
Chrishall17 Jun 20, 2023
666f006
Add display image functionality
cutetofuu Jun 20, 2023
c2ebef2
Merge branch 'main' of https://github.com/MMal87/acebook-neutral into…
cutetofuu Jun 20, 2023
efb637d
Remove comments and console.logs
cutetofuu Jun 20, 2023
48eddbe
style login page
Jun 20, 2023
a68327c
changes
Chrishall17 Jun 16, 2023
e43678f
tests
Chrishall17 Jun 19, 2023
9031305
changes
Chrishall17 Jun 19, 2023
2e88f39
tests
Chrishall17 Jun 19, 2023
505f559
10am Tue 20 June
SirDougy Jun 20, 2023
cfa82e9
.
SirDougy Jun 20, 2023
82353e5
add sentFriendRequests field to user model in order to evaluate wheth…
Jun 16, 2023
8d9757b
updates
Chrishall17 Jun 20, 2023
cdcfb23
updates
Chrishall17 Jun 20, 2023
ac2df52
updates
Chrishall17 Jun 20, 2023
4dc6db5
updates
Chrishall17 Jun 20, 2023
fe1152b
updates
Chrishall17 Jun 20, 2023
e2ffb61
added tests
PHagan23 Jun 16, 2023
431d34b
added tests
PHagan23 Jun 19, 2023
b54be41
changes
Chrishall17 Jun 16, 2023
e78fe3e
add sentFriendRequests field to user model in order to evaluate wheth…
Jun 16, 2023
057eedc
added authors
MMal87 Jun 16, 2023
66ef01a
Update user seed data
cutetofuu Jun 19, 2023
681aff7
added tests
PHagan23 Jun 16, 2023
22d0399
added tests
PHagan23 Jun 19, 2023
0b5c552
updates
Chrishall17 Jun 20, 2023
b17b68f
fixed post text link
Swright88 Jun 20, 2023
0b6babc
style signup page
Jun 20, 2023
f5d203a
updates
Chrishall17 Jun 20, 2023
b15b9de
Merge branch 'main' into uploadingImagesAsPostsV2
cutetofuu Jun 20, 2023
afe651a
Merge branch 'uploadingImagesAsPostsV2' of https://github.com/MMal87/…
cutetofuu Jun 20, 2023
a7d9219
Fix single post page
cutetofuu Jun 20, 2023
d804c97
Merge pull request #18 from MMal87/uploadingImagesAsPostsV3
cutetofuu Jun 20, 2023
2159c8a
style homepage
Jun 20, 2023
8bd7036
tried adding pic upload to profile page
MMal87 Jun 20, 2023
b1c553c
going to database but not displaying on page
MMal87 Jun 20, 2023
a733fba
added error message when trying to create an empty post
MMal87 Jun 20, 2023
24ad391
New style
Jun 21, 2023
4f5cf6b
new style
Jun 21, 2023
a668440
fixed profile page issue
Jun 21, 2023
5581371
Merge pull request #20 from MMal87/new_style
AlexBuzea Jun 21, 2023
880d7a9
Merge branch 'tester-ch-2' of https://github.com/MMal87/acebook-neutr…
SirDougy Jun 21, 2023
87bf3ee
test headings
Chrishall17 Jun 21, 2023
2d3787b
merging with uploadprofile photo branch
MMal87 Jun 21, 2023
c125898
fixed reject friend request button
Jun 21, 2023
63beddc
Merge pull request #21 from MMal87/profile_reject
AlexBuzea Jun 21, 2023
5ad9cdd
changes
Chrishall17 Jun 21, 2023
32b19a7
name test
Chrishall17 Jun 21, 2023
cc82bd2
working on profilepictures
MMal87 Jun 21, 2023
7e1ffc1
fixed issue with posts upload
MMal87 Jun 21, 2023
ccbfc3f
changes to emptypostvalidation
MMal87 Jun 21, 2023
b88f5f4
Merge pull request #22 from MMal87/emptyPostError
MMal87 Jun 21, 2023
5fd32e6
Add initial photo upload logic
cutetofuu Jun 21, 2023
3a172ba
Merge pull request #23 from MMal87/tester-ch-2
SirDougy Jun 21, 2023
7171200
Add more photo upload logic
cutetofuu Jun 21, 2023
c51d7d5
Updating tests
Swright88 Jun 21, 2023
8a97f1f
styling for profile
Jun 21, 2023
862be3e
Add profile photo uploader
cutetofuu Jun 21, 2023
6735f97
..
SirDougy Jun 21, 2023
19191d6
Merge branch 'main' into photoUploadProfilePage
cutetofuu Jun 21, 2023
9b7783a
Merge branch 'main' of https://github.com/MMal87/acebook-neutral into…
cutetofuu Jun 21, 2023
4806522
Merge pull request #24 from MMal87/photoUploadProfilePage
cutetofuu Jun 21, 2023
252355b
Merge branch 'main' into styling_profile
AlexBuzea Jun 21, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ It uses:

## Card wall

REPLACE THIS TEXT WITH A LINK TO YOUR CARD WALL
https://trello.com/invite/b/Fv5Elopq/ATTI7a7e4a5260b33e9bf40ad2a5da74932bF6FF7822/acebook-team-neutral

## Quickstart

Expand Down
83 changes: 83 additions & 0 deletions Test Documents/Acebook-Test-Plan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Acebook Test Plan

## Objective

This test plan intends to outline the testing that will be performed on the Acebook code that is being developed by our team.
It will aim to highlight potential bugs in the software and provide information on their severity and priority prior to deployment.

The Acebook website is a piece of software that aims to allow a user to:
- Sign up
- Log in
- Edit and update their profile
- Create and publish a post
- View a list of users that they can send a friend request to
- Approve and deny friend requests
- View a list of their friends
- View feed
- Comment and like posts from other users
- Log out


## Scope of testing

We are going to test all of the main pieces of functionality from a users perspective. We will also include some validation checking for areas such as email addresses and user passwords. In addition we will be testing the database functionaility for items such as unique user ID's and the integration between each database.

## Test environment

These test sessions will be conducted in VSCode as well as multiple modern browsers starting with Chrome and moving to Firefox.

## Test Team

The test team consists of 4 testers.

- Sean Wright
- James Turnbull
- Chris Hall
- Patrick Hagan

## Features to be tested

- User sign up and field validity checks
- Login
- Log out
- Page navigation (once logged in)
- Duplicate user accounts (blocked)
- Users can create a post (can consist of text and/or pictures)
- Editing profile
- Check that a user can add a profile picture
- Check name and picture appears beside their own posts
- Sending friend requests
- Approving/denying a friend request
- View list of friends
- View list of users they may know
- Be able to comment on a post in their feed
- Be able to like a post in their feed and view the number of likes for that post

## Assumptions

During these tests certain assumptions will be made to make testing more effective and efficient. These assumptions are as follows:

- Only users logged in will be able to make a post
- The language will be English
-

## Defect management

When a defect is found it will be noted and a bug report will be created containing the details of the issue as well as the steps to reproduce. These will then be placed onto the teams Trello board in the 'Reviewed - Needs action' list. From here it will be picked up by the development team and then resubmitted for review by the test team. Once the tests have been conducted and the team is happy the task will be placed into the 'Done' list.

## Risks

| Risk | Mitigation |
| ---- | ---------- |
| Friction within the team. | Talk through issues/use coaches where needed. |
| Recent intermittent internet access in testers home. | Use of hot spot if necessary. |
| Time limit not allowing for all features to be tested. | Limit straying or chasing rabit holes. |
| Lack of knowledge of language and codebase for testers. | Use coaches/devs and the internet to upskill |

## Exit criteria

The project will be deemed completed once all of the tasks on the Trello board are placed into done or when the time limit has been reached (02/06/2023).




Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions Test Documents/notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Exploratory Testing Notes

## Landing Page

## Sign-up Page

- Validation - should numbers be allowed in first name and second name? I believe it's standard to disallow the use of number
- Validation - Should the names be allowed with any capitalization and then be manipulated to always follow capital first letter structure?
- Validation - Check database for duplicate emails
- Feature suggestion - After signing up successfully, an alert pops up after the redirect to the login page that lets the user know their account was created successfully
- HTML - Consistency with element tagging - Title has a class on home page but not on sign up

## Single Post

- Validation on commenting - Currently can submit empty comment
- Feature Recommendation - User can remove their like from a post

### CSS

- Fixed size for the comment text box?

## Profile

- BUG - Name coming through as 'Name' instead of user name
59 changes: 59 additions & 0 deletions Test Documents/test_cases.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
## PAGES:
1 - Homepage/login
2 - Sign up
3 - Feed
4 - Profile
5 - Users


## TEST CASES:

*** 1 ***

Homepage:
- Title is visible and reads 'Acebook'
- Check login fields on page
- Check sign up button and redirects to sign up page

Login:
- Error if username or password wrong
- Log in with correct details and redirected to feed page


*** 2 ***

- Username (email) & password validation checks (Unit test maybe)
- After succesful sign up returned to homepage, possibly with confirmation message
- Error messages if details incorrect
- Button to return to homepage


*** 3 ***

- User can submit a post
- User can like a post
- User can react/comment on a post
- Likes are shown
- Username is shown for the post
- Posts are in chronological order
- All posts are shown
- User can edit/delete a post (nice-to-have)
- Hide certain user posts (nice-to-have)


*** 4 ***

- User can upload/edit profile picture
- Users friends can be seen
- User can edit/update personal details
- User can't view other users password/personal info
- Users posts are viewable
- Button to feed/logout/other profiles (possibly) are in navbar


*** 5 ***

- View all users
- Add friends
- Remove friends
- Pending requests
66 changes: 40 additions & 26 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ const homeRouter = require("./routes/home");
const postsRouter = require("./routes/posts");
const sessionsRouter = require("./routes/sessions");
const usersRouter = require("./routes/users");
const profileRouter = require("./routes/profile");
const commentsRouter = require("./routes/posts");
const { handlebars } = require("hbs");
const moment = require("./public/javascripts/moment.min");


const app = express();

Expand All @@ -25,54 +30,63 @@ app.use(express.static(path.join(__dirname, "public")));
app.use(methodOverride("_method"));

app.use(
session({
key: "user_sid",
secret: "super_secret",
resave: false,
saveUninitialized: false,
cookie: {
expires: 600000,
},
})
session({
key: "user_sid",
secret: "super_secret",
resave: false,
saveUninitialized: false,
cookie: {
expires: 600000,
},
})
);

// clear the cookies after user logs out
// clear the cookies and session after user logs out
app.use((req, res, next) => {
if (req.cookies.user_sid && !req.session.user) {
res.clearCookie("user_sid");
}
next();
if (req.cookies.user_sid && !req.session.user) {
res.clearCookie("user_sid");
req.session.friendRequestSent = null; // Clear the friendRequestSent value
}
next();
});

// middleware function to check for logged-in users
const sessionChecker = (req, res, next) => {
if (!req.session.user && !req.cookies.user_sid) {
res.redirect("/sessions/new");
} else {
next();
}
if (!req.session.user && !req.cookies.user_sid) {
res.redirect("/sessions/new");
} else {
next();
}
};

// route setup
app.use("/", homeRouter);
app.use("/posts", sessionChecker, postsRouter);
app.use("/sessions", sessionsRouter);
app.use("/users", usersRouter);
app.use("/profile", profileRouter);
app.use("/:postId", sessionChecker, postsRouter);
app.use("/:postId/comments", sessionChecker, commentsRouter);
app.use("/:postId/like", sessionChecker, postsRouter);
app.use("/posts/new", sessionChecker, postsRouter);

// catch 404 and forward to error handler
app.use((req, res, next) => {
next(createError(404));
next(createError(404));
});

// error handler
app.use((err, req, res) => {
// set locals, only providing error in development
res.locals.message = err.message;
res.locals.error = req.app.get("env") === "development" ? err : {};
// set locals, only providing error in development
res.locals.message = err.message;
res.locals.error = req.app.get("env") === "development" ? err : {};

// render the error page
res.status(err.status || 500);
res.render("error");
// render the error page
res.status(err.status || 500);
res.render("error");
});

handlebars.registerHelper("timeAgo", (date) => moment(date).fromNow());

module.exports = app;
module.exports.sessionChecker = sessionChecker;