Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
458 commits
Select commit Hold shift + click to select a range
ea1a364
edit email on contact
ssofiejohansson Aug 22, 2025
d76c9f8
moved logo into public
ssofiejohansson Aug 22, 2025
3a5813d
edit popup msg
ssofiejohansson Aug 23, 2025
df9151d
Package scheduled emails
oskarnordin Aug 23, 2025
21c70ec
Moved icons to public + error handling default logo
oskarnordin Aug 23, 2025
92723c4
Converted icons to .webp
oskarnordin Aug 23, 2025
fe5864d
Opt out from email functionality
oskarnordin Aug 24, 2025
ad86126
authenticateUser missing on POST /subscriptions.
solen80a Aug 25, 2025
f47b618
Fixed ariahidden bug on delete, still remain on edit inactive.
solen80a Aug 25, 2025
85c44b7
Merge branch 'sprops'
solen80a Aug 25, 2025
06fd230
Created an update to decrement freetrial down to 0. And adde it to t…
solen80a Aug 25, 2025
6fd0072
import of updatefreetrailroutes in server.js
solen80a Aug 25, 2025
81a39fe
Fixed issue with the import ending.
solen80a Aug 25, 2025
a6c4e4b
edit popup and contribution save. option for user to collape the popup
ssofiejohansson Aug 25, 2025
8c146fd
Updated to the correct enc secret.
solen80a Aug 25, 2025
72e0296
edit header text in dashboard depending if the user have subs or not
ssofiejohansson Aug 25, 2025
992e0b6
edit saving msg
ssofiejohansson Aug 25, 2025
4c05f49
Updated to correct field to update, trialDays.
solen80a Aug 25, 2025
70ce622
Added to uncheck freeTrial if trialdays becomes 0.
solen80a Aug 25, 2025
29edb0b
edit loader
ssofiejohansson Aug 25, 2025
fe94250
Merge branch 'main' into ui
ssofiejohansson Aug 25, 2025
3fddccc
Merge pull request #23 from ssofiejohansson/ui
ssofiejohansson Aug 25, 2025
6b3c127
Highlight when upcomming reminderdate, 7 days inc today.
solen80a Aug 25, 2025
5f15579
fixed mobile layout errors in sublist
ssofiejohansson Aug 25, 2025
e8ce108
Merge pull request #24 from ssofiejohansson/mobilelayout
ssofiejohansson Aug 25, 2025
6b5bd99
fixed mobile form layout error on scroll
ssofiejohansson Aug 25, 2025
d65ba34
mobile error layout
ssofiejohansson Aug 25, 2025
582c4c1
added test content
ssofiejohansson Aug 25, 2025
20e1802
Merge pull request #25 from ssofiejohansson/content
ssofiejohansson Aug 25, 2025
a3fc3d6
updated logo in colors
ssofiejohansson Aug 26, 2025
7c9bbba
added colors to tailwind
ssofiejohansson Aug 26, 2025
380ac6c
updated button in header
ssofiejohansson Aug 26, 2025
d519db9
edit error page and update m/p on app.jsx and user pages
ssofiejohansson Aug 26, 2025
8951990
changed btn colors and style
ssofiejohansson Aug 26, 2025
b060510
removed contactform updated button on home
ssofiejohansson Aug 26, 2025
f5d735e
edit text color
ssofiejohansson Aug 26, 2025
06ece2c
edit text colors
ssofiejohansson Aug 26, 2025
540a9cf
added smooth scroll
ssofiejohansson Aug 26, 2025
2932744
Chamged to 3 days. Added a highlighted message at the top to let the …
solen80a Aug 26, 2025
e7d8f99
updated colors
ssofiejohansson Aug 26, 2025
31d6abd
Merge branch 'spayments'
solen80a Aug 26, 2025
4707e21
Cleaned out some console loggs.
solen80a Aug 26, 2025
a18cf4d
edit popup messages and colors
ssofiejohansson Aug 26, 2025
4dee872
Merge pull request #26 from ssofiejohansson/colors
ssofiejohansson Aug 26, 2025
b098d20
edit Bell alert icon with upcoming payment
ssofiejohansson Aug 26, 2025
eff4bab
alert bett
ssofiejohansson Aug 26, 2025
cbc8e7f
Made color change to theme.
solen80a Aug 26, 2025
1ed9d2d
Merge branch 'main' of https://github.com/ssofiejohansson/project-final
solen80a Aug 26, 2025
50537ac
added text-text classname
ssofiejohansson Aug 26, 2025
a12d315
updated all main text to class text-text
ssofiejohansson Aug 26, 2025
e87a73f
Login + Sign Up Button
oskarnordin Aug 26, 2025
b0f98c9
added light grey as text-light on all components
ssofiejohansson Aug 26, 2025
4655c91
Update index.html
oskarnordin Aug 26, 2025
4fd938a
Merge branch 'main' of https://github.com/ssofiejohansson/project-final
oskarnordin Aug 26, 2025
a7d10a4
edit button/contact in footer
ssofiejohansson Aug 26, 2025
ccc2f0e
edit footer buttons
ssofiejohansson Aug 26, 2025
34cd438
edit links in about and home
ssofiejohansson Aug 26, 2025
1d508c9
Merge branch 'main' into colors
ssofiejohansson Aug 26, 2025
8d3ed24
Merge pull request #27 from ssofiejohansson/colors
ssofiejohansson Aug 26, 2025
f87f74a
Button styling
oskarnordin Aug 26, 2025
bf4aa99
Bee logo change test
oskarnordin Aug 26, 2025
c1271f8
Removed blue buttons footer
oskarnordin Aug 26, 2025
0100c1d
Changed back btn.jsx
oskarnordin Aug 26, 2025
93bbf36
cleaned up signup/login pages
ssofiejohansson Aug 26, 2025
eb4ee98
made navbar fixed in mobile
ssofiejohansson Aug 26, 2025
2de296e
edit h1-h5 for accessibility
ssofiejohansson Aug 26, 2025
c433727
added arialabel and disabled to make button more accessible
ssofiejohansson Aug 26, 2025
f3f4a5c
tried fixing the navbar in mobile
ssofiejohansson Aug 26, 2025
8149c63
fixed error from previous push in footer
ssofiejohansson Aug 26, 2025
a5ec691
Merge branch 'main' into colors
ssofiejohansson Aug 26, 2025
75b2946
Merge pull request #28 from ssofiejohansson/colors
ssofiejohansson Aug 26, 2025
59e8ea7
fixed building error
ssofiejohansson Aug 26, 2025
0c23ddd
changed back color on stats
ssofiejohansson Aug 26, 2025
ac3c89a
Cleaned unused code and fixed alt text.
solen80a Aug 27, 2025
b5f58d7
Added back import Bee2 from "/bee2.png";
solen80a Aug 27, 2025
d8e22da
Checkbox fix email. Cleande out console.loggs.
solen80a Aug 27, 2025
63dbdb9
removed console loggs
solen80a Aug 27, 2025
9673f96
Added suggestion on a more contrast freindly pink and light.
solen80a Aug 27, 2025
62692db
edit btn base
ssofiejohansson Aug 27, 2025
5936336
edit button on home
ssofiejohansson Aug 27, 2025
bee3c6a
added new logo
ssofiejohansson Aug 27, 2025
8ae831e
changed some text in sublist
ssofiejohansson Aug 27, 2025
f7c0f94
edit logo size
ssofiejohansson Aug 27, 2025
2a63166
Added text aboutsub
solen80a Aug 27, 2025
28ba451
edit footer btn
ssofiejohansson Aug 27, 2025
3f13343
Cleaned code from comments and unused code.
solen80a Aug 27, 2025
bd6515f
Updated text Project process.
solen80a Aug 27, 2025
2c9fd42
Updated text About this project.
solen80a Aug 27, 2025
4f84c02
Added prfile pic and linkedin.
solen80a Aug 27, 2025
a466136
edit btn outlined
ssofiejohansson Aug 27, 2025
5349ed5
Merge branch 'main' into designlayout
ssofiejohansson Aug 27, 2025
4a493fe
Merge pull request #29 from ssofiejohansson/designlayout
ssofiejohansson Aug 27, 2025
755dc83
Merge branch 'stexts'
solen80a Aug 27, 2025
add05eb
Update text
solen80a Aug 27, 2025
d8577c8
edit popup added animation
ssofiejohansson Aug 27, 2025
f244f90
added SubscriBee text in nav
ssofiejohansson Aug 27, 2025
369c2d7
added team.jsx to reuse
ssofiejohansson Aug 27, 2025
0906407
added text on loader
ssofiejohansson Aug 27, 2025
e2ee3c7
updated to new images on home
ssofiejohansson Aug 27, 2025
5e0f0bd
added img on about
ssofiejohansson Aug 27, 2025
540d319
Merge pull request #30 from ssofiejohansson/layoutedits
ssofiejohansson Aug 27, 2025
02b9692
images on guide fixes
ssofiejohansson Aug 27, 2025
bb1a68e
btn fix
ssofiejohansson Aug 27, 2025
8ba77c8
removed stats in dashboard if sublist is empty
ssofiejohansson Aug 27, 2025
5c61a64
png to webp
ssofiejohansson Aug 27, 2025
0db8ad5
updated logo as icon
ssofiejohansson Aug 27, 2025
d41b5d4
added test hero img
ssofiejohansson Aug 27, 2025
bcfef4f
edit hero
ssofiejohansson Aug 27, 2025
d9397b3
cleaned up code edit text
ssofiejohansson Aug 27, 2025
d088899
Merge pull request #31 from ssofiejohansson/layoutfix
ssofiejohansson Aug 27, 2025
90be21c
grammar check on text
ssofiejohansson Aug 27, 2025
7790942
Create Oskar.webp
oskarnordin Aug 27, 2025
539e394
added popup on dashboard
ssofiejohansson Aug 27, 2025
e8b3253
Merge branch 'main' of https://github.com/ssofiejohansson/project-final
ssofiejohansson Aug 27, 2025
17d01f6
edit img path
ssofiejohansson Aug 27, 2025
3b353f8
edit img path
ssofiejohansson Aug 27, 2025
0f099e6
added variant on btn in nav mob
ssofiejohansson Aug 28, 2025
4e7e91a
removed down arrow in dashboard
ssofiejohansson Aug 28, 2025
57f370b
edit btn
ssofiejohansson Aug 28, 2025
2671610
fixed navbar always, edit btns
ssofiejohansson Aug 28, 2025
47c556e
edit main color for better contrast
ssofiejohansson Aug 28, 2025
c817e80
Fixed back to top
solen80a Aug 28, 2025
954694e
Merge branch 'main' of https://github.com/ssofiejohansson/project-final
solen80a Aug 28, 2025
aa37acf
edit form layout
ssofiejohansson Aug 28, 2025
4896af3
edit colors and m/p in sections
ssofiejohansson Aug 28, 2025
15387c0
Merge pull request #32 from ssofiejohansson/lastedits
ssofiejohansson Aug 28, 2025
c6053ca
font + oskar linkedin
oskarnordin Aug 28, 2025
3e6b40f
Merge branch 'font-testing'
oskarnordin Aug 28, 2025
23b0eed
Fix stats syntax
oskarnordin Aug 28, 2025
931d20e
added meta desc
ssofiejohansson Aug 28, 2025
c3dc5a8
Removed double icons
oskarnordin Aug 28, 2025
c13f77f
changed hero img
ssofiejohansson Aug 28, 2025
3bb6430
Merge branch 'main' of https://github.com/ssofiejohansson/project-final
oskarnordin Aug 28, 2025
f8f3b4a
Fixed links and changed selection.
solen80a Aug 28, 2025
ca1bafc
added label to icon button
ssofiejohansson Aug 28, 2025
ec42b8e
png to webp
ssofiejohansson Aug 28, 2025
3e82918
fonts added
oskarnordin Aug 28, 2025
702e5a3
Merge branch 'main' of https://github.com/ssofiejohansson/project-final
oskarnordin Aug 28, 2025
41df88f
changed main color for contrast check
ssofiejohansson Aug 28, 2025
b8e15f4
Merge branch 'main' of https://github.com/ssofiejohansson/project-final
ssofiejohansson Aug 28, 2025
8140e25
added black for test
ssofiejohansson Aug 28, 2025
9f93885
change back to color orange
ssofiejohansson Aug 28, 2025
6c37c10
fixed stats text.
solen80a Aug 28, 2025
ffaa6a3
edit h1 text header
ssofiejohansson Aug 28, 2025
c9f6e06
edit save money msg
ssofiejohansson Aug 28, 2025
a97ba07
Merge branch 'main' of https://github.com/ssofiejohansson/project-final
ssofiejohansson Aug 28, 2025
d4a43da
edit pop up timer
ssofiejohansson Aug 28, 2025
92ca9c3
add emoji to popuo
ssofiejohansson Aug 28, 2025
ef07997
Hide join the hive and show dashboard instead, home/about.
solen80a Aug 28, 2025
48f38b8
Merge branch 'main' of https://github.com/ssofiejohansson/project-final
solen80a Aug 28, 2025
293f819
removed unnessesery code.
solen80a Aug 28, 2025
c2cada3
edit text in savemoney json
ssofiejohansson Aug 28, 2025
d6ac2ac
edit ADD btn m
ssofiejohansson Aug 28, 2025
a618705
Moved className to div from ul.
solen80a Aug 28, 2025
40b1246
Font fixes
oskarnordin Aug 28, 2025
f113c90
Merge branch 'main' of https://github.com/ssofiejohansson/project-final
oskarnordin Aug 28, 2025
6b96f58
edit popuo
ssofiejohansson Aug 28, 2025
2b6ae5b
Merge branch 'main' of https://github.com/ssofiejohansson/project-final
ssofiejohansson Aug 28, 2025
d5f9e87
changed back color in dashboard
ssofiejohansson Aug 28, 2025
54bd633
SubscriptionList Width fix
oskarnordin Aug 28, 2025
25b0e2a
Merge branch 'main' of https://github.com/ssofiejohansson/project-final
oskarnordin Aug 28, 2025
17a5376
popup on dash
ssofiejohansson Aug 28, 2025
0e8515a
Lighter hover Btn
oskarnordin Aug 28, 2025
4158769
popup timer edit
ssofiejohansson Aug 28, 2025
8452c12
Merge branch 'main' of https://github.com/ssofiejohansson/project-final
ssofiejohansson Aug 28, 2025
7264b80
Minus focus:ring-2
oskarnordin Aug 28, 2025
03d019e
Merge branch 'main' of https://github.com/ssofiejohansson/project-final
oskarnordin Aug 28, 2025
655c675
cleand up index.css
ssofiejohansson Aug 28, 2025
1356e11
merge
ssofiejohansson Aug 28, 2025
300ed18
Update Dashboard Header Font
oskarnordin Aug 28, 2025
98471f5
Merge branch 'main' of https://github.com/ssofiejohansson/project-final
oskarnordin Aug 28, 2025
d7769f7
Footer font fix
oskarnordin Aug 28, 2025
02c1d52
Navbar font consistency
oskarnordin Aug 28, 2025
2cd74e6
Wrapped navitem in <li>
solen80a Aug 28, 2025
ecc0a4e
revert res change.
solen80a Aug 28, 2025
d6f7aad
updated beeatrice mg
ssofiejohansson Aug 28, 2025
77714d8
Merge branch 'main' of https://github.com/ssofiejohansson/project-final
ssofiejohansson Aug 28, 2025
ea5679d
Width fix
oskarnordin Aug 28, 2025
cb02705
Merge branch 'main' of https://github.com/ssofiejohansson/project-final
oskarnordin Aug 28, 2025
a2b4bcd
Navbar icon font fix
oskarnordin Aug 28, 2025
f93a895
Fixed ul li in navbar.
solen80a Aug 28, 2025
dc19387
edit about proj
ssofiejohansson Aug 28, 2025
7a5e163
edit about proj
ssofiejohansson Aug 28, 2025
7430cbf
Add button to sm
oskarnordin Aug 28, 2025
11cfead
Merge branch 'main' of https://github.com/ssofiejohansson/project-final
oskarnordin Aug 28, 2025
cd81c93
Changed text in reminder email.
solen80a Aug 28, 2025
c64d3a0
Merge branch 'main' of https://github.com/ssofiejohansson/project-final
solen80a Aug 28, 2025
daf437a
Chnaged email text in the correct place.
solen80a Aug 28, 2025
28fe17e
fixed link style in text
ssofiejohansson Aug 28, 2025
c105cd4
merge
ssofiejohansson Aug 28, 2025
dfc7ac3
changed text color for accessibility
ssofiejohansson Aug 28, 2025
1aaede8
edit btn color
ssofiejohansson Aug 28, 2025
03e3ef7
button fix
ssofiejohansson Aug 28, 2025
3520570
moved btn in nav
ssofiejohansson Aug 28, 2025
17af185
accessibility fix
ssofiejohansson Aug 28, 2025
dc25810
edits to dashboard
ssofiejohansson Aug 28, 2025
236b018
edit btn
ssofiejohansson Aug 28, 2025
20a29ff
changed to black color
ssofiejohansson Aug 28, 2025
a11417f
completely lost our minds over contrast
ssofiejohansson Aug 28, 2025
1e72714
Fixed ul li item.
solen80a Aug 28, 2025
cfc52fa
Merge branch 'main' of https://github.com/ssofiejohansson/project-final
solen80a Aug 28, 2025
15ed8f3
Fixed style
solen80a Aug 28, 2025
d686233
changed back colors
ssofiejohansson Aug 28, 2025
36ea32c
Added save messages.
solen80a Aug 29, 2025
2de2cae
Merge branch 'sfixes'
solen80a Aug 29, 2025
668cc9f
Fixed ul li issue showing in lighthouse.
solen80a Aug 29, 2025
5b449ee
Moved comp to utils. Changed colors, main and accent. Fixed btn accor…
solen80a Aug 29, 2025
60574ef
Added content to readme frontend/backend. Changed color on linegraph.…
solen80a Aug 29, 2025
f5979dc
Fixed accessibility icon name. Adde aria-label to link - scroll down.…
solen80a Aug 29, 2025
c3d3327
added new bee logo for buzzing on loader
ssofiejohansson Aug 30, 2025
8389083
made sure colorcodes match on dashboard in stats and categories
ssofiejohansson Aug 30, 2025
b7ad2a6
resize team images to 200x200
ssofiejohansson Aug 30, 2025
e2c9929
resize logos to correct size
ssofiejohansson Aug 30, 2025
068fa1c
made sure text are same size
ssofiejohansson Aug 30, 2025
0fc1eb1
added updated images for home and about
ssofiejohansson Aug 30, 2025
57a80ae
edit tech stack link
ssofiejohansson Aug 30, 2025
1fe7355
edit image alt text on Guide
ssofiejohansson Aug 30, 2025
e098ba5
added backup font to tailwind
ssofiejohansson Aug 30, 2025
8fb6d0a
edit font on navbar mobile to match desktop
ssofiejohansson Aug 30, 2025
4dfe401
edit btn slightly with size and hover
ssofiejohansson Aug 30, 2025
eee6bb1
removed space
ssofiejohansson Aug 30, 2025
e2c7a0b
Merge pull request #33 from ssofiejohansson/lastdayfixes
ssofiejohansson Aug 30, 2025
a920cbd
Created and added contact email.
solen80a Aug 30, 2025
a42b5df
Removed unused code. Changed getLogoPath to an arrow function.
solen80a Aug 30, 2025
d7b4e64
Added contact email to navbar.
solen80a Aug 30, 2025
2258489
Fixed so the close button is visable on smallest mobile screens.
solen80a Aug 30, 2025
95e8d65
Made tech stack even smaller.
solen80a Aug 30, 2025
222b233
Removed non used fonts
oskarnordin Aug 30, 2025
49e939a
Changed from export default to named export
oskarnordin Aug 30, 2025
e9355f8
email edit bug fix
oskarnordin Aug 31, 2025
1edbc85
Add sub bug fix
oskarnordin Aug 31, 2025
a3e1496
Remove scheduled mail when sub del
oskarnordin Aug 31, 2025
15f3fc5
Sub add unchecked email box bug fix
oskarnordin Aug 31, 2025
9b36a6b
Scheduled email sub del fix 2
oskarnordin Aug 31, 2025
1a62f39
minor fixes to increase performance: img size, variant h4, lazy loading
ssofiejohansson Aug 31, 2025
d513d82
edit alt text on about proj
ssofiejohansson Aug 31, 2025
0c162af
lastdayfix
ssofiejohansson Aug 31, 2025
87435b7
Merge branch 'main' into performancefix
ssofiejohansson Aug 31, 2025
806e89e
Merge pull request #34 from ssofiejohansson/performancefix
ssofiejohansson Aug 31, 2025
300400b
edit img size for better quality
ssofiejohansson Aug 31, 2025
2ed8405
Email checkbox bug fix
oskarnordin Aug 31, 2025
c66fcc5
fixed font. removed poppins. using standard tailwind
ssofiejohansson Aug 31, 2025
05c8d3d
Merge pull request #35 from ssofiejohansson/email-bug-fix
oskarnordin Aug 31, 2025
ed5e192
Changed back to export default router. Added to mongoEmailScheduler.js,
solen80a Sep 1, 2025
58d85a3
Cleaned comment and unused code. Removed duplicate .yml. Moved mongoE…
solen80a Sep 1, 2025
8a119c7
Added back, handleSubscriptionAdded.
solen80a Sep 1, 2025
6147fb1
Fixed add sub, checked email. Fixed savedilaog to popup when delete.
solen80a Sep 1, 2025
5ce9df2
Cleaned out unused code.
solen80a Sep 1, 2025
0cd3ad0
Updated a common README and deleted the once under frontend and back…
solen80a Sep 4, 2025
bef09bf
refactor changes class to function
oskarnordin Oct 30, 2025
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
  •  
  •  
  •  
24 changes: 24 additions & 0 deletions .github/workflows/update-reminders-freetrial.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Update Reminder Dates - Free Trial

on:
schedule:
- cron: "0 0 * * *" # every midnight UTC
workflow_dispatch: # allows you to run it manually from GitHub UI

jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Call backend to update reminder dates
run: |
curl -v --http1.1 -X PATCH "https://project-final-xhjy.onrender.com/date/update-reminders" \
-H "Authorization: ${{ secrets.API_SECRET }}" \
-H "Content-Type: application/json"

- name: Call backend to decrement freeTrial
run: |
curl -v --http1.1 -X PATCH "https://project-final-xhjy.onrender.com/freetrial/update-freetrial" \
-H "Authorization: ${{ secrets.API_SECRET }}" \
-H "Content-Type: application/json"


20 changes: 20 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Start Backend Server",
"type": "shell",
"command": "npm",
"args": [
"run",
"dev"
],
"group": "build",
"isBackground": true,
"options": {
"cwd": "${workspaceFolder}/backend"
},
"problemMatcher": []
}
]
}
File renamed without changes.
89 changes: 83 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,90 @@
# Final Project
# Welcome to SubscriBee
![Beeatrice the bee](https://subscribee-project.netlify.app/subscribee-logo.webp)

Replace this readme with your own information about your project.
A project by Oskar Nordin, Sofie Johansson & Sofia Lennbom

Start by briefly describing the assignment in a sentence or two. Keep it short and to the point.
## The problem:

## The problem
People tend to forget which subscriptions they have and what the fee is and keep paying for them despite not using them.

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?
## Describe how you approached the problem, and what tools and techniques you used to solve it:

To solve the problem, we created an application where the user can add all their subscriptions and display them on a dashboard.

### The dashboard show:
- Quantity
- Monthly and yearly cost
- Subscription category
- Status: active or inactive
- Free trial and trial days, with count down
- Line graph of costs by month
- Reminder for the next upcoming 3 days
- Filtering by category
- Sort by name, cost, reminder date and status

### Other features
- The user can choose to get notifications by email on the set reminder date
- When a subscription gets cancelled or change status to inactive, Beeatrice the bee notifies the user
- She lets the user know how much the yearly save is and what they can spend the money on instead

## How did you plan?

- Daily standups for motivation and keep everyone on track.
- A board with tasks in Notion to get an overview.
- We decided early to focus on getting all the functionality running before we added any styling.

## What technologies did you use?

### Frontend
- Core: HTML5, JavaScript (ES6+), React
- Build Tool: Vite
- Styling: Tailwind CSS, with Material Tailwind for UI components
- Routing: React Router
- State Management: Zustand
- Data Visualization: ApexCharts for graphs and charts
- Icons: Heroicons

### Backend
- Core: Node.js, Express.js
- Database: MongoDB with Mongoose as the ODM
- Email Service: Nodemailer for sending emails
- Task Scheduling: node-cron for recurring tasks
- Authentication: Custom token-based authentication middleware

## Tooling & Deployment
- Version Control: Git
- Automation: GitHub Actions (workflow automation via .yml pipelines for tasks such as database updates)
- Hosting: Frontend on Netlify, Backend on Render

## If you had more time, what would be next?
- An admin page to get an overview of and handle scheduled emails, users etc
- Expand the focus on contribution to choose from different charity organisations

## View it live
https://subscribee-project.netlify.app/

## Dependencies
### Frontend
- npm i heroicons
- npm i @material-tailwind/react
- npm i apexcharts
- npm i react-apexcharts
- npm i express-list-routes
- npm i framer-motion
- npm i lodash
- npm i react-router-hash-link
- npm i zustand
- npm install -D tailwindcss@3
- npx tailwindcss init

### Backend
- npm i nodemailer
- npm i nodemon
- npm i nodecron
- npm i mongoose
- npm i dotenv
- npm i bcrypt

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 to install & run
- npm i
- npm run dev
8 changes: 0 additions & 8 deletions backend/README.md

This file was deleted.

23 changes: 23 additions & 0 deletions backend/authMiddleware.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { User } from "./models/User.js"

export const authenticateUser = async (req, res, next) => {
try {
const user = await User.findOne({
accessToken: req.header("Authorization"),
})
if (user) {
req.user = user
next();
} else {
res.status(401).json({
message: "Authentication missing or invalid",
loggedOut: true,
})
}
} catch (error) {
res.status(500).json({
message: "Internal server error", error: err.message
})
}
}

55 changes: 55 additions & 0 deletions backend/models/ScheduledEmail.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import mongoose from 'mongoose';

const scheduledEmailSchema = new mongoose.Schema(
{
to: {
type: String,
required: true,
},
subject: {
type: String,
required: true,
},
text: {
type: String,
required: true,
},
scheduledDateTime: {
type: Date,
required: true,
},
isRecurring: {
type: Boolean,
default: false,
},
status: {
type: String,
enum: ['scheduled', 'sent', 'failed'],
default: 'scheduled',
},
lastSent: {
type: Date,
},
nextRun: {
type: Date,
},
attempts: {
type: Number,
default: 0,
},
errorMessage: {
type: String,
},
},
{
timestamps: true,
}
);

// Index for efficient querying of due emails
scheduledEmailSchema.index({ nextRun: 1, status: 1 });

export const ScheduledEmail = mongoose.model(
'ScheduledEmail',
scheduledEmailSchema
);
55 changes: 55 additions & 0 deletions backend/models/Subscription.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import mongoose from 'mongoose';

const subscriptionSchema = new mongoose.Schema({
name: {
type: String,
required: true,
minlength: 3,
maxlength: 100,
},
cost: {
type: Number,
required: true,
min: 0,
},
freeTrial: {
type: Boolean,
default: false,
},
//days of free trial
trialDays: {
type: Number,
minlength: 0,
},
//Next remider email
reminderDate: {
type: Date,
required: true,
},
status: {
type: String,
enum: ['active', 'inactive'],
default: 'active',
required: true,
},
category: {
type: String,
enum: ['Entertainment', 'Food', 'Health', 'Learning', 'Other'],
required: true,
},
createdAt: {
type: Date,
default: Date.now,
},
user: {
type: mongoose.Schema.Types.ObjectId,
ref: 'User',
required: true,
},
sendEmail: {
type: Boolean,
default: true,
},
});

export const Subscription = mongoose.model('Subscription', subscriptionSchema);
30 changes: 30 additions & 0 deletions backend/models/User.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import crypto from "crypto"
import mongoose from "mongoose"

const userSchema = new mongoose.Schema({
name: {
type: String,
required: true,
minlength: 3,
maxlength: 100
},
email: {
type: String,
required: true,
unique: true,
minlength: 5,
maxlength: 100,
},
password: {
type: String,
required: true,
minlength: 3,
maxlength: 100,
},
accessToken: {
type: String,
default: () => crypto.randomBytes(128).toString("hex")
}
})

export const User = mongoose.model("User", userSchema)
11 changes: 9 additions & 2 deletions backend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "project-final-backend",
"version": "1.0.0",
"type": "module",
"description": "Server part of final project",
"scripts": {
"start": "babel-node server.js",
Expand All @@ -12,9 +13,15 @@
"@babel/core": "^7.17.9",
"@babel/node": "^7.16.8",
"@babel/preset-env": "^7.16.11",
"bcrypt": "^6.0.0",
"cors": "^2.8.5",
"dotenv": "^17.2.1",
"express": "^4.17.3",
"mongoose": "^8.4.0",
"express-list-endpoints": "^7.1.1",
"lodash": "^4.17.21",
"mongoose": "^8.17.0",
"node-cron": "^3.0.3",
"nodemailer": "^7.0.5",
"nodemon": "^3.0.1"
}
}
}
Loading