Skip to content

Commit

Permalink
Merge branch 'main' into reduce-app
Browse files Browse the repository at this point in the history
  • Loading branch information
JHWelch authored Oct 10, 2024
2 parents be68a65 + 0d3d4dc commit c9af5e7
Show file tree
Hide file tree
Showing 13 changed files with 90 additions and 96 deletions.
24 changes: 13 additions & 11 deletions client/src/utilities/confetti.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,19 @@ export const fireConfetti = () => {

jsConfetti.addConfetti({
emojis: [
'👏',
'🙌',
'🎉',
'🪩',
'🎊',
'🪅',
'🪄',
'✨',
'🌟',
'🎇',
'🎆',
'💀',
'🍁',
'🎃',
'🦇',
'🧛',
'🔮',
'👻',
'🧙',
'🕷',
'🕸',
'🦉',
'🌙',
'🧟',
],
})
}
85 changes: 64 additions & 21 deletions server/package-lock.json

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

4 changes: 2 additions & 2 deletions server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
"dependencies": {
"@jhwelch/made-with": "^0.0.3",
"@notionhq/client": "^2.2.5",
"@types/express": "^4.17.17",
"@types/node": "^20.0.0",
"body-parser": "^1.20.2",
"dotenv": "^16.0.3",
"ejs": "^3.1.10",
Expand All @@ -41,7 +39,9 @@
"devDependencies": {
"@jest-mock/express": "^2.0.2",
"@jest/globals": "^29.5.0",
"@types/express": "^5.0.0",
"@types/luxon": "^3.4.2",
"@types/node": "^22.7.5",
"jest": "^29.5.0",
"mockdate": "^3.0.5",
"nodemon": "^3.0.1",
Expand Down
5 changes: 0 additions & 5 deletions server/src/controllers/cacheController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ import { Week } from '@server/models/week'
import { minutesAsTimeString, timeStringAsMinutes } from '@server/helpers/timeStrings'

export default class CacheController {
static PATHS = {
weeks: '/api/cache/weeks',
emailTemplates: '/api/cache/email-templates',
}

constructor (
private firestore: FirestoreAdapter,
private notionAdapter: NotionAdapter,
Expand Down
2 changes: 0 additions & 2 deletions server/src/controllers/calendarController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import { Request, Response } from 'express'
import Config from '@server/config/config'

export default class CalendarController {
static PATH = '/calendar'

constructor (
private config: Config,
) {}
Expand Down
4 changes: 0 additions & 4 deletions server/src/controllers/cronController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ import Config from '@server/config/config'
import { tomorrow } from '@server/data/dateUtils'

class CronController {
static PATHS = {
reminders: '/cron/reminders',
}

constructor (
protected config: Config,
protected firestore: FirestoreAdapter,
Expand Down
4 changes: 0 additions & 4 deletions server/src/controllers/healthCheckController.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import { type Request, type Response } from 'express'

export default class HealthCheckController {
static PATHS = {
index: '/health_check',
}

static async index (_req: Request, res: Response): Promise<void> {
res.status(200).send('ok')
}
Expand Down
4 changes: 0 additions & 4 deletions server/src/controllers/rsvpController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ import { validate } from '@server/helpers/validation'
import { Week } from '@server/models/week'

export default class RsvpController {
static PATHS = {
store: '/api/weeks/:weekId/rsvp',
}

constructor (
private firestore: FirestoreAdapter,
) {}
Expand Down
5 changes: 0 additions & 5 deletions server/src/controllers/subscriptionController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ import { validate } from '@server/helpers/validation'
import { withMessage } from '@server/helpers/messageBuilder'

export default class SubscriptionController {
static PATHS = {
store: '/api/subscriptions',
destroy: '/unsubscribe',
}

static readonly SUCCESS_MESSAGE = {
message: 'Thank you for signing up! See you soon.',
}
Expand Down
4 changes: 0 additions & 4 deletions server/src/controllers/suggestionController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ export default class SuggestionController {
private notion: NotionAdapter,
) {}

static PATHS = {
store: '/suggestions',
}

store = async (req: Request, res: Response): Promise<void> => {
if (!this.validate(req, res)) return

Expand Down
4 changes: 0 additions & 4 deletions server/src/controllers/weekEventController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ import FirestoreAdapter from '@server/data/firestore/firestoreAdapter'
import { icalGenerator } from '@server/data/icalGenerator'

export default class WeekEventController {
static PATHS = {
show: '/weeks/:weekId/event',
}

constructor (
private firestore: FirestoreAdapter,
) {}
Expand Down
4 changes: 1 addition & 3 deletions server/src/models/user.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { DocumentData, QueryDocumentSnapshot } from 'firebase/firestore'
import SubscriptionController from '@server/controllers/subscriptionController'

export default class User {
constructor (
Expand All @@ -21,6 +20,5 @@ export default class User {
reminders: this.reminders,
})

unsubscribeUrl = (): string =>
SubscriptionController.PATHS.destroy + `?token=${this.id}`
unsubscribeUrl = (): string => `/unsubscribe?token=${this.id}`
}
37 changes: 10 additions & 27 deletions server/src/routers/appRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,33 +55,16 @@ function routes (
const weekEventController = new WeekEventController(firestore)

return [
new Route(HealthCheckController.PATHS.index, HealthCheckController.index),
new Route('/health_check', HealthCheckController.index),
new Route('/api/weeks', weekController.index),
new Route(RsvpController.PATHS.store, rsvpController.store, HttpVerb.POST),
new Route(CacheController.PATHS.weeks, cacheController.cacheWeeks),
new Route(
CacheController.PATHS.emailTemplates,
cacheController.cacheEmailTemplates,
),
new Route(
SuggestionController.PATHS.store,
suggestionController.store,
HttpVerb.POST,
),
new Route(
CalendarController.PATH,
calendarController.index,
),
new Route(
SubscriptionController.PATHS.store,
subscriptionController.store,
HttpVerb.POST,
),
new Route(
SubscriptionController.PATHS.destroy,
subscriptionController.destroy,
),
new Route(CronController.PATHS.reminders, cronController.reminders),
new Route(WeekEventController.PATHS.show, weekEventController.show),
new Route('/api/weeks/:weekId/rsvp', rsvpController.store, HttpVerb.POST),
new Route('/api/cache/weeks', cacheController.cacheWeeks),
new Route('/api/cache/email-templates', cacheController.cacheEmailTemplates),
new Route('/suggestions', suggestionController.store, HttpVerb.POST),
new Route('/calendar', calendarController.index),
new Route('/api/subscriptions', subscriptionController.store, HttpVerb.POST),
new Route('/unsubscribe', subscriptionController.destroy),
new Route('/cron/reminders', cronController.reminders),
new Route('/weeks/:weekId/event', weekEventController.show),
]
}

0 comments on commit c9af5e7

Please sign in to comment.