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

Wedding site - Final project Web Dev Bootcamp spring 2024 - Nathalie & Sofia #60

Open
wants to merge 147 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
147 commits
Select commit Hold shift + click to select a range
aa71845
First commit
sofia32057 May 26, 2024
d1bbfda
Update - env and README basics
sofia32057 May 26, 2024
badb7c3
Update - added get and post for guests + model
sofia32057 May 26, 2024
16b032c
Update - Seeded DB with guest list + added endpoint for specific guest
sofia32057 May 26, 2024
d45ec65
setting up tailwind
ohitsnathalie May 27, 2024
f0d43a6
Update - Added login endpoint and hashed passwords in db seed function
sofia32057 May 28, 2024
cc8324e
Update - added patch for updating guest
sofia32057 May 29, 2024
4d2e4d5
Update - Pages, sections and components added. NOTE! Sections to me m…
sofia32057 Jun 1, 2024
3860327
merge from nav component
ohitsnathalie Jun 1, 2024
e4c2bca
Update - added zustand and default store
sofia32057 Jun 1, 2024
b76bf16
Update - merge zustand
sofia32057 Jun 1, 2024
35a2538
Update - pair session - pasted tailwind components + started router nav
sofia32057 Jun 1, 2024
d5d3415
Update - added routes and navlinks
sofia32057 Jun 1, 2024
8531c0a
Update - RSVP form added + fetch for API. Needs fixes still...
sofia32057 Jun 2, 2024
c115e70
Update - added save to patch endpoint
sofia32057 Jun 2, 2024
c052a0c
Merge branch 'ft-fe-rsvp'
sofia32057 Jun 3, 2024
9aa2200
Update - added login form and fetch
sofia32057 Jun 3, 2024
f8369bc
Update - basic store added + logged in check at routes and nav
sofia32057 Jun 3, 2024
25e72cd
trying adding countdown
ohitsnathalie Jun 4, 2024
d73f3a5
Merge branch 'main' of https://github.com/sofia32057/project-final in…
ohitsnathalie Jun 4, 2024
e7ca953
changed login form and install tailwind forms
ohitsnathalie Jun 4, 2024
cb4ed9e
Change order of homepage
ohitsnathalie Jun 4, 2024
a2ba866
added schedule component
ohitsnathalie Jun 4, 2024
1d267b9
Update - menu and heading components
sofia32057 Jun 4, 2024
d31d9ea
Updata - merge menu
sofia32057 Jun 4, 2024
094260d
added venue and map
ohitsnathalie Jun 4, 2024
a3928fb
adjusting text in venue
ohitsnathalie Jun 4, 2024
5f114cd
Merge branch 'ft-fe-venue'
ohitsnathalie Jun 4, 2024
c038f59
install dependencies
ohitsnathalie Jun 4, 2024
e6ee5b8
Update - FAQ and Accordion added
sofia32057 Jun 6, 2024
6c0fa45
Update - assets added
sofia32057 Jun 6, 2024
69ab28b
Update - Added our story
sofia32057 Jun 6, 2024
4132b5d
Update - Hero and heading updated
sofia32057 Jun 6, 2024
41c0efc
Update - styling rsvp +changes to login and store
sofia32057 Jun 6, 2024
8bd669d
Update - added user id to login endpoint
sofia32057 Jun 6, 2024
4f617a8
Update - changed text colors in accordion
sofia32057 Jun 6, 2024
9cd9873
Update - fixed bug with duplicate keys
sofia32057 Jun 8, 2024
a139e5c
Update - added confirmation
sofia32057 Jun 8, 2024
22cb342
Update - Auth added + new folders
sofia32057 Jun 8, 2024
214991c
Update - token added to headers + rsvp fetched moved to store
sofia32057 Jun 8, 2024
67fe9a2
Merge branch 'ft-be-auth' into ft-fe-auth
sofia32057 Jun 8, 2024
6c2ff0c
Update - added data to guest fetch
sofia32057 Jun 8, 2024
58c6e0a
Update - changes to forms
sofia32057 Jun 8, 2024
29e3a23
Update - logout added
sofia32057 Jun 8, 2024
481eccc
Update - switched from user password to env code, removed json guestl…
sofia32057 Jun 9, 2024
3fc5f0f
minor changes
ohitsnathalie Jun 9, 2024
eb63e51
change map size and added heading to venue
ohitsnathalie Jun 9, 2024
2bcc470
changing maps api to iFrames
ohitsnathalie Jun 9, 2024
f618236
Update - some basic styling to follow in components
sofia32057 Jun 9, 2024
e31d512
added icons and changed styles
ohitsnathalie Jun 9, 2024
04215f0
Merge branch 'ft-fe-schedule'
ohitsnathalie Jun 9, 2024
8ff829c
adjust styling on address
ohitsnathalie Jun 9, 2024
2e587be
changed sign in button
ohitsnathalie Jun 9, 2024
1ea944a
changing button and headdings for the login page
ohitsnathalie Jun 9, 2024
3d693a7
Update - trying to switch to render, but keep getting error about the…
sofia32057 Jun 9, 2024
556a995
changing headings
ohitsnathalie Jun 9, 2024
d1b8955
adding background color
ohitsnathalie Jun 9, 2024
7e58e24
Update -s tyling FAQ and accordion
sofia32057 Jun 9, 2024
4658877
Merge conflict - update styling FAQ
sofia32057 Jun 9, 2024
cf059e4
Update - changes to text and added image. Needs grid.
sofia32057 Jun 9, 2024
62c1619
changed background color
ohitsnathalie Jun 9, 2024
5a1f0a4
removed darkmode
ohitsnathalie Jun 9, 2024
ebd9ad5
change styling login
ohitsnathalie Jun 10, 2024
acba195
Merge branch 'main' of https://github.com/sofia32057/project-final in…
ohitsnathalie Jun 10, 2024
7c92950
adding carousel
ohitsnathalie Jun 10, 2024
8067bba
minor bug fix
ohitsnathalie Jun 10, 2024
7719642
adding a simple footer
ohitsnathalie Jun 10, 2024
231ebb7
Merge branch 'main' of https://github.com/sofia32057/project-final in…
ohitsnathalie Jun 10, 2024
c3c0d2b
adding images for carousel
ohitsnathalie Jun 10, 2024
b0d1365
trying to make slides work
ohitsnathalie Jun 10, 2024
72f4ffe
changed schedule styling
ohitsnathalie Jun 10, 2024
ab915a4
added missing className
ohitsnathalie Jun 10, 2024
6df2575
change padding
ohitsnathalie Jun 10, 2024
3d097fa
changed the font size for heading
ohitsnathalie Jun 10, 2024
39c2e07
Merge branch 'main' of https://github.com/sofia32057/project-final in…
sofia32057 Jun 10, 2024
7e5be25
Update - catchup sloppy merge
sofia32057 Jun 10, 2024
dc63d93
changing venu to grid
ohitsnathalie Jun 10, 2024
998a4d0
grid styling and change of h3 heading
ohitsnathalie Jun 10, 2024
c3f9c16
Merge branch 'styling-venue'
ohitsnathalie Jun 10, 2024
070c3fc
Merge branch 'main' of https://github.com/sofia32057/project-final in…
ohitsnathalie Jun 10, 2024
5ddceef
playing around with slider. does not work.
ohitsnathalie Jun 11, 2024
0525d1a
made slider work
ohitsnathalie Jun 11, 2024
d86c827
changed images and fixed slider size
ohitsnathalie Jun 11, 2024
111c012
changed dots and customized arrows
ohitsnathalie Jun 11, 2024
56c947b
added padding
ohitsnathalie Jun 11, 2024
a94bcc1
fixed responsiveness
ohitsnathalie Jun 11, 2024
fbae170
Update - styling to Hero, FAQ, Story, Image + new reusable components…
sofia32057 Jun 11, 2024
d705665
accommodation responsiveness and deleting line of code in map
ohitsnathalie Jun 11, 2024
dbdb0a7
change of map size
ohitsnathalie Jun 11, 2024
12e26e2
Update - added nav callback to login and rsvp
sofia32057 Jun 11, 2024
998fd2b
Update - merge styling
sofia32057 Jun 11, 2024
c7c7b17
Merge branch 'ft-fe-redirect'
sofia32057 Jun 11, 2024
2d11343
Merge branch 'ft-fe-accommodation'
ohitsnathalie Jun 11, 2024
a1d3022
installed dependency
ohitsnathalie Jun 11, 2024
5c2182f
added favicon and meta description
ohitsnathalie Jun 11, 2024
44c68ee
adjust footer size
ohitsnathalie Jun 11, 2024
954c1c6
changed dots and arrows of slider
ohitsnathalie Jun 11, 2024
6975541
adjusted padding
ohitsnathalie Jun 11, 2024
ee87232
Update - added scroll links in nav + ids + minor overall styling for …
sofia32057 Jun 12, 2024
4ec9bfa
Update - hashlinks in drawer, close onclick + full width styling
sofia32057 Jun 12, 2024
df84463
changed content to json
ohitsnathalie Jun 12, 2024
cac85b2
changed styling
ohitsnathalie Jun 12, 2024
7577820
made the map sticky
ohitsnathalie Jun 12, 2024
d6c1098
made pin and text centered
ohitsnathalie Jun 12, 2024
4f1db44
added json for timetable and timetable.jsx
ohitsnathalie Jun 13, 2024
51e3f8b
mapped icon with acitvities
ohitsnathalie Jun 13, 2024
b4fc0fb
deleted unnecessary code
ohitsnathalie Jun 13, 2024
c0591e4
Update - added Will not attend
sofia32057 Jun 13, 2024
8367dc4
Update - smaller changes
sofia32057 Jun 13, 2024
1f078db
Update - added background color
sofia32057 Jun 13, 2024
0d85df5
Update - fixed console warning
sofia32057 Jun 13, 2024
0bf0070
Update - added message board stretch
sofia32057 Jun 13, 2024
4773f67
Update - smaller header padding
sofia32057 Jun 13, 2024
9bf30f1
Update - rsvp button in footer
sofia32057 Jun 13, 2024
6ec3468
aligned icons
ohitsnathalie Jun 13, 2024
7c818bd
changing images in slider to webp
ohitsnathalie Jun 13, 2024
6d48792
made venue content dryer
ohitsnathalie Jun 13, 2024
8b21b28
Update - hide rsvp before login
sofia32057 Jun 14, 2024
f585933
Merge branch 'main' of https://github.com/sofia32057/project-final
sofia32057 Jun 14, 2024
4dd5999
Update - changes to login page
sofia32057 Jun 14, 2024
39ddc8b
Bugfix - demo bug
sofia32057 Jun 14, 2024
fb6ce0a
Update - added redirect
sofia32057 Jun 14, 2024
72fb5ae
Update - fixed middleware auth to stop without auth too
sofia32057 Jun 15, 2024
41a117a
Update - redirect file and sloppy merge)
sofia32057 Jun 15, 2024
546ee7c
Update - menu close on click, redirect on logout and minor styling
sofia32057 Jun 15, 2024
17071b8
Update - merge header styling with sloppy merge
sofia32057 Jun 15, 2024
29ad4ca
Bug fix - typo in logout button
sofia32057 Jun 15, 2024
e197c75
Update - added guests block
sofia32057 Jun 15, 2024
fd00e9b
Update - bug fixed by removing select value
sofia32057 Jun 16, 2024
1422ee5
Update - added key to guest list items
sofia32057 Jun 16, 2024
5833b85
Update - added keys to guest list items
sofia32057 Jun 16, 2024
37c06a9
Update - attempt to fix bug with guests not loading on Netlify
sofia32057 Jun 16, 2024
1a18373
Update - fetch fixed + conditinals added to rsvp form
sofia32057 Jun 16, 2024
a0910e6
Update - smaller changes
sofia32057 Jun 16, 2024
4596ace
Update - Added My attendance, dropdown menu and changed to reusable h…
sofia32057 Jun 16, 2024
9d2ec40
Update - added plus ones to guest list component
sofia32057 Jun 17, 2024
d67e53b
added scrool to top button
ohitsnathalie Jun 19, 2024
33bfa22
added parallax banner
ohitsnathalie Jun 20, 2024
1b085da
styling of quote
ohitsnathalie Jun 20, 2024
2dc253f
change viewbox rounded corner
ohitsnathalie Jun 20, 2024
dae6670
added some text to readme
ohitsnathalie Jun 20, 2024
7207917
Update - styled input form
sofia32057 Jun 21, 2024
cde791e
Update - styling and conditional text
sofia32057 Jun 21, 2024
fc9af4c
Update - merge conflict styling
sofia32057 Jun 21, 2024
eb31568
Udate - smaller changes to fishtank and footer. Moved store folder to…
sofia32057 Jun 22, 2024
7e31f1c
Update - added readmes
sofia32057 Jun 22, 2024
f0c0229
Update - hide meny before login + added desc to scroll links
sofia32057 Jun 22, 2024
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
92 changes: 85 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,91 @@
# Final Project
# Final Project - Our wedding site

Replace this readme with your own information about your project.
## Project Description

Start by briefly describing the assignment in a sentence or two. Keep it short and to the point.
This is our final project for the Technigo Web development bootcamp, spring 2024.

## The problem
### What your application does

Describe how you approached to problem, and what tools and techniques you used to solve it. How did you plan? What technologies did you use? If you had more time, what would be next?
This project is a wedding RSVP website, that not only gives the couple the opportunity to provide all the information about the wedding for their guests, but allow for the guest to manage their RSVP and post messages to the couple. The guests have their own profile where they can see their RSVP.

## View it live
_The couple manage the guest list directly in the database._

Every project should be deployed somewhere. Be sure to include the link to the deployed project so that the viewer can click around and see what it's all about.
### How it works

Our wedding couple, Sarah and Michael, have worked hard and prepared their guest list in the database by including
_names,
emails,
how they know them (relations) and
if they are allowed to make a speech and/or bring a plus one_.

The guests, who recieved an invitation in the mail, use a QR code to find the site **Landing page** and logs in by using their email and the _invitation code_ written on the card. They are then redirected to the home page. In the background, when the guest log in, we check if their email exists in our database and if the code is correct. We then assign them a access token and save that, the guest ID and the logged in state to the local storage

On the **Home page** the guests can read all the information about the wedding, including a list of all the guest attending. The links in header scrolls down to the section they are interested in, or takes them to a new page such as the RSVP.

On the **RSVP page**, the guest can fill out the form to tell the couple if they are attending and what they would like to eat. If they are allowed to make a speech and/or bring a plus one, this is also included in the form. (We check this in the database, by looking up their guest ID and authenticating the access token in the request.) After they submit the form, the guest us redirected to a **Confirmation page** and the data is saved in the data base if the auth is OK.

From here, the guest can double check their RSVP in their **My Attendance** page, go to the **Message board page** to post a happy thought, or go back to read more information about the wedding.

### Some tech

We are using **React.js** with **Vite**, **Tailwind** and our own **Express.js** backend (see more in the backend README).

- **Zustand** - manages global states.
- **React Router** - handles page routing for an effective SPA.
- **React Router Hash Links** - are used for the scroll links.
- **React Lazily** - is used to lazy load named imports.
- **Moment** - is used for the time stamp on the message board.
- **React Scroll Parallax** - creates the effect on the image section.
- **React Scroll to top** - helped us with the scroll to top button.
- **React Slick** and **Slick Carousel** - is used for the carousel.
- **Headless UI** - gave us some ready made components and **Hero icons** - gave us the icons.

## How to Use the Project

To login on frontend and see the site on Netlify, use user *[email protected]* with invitation code **secretwedding**.

## MoSCoW

We prioritized our work as follows:

### Must have

- The site needs to show when and where the wedding takes place.
- It needs to allow for guests to log in, and hide information until they do.
- It needs to have functionality for guests to RSVP and to save the answer to the database.

### Should have

- It would be nice to have personalized (dynamic) data, where the RSVP form reflects if the guest is allowed to bring a plus one, or give a speech.
- More information, such as a carousel for available accomondations near by.
- A live guest list that reflects all guests who RSVP'd "yes".
- My attendance, a separate page where the guest see their data from the database.
- Message board, where the guest can post and read messages to the couple (and each other).

### Could have

- In next phase we would add dynamic public profiles for each guest, to read more about the other people attending. Would also include the possibility to upload profile pic and about text etc.
- Also, we are at this point using an external API for the message board. That would be included in the backend.
- We would add auth to every reload or navigation, to keep the access token fresh.
- We would add a timeout to the guest local storage, perhaps to session instead.

### Wont have

- This is a custom built website for this specific couple - not a "build your own wedding site" template. It will not have back office functionality, such as to upload/change content. This is managed in the code.
- Likewise, the guest list is managed in the database and the website will not include functionality to upload or handle the list client side.
Comment on lines +72 to +75

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Smart to include this in the readme 👍


## Collaborators & Credits

Big thanks to [Citronsskal](https://github.com/Citronskal) and [Trista1987](https://github.com/trista1987) for helping us with the idea and pitch.

Also a big THANK YOU to our helpful coaches, as well as our friends, family and coworkers who have provided invaluable insights, feedback and support.

## How to Install and Run the Project

1. Install the required dependencies using `npm install` in both frontend and backend folders.
2. Add `INVITATION_CODE=secretwedding` to your env.
3. Start the development server using `npm run dev` in both folders.

## See it live

Visit our wedding site at [https://project-wedding-site.netlify.app](https://project-wedding-site.netlify.app/)
58 changes: 56 additions & 2 deletions backend/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,62 @@
# Backend part of Final Project

This project includes the packages and babel setup for an express server, and is just meant to make things a little simpler to get up and running with.
This is the backend for our Wedding site.
We are using Express.js and Mongoose with a MongoDB.
Bcrypt is used for auth and dotenv for acessing the env file.

## Getting Started

1. Install the required dependencies using `npm install`.
2. Start the development server using `npm run dev`.
2. Start the development server using `npm run dev`.

## Endpoints and routes

### /

Se all REST API endpoints

### /login

Login to app by using email and password.
The password from the req is compared to the pre set invitation code set in the env.

### /auth

Runs authentication (middleware) by access token in DB and returns message if OK.

### /guests

Requires Authorization by accesstoken to run (middleware)

- .get: get all guests
- .post: post new guest

#### Example of guest

```
{
"firstname": "Judy",
"lastname": "Dench",
"email": "[email protected]",
"password": "",
"plusOne": {
"isAllowed": true,
"name": "Emma Thompson",
"foodChoice": "Fish"
},
"speech": {
"isAllowed": true,
"willMakeSpeech": true
},
"foodChoice": "Vegetarian",
"relation": "Sister of the bride",
"willAttend": true
}
```

### /guests/:guestId

Requires Authorization by accesstoken to run (middleware)

- .get: get guest by id
- .patch: update guest, primarily for RSVP
28 changes: 28 additions & 0 deletions backend/middlewares/auth.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { Guest } from "../models/GuestModel";

export const authenticateUser = async (req, res, next) => {
try {
if (req.header("Authorization")) {
const guest = await Guest.findOne({
accessToken: req.header("Authorization"),
});
if (guest) {
console.log("Auth OK");
next();
} else {
res.status(401).json({
message: "Authorization failed",
});
}
} else {
res.status(401).json({
message: "Authorization missing",
});
}
} catch (error) {
res.status(401).json({
message: "Authorization failed",
error: error,
});
}
};
53 changes: 53 additions & 0 deletions backend/models/GuestModel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import mongoose, { model } from "mongoose";
import bcrypt from "bcrypt";

// Mongoose model
export const Guest = model("Guest", {
accessToken: {
type: String,
default: () => bcrypt.genSaltSync(),
required: true,
},
firstname: {
type: String,
required: true,
},
lastname: {
type: String,
required: true,
},
email: {
type: String,
required: true,
unique: true,
},
password: {
type: String,
required: false,
},
willAttend: {
type: Boolean,
default: false,
},
plusOne: {
isAllowed: { type: Boolean, default: false },
name: { type: String },
foodChoice: { type: String },
},
speech: {
isAllowed: {
type: Boolean,
},
willMakeSpeech: {
type: Boolean,
default: false,
},
Comment on lines +37 to +44

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't update when I check the box, is it because I'm not allowed as a tester? Maybe you'd want to change that so testers can test everything 🤓

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should update! Must be a bug. We'll have a look and fix it :)

},
foodChoice: {
type: String,
},
relation: {
type: String,
required: true,
},
});
5 changes: 4 additions & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@
"@babel/core": "^7.17.9",
"@babel/node": "^7.16.8",
"@babel/preset-env": "^7.16.11",
"bcrypt": "^5.1.1",
"cors": "^2.8.5",
"dotenv": "^16.4.5",
"express": "^4.17.3",
"express-list-endpoints": "^7.1.0",
"mongoose": "^8.4.0",
"nodemon": "^3.0.1"
}
}
}
Loading