-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
282 changed files
with
5,727 additions
and
5,170 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Preview | ||
on: | ||
push: | ||
branches-ignore: | ||
- main | ||
env: | ||
NEXT_PUBLIC_SUPABASE_ANON_KEY: ${{ secrets.NEXT_PUBLIC_SUPABASE_ANON_KEY }} | ||
NEXT_PUBLIC_SUPABASE_PRO: ${{ secrets.NEXT_PUBLIC_SUPABASE_PRO }} | ||
NEXT_PUBLIC_SUPABASE_URL: ${{ secrets.NEXT_PUBLIC_SUPABASE_URL }} | ||
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }} | ||
SUPABASE_DB_PASSWORD_INLINE: ${{ secrets.SUPABASE_DB_PASSWORD }} | ||
SUPABASE_PROJECT_ID: ${{ secrets.SUPABASE_PROJECT_ID }} | ||
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | ||
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | ||
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} | ||
jobs: | ||
Deploy: | ||
runs-on: ubuntu-latest | ||
environment: Preview | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: oven-sh/setup-bun@v1 | ||
- run: bun i | ||
- run: bun vercel pull -y --environment=preview --token="$VERCEL_TOKEN" | ||
- run: bun supabase link --project-ref "$SUPABASE_PROJECT_ID" | ||
- run: bun db:start | ||
- run: bun db:types | ||
- run: bun next telemetry disable | ||
- run: bun vercel build | ||
- run: bun supabase db push --password "$SUPABASE_DB_PASSWORD_INLINE" | ||
- run: bun vercel deploy --prebuilt --token="$VERCEL_TOKEN" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ next-env.d.ts | |
node_modules/ | ||
supabase/.branches/ | ||
supabase/.temp/ | ||
.vercel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ next-env.d.ts | |
node_modules/ | ||
supabase/.branches/ | ||
supabase/.temp/ | ||
supabase/templates/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
# llog | ||
|
||
> The ultimate platform for behavior consultants. | ||
## Development Setup | ||
|
||
Install [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git), | ||
[Node](https://nodejs.org/en/download), [bun](https://bun.sh/docs/installation) and | ||
[Docker](https://docs.docker.com/engine/install), then: | ||
[Node](https://nodejs.org/en/download), [bun](https://bun.sh/docs/installation) | ||
and [Docker](https://docs.docker.com/engine/install), then: | ||
|
||
```shell | ||
git clone [email protected]:xvvvyz/llog.git | ||
|
@@ -47,27 +45,11 @@ bun db:diff -- migration-description | |
- Update email templates | ||
- Update url config | ||
- Add custom SMTP server | ||
- Enable realtime | ||
- Enable realtime (notifications) | ||
- Remove GraphQL api | ||
- Github environment secrets: | ||
- NEXT_PUBLIC_SUPABASE_ANON_KEY | ||
- NEXT_PUBLIC_SUPABASE_PRO | ||
- NEXT_PUBLIC_SUPABASE_URL | ||
- SUPABASE_DB_PASSWORD | ||
- SUPABASE_PROJECT_ID | ||
|
||
### Email Templates | ||
|
||
<!-- prettier-ignore --> | ||
```html | ||
Hello,<br><br>Here is the link: <a href="{{ .ConfirmationURL }}">reset your password</a>.<br><br>If you did not make this request, ignore this email.<br><br>Best,<br>The llog team<style>div{padding:0!important}#made-with-supabase{display:none!important}</style> | ||
``` | ||
|
||
<!-- prettier-ignore --> | ||
```html | ||
Hello,<br><br>Please <a href="{{ .ConfirmationURL }}">confirm your email address</a>.<br><br>If you did not sign up for llog, ignore this email.<br><br>Best,<br>The llog team<style>div{padding:0!important}#made-with-supabase{display:none!important}</style> | ||
``` | ||
|
||
<!-- prettier-ignore --> | ||
```html | ||
Hello,<br><br>Please <a href="{{ .ConfirmationURL }}">confirm your new email address</a>.<br><br>Best,<br>The llog team<style>div{padding:0!important}#made-with-supabase{display:none!important}</style> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import AccountForm from '@/_components/account-form'; | ||
import PageModal from '@/_components/page-modal'; | ||
import PageModalHeader from '@/_components/page-modal-header'; | ||
import getCurrentUserFromSession from '@/_queries/get-current-user-from-session'; | ||
import formatTitle from '@/_utilities/format-title'; | ||
import { notFound } from 'next/navigation'; | ||
|
||
export const metadata = { title: formatTitle('Account') }; | ||
|
||
const Page = async () => { | ||
const user = await getCurrentUserFromSession(); | ||
if (!user) notFound(); | ||
|
||
return ( | ||
<PageModal temporary_forcePath="/account"> | ||
<PageModalHeader title="Account settings" /> | ||
<AccountForm user={user} /> | ||
</PageModal> | ||
); | ||
}; | ||
|
||
export default Page; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const Default = () => null; | ||
|
||
export default Default; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
app/(pages)/(private)/@modals/inputs/create/from-input/[inputId]/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import InputForm from '@/_components/input-form'; | ||
import PageModal from '@/_components/page-modal'; | ||
import PageModalHeader from '@/_components/page-modal-header'; | ||
import getInput from '@/_queries/get-input'; | ||
import listSubjectsByTeamId from '@/_queries/list-subjects-by-team-id'; | ||
import formatTitle from '@/_utilities/format-title'; | ||
import { notFound } from 'next/navigation'; | ||
|
||
interface PageProps { | ||
params: { | ||
inputId: string; | ||
}; | ||
} | ||
|
||
export const metadata = { title: formatTitle(['Inputs', 'Create']) }; | ||
|
||
const Page = async ({ params: { inputId } }: PageProps) => { | ||
const [{ data: subjects }, { data: input }] = await Promise.all([ | ||
listSubjectsByTeamId(), | ||
getInput(inputId), | ||
]); | ||
|
||
if (!input || !subjects) notFound(); | ||
|
||
return ( | ||
<PageModal temporary_forcePath={`/inputs/create/from-input/${inputId}`}> | ||
<PageModalHeader title="Create input" /> | ||
<InputForm input={input} isDuplicate subjects={subjects} /> | ||
</PageModal> | ||
); | ||
}; | ||
|
||
export default Page; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import InputForm from '@/_components/input-form'; | ||
import PageModal from '@/_components/page-modal'; | ||
import PageModalHeader from '@/_components/page-modal-header'; | ||
import listSubjectsByTeamId from '@/_queries/list-subjects-by-team-id'; | ||
import formatTitle from '@/_utilities/format-title'; | ||
import { notFound } from 'next/navigation'; | ||
|
||
export const metadata = { title: formatTitle(['Inputs', 'Create']) }; | ||
|
||
const Page = async () => { | ||
const { data: subjects } = await listSubjectsByTeamId(); | ||
|
||
if (!subjects) notFound(); | ||
|
||
return ( | ||
<PageModal temporary_forcePath={`/inputs/create`}> | ||
<PageModalHeader title="Create input" /> | ||
<InputForm subjects={subjects} /> | ||
</PageModal> | ||
); | ||
}; | ||
|
||
export default Page; |
18 changes: 18 additions & 0 deletions
18
app/(pages)/(private)/@modals/notifications/archive/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import NotificationsPage from '@/_components/notifications-page'; | ||
import listNotifications from '@/_queries/list-notifications'; | ||
import formatTitle from '@/_utilities/format-title'; | ||
|
||
export const metadata = { title: formatTitle('Notifications archive') }; | ||
|
||
const Page = async () => { | ||
const { data: notifications } = await listNotifications({ archived: true }); | ||
|
||
return ( | ||
<NotificationsPage | ||
notifications={notifications} | ||
temporary_forcePath="/notifications/archive" | ||
/> | ||
); | ||
}; | ||
|
||
export default Page; |
18 changes: 18 additions & 0 deletions
18
app/(pages)/(private)/@modals/notifications/inbox/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import NotificationsPage from '@/_components/notifications-page'; | ||
import listNotifications from '@/_queries/list-notifications'; | ||
import formatTitle from '@/_utilities/format-title'; | ||
|
||
export const metadata = { title: formatTitle('Notifications inbox') }; | ||
|
||
const Page = async () => { | ||
const { data: notifications } = await listNotifications(); | ||
|
||
return ( | ||
<NotificationsPage | ||
notifications={notifications} | ||
temporary_forcePath="/notifications/inbox" | ||
/> | ||
); | ||
}; | ||
|
||
export default Page; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
app/(pages)/(private)/@modals/subjects/[subjectId]/event-types/[eventTypeId]/edit/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import EventTypeForm from '@/_components/event-type-form'; | ||
import PageModal from '@/_components/page-modal'; | ||
import PageModalHeader from '@/_components/page-modal-header'; | ||
import getEventTypeWithInputs from '@/_queries/get-event-type-with-inputs'; | ||
import getSubject from '@/_queries/get-subject'; | ||
import listInputsBySubjectId from '@/_queries/list-inputs-by-subject-id'; | ||
import listSubjectsByTeamId from '@/_queries/list-subjects-by-team-id'; | ||
import listTemplatesWithData from '@/_queries/list-templates-with-data'; | ||
import formatTitle from '@/_utilities/format-title'; | ||
import { notFound } from 'next/navigation'; | ||
|
||
interface PageProps { | ||
params: { | ||
eventTypeId: string; | ||
subjectId: string; | ||
}; | ||
} | ||
|
||
export const generateMetadata = async ({ | ||
params: { eventTypeId, subjectId }, | ||
}: PageProps) => { | ||
const [{ data: subject }, { data: eventType }] = await Promise.all([ | ||
getSubject(subjectId), | ||
getEventTypeWithInputs(eventTypeId), | ||
]); | ||
|
||
return { title: formatTitle([subject?.name, eventType?.name, 'Edit']) }; | ||
}; | ||
|
||
const Page = async ({ params: { eventTypeId, subjectId } }: PageProps) => { | ||
const [ | ||
{ data: subject }, | ||
{ data: eventType }, | ||
{ data: availableInputs }, | ||
{ data: availableTemplates }, | ||
{ data: subjects }, | ||
] = await Promise.all([ | ||
getSubject(subjectId), | ||
getEventTypeWithInputs(eventTypeId), | ||
listInputsBySubjectId(subjectId), | ||
listTemplatesWithData(), | ||
listSubjectsByTeamId(), | ||
]); | ||
|
||
if ( | ||
!subject || | ||
!eventType || | ||
!availableInputs || | ||
!availableTemplates || | ||
!subjects | ||
) { | ||
notFound(); | ||
} | ||
|
||
return ( | ||
<PageModal | ||
temporary_forcePath={`/subjects/${subjectId}/event-types/${eventTypeId}/edit`} | ||
> | ||
<PageModalHeader title={eventType.name as string} /> | ||
<EventTypeForm | ||
availableInputs={availableInputs} | ||
availableTemplates={availableTemplates} | ||
eventType={eventType} | ||
subjects={subjects} | ||
subjectId={subjectId} | ||
/> | ||
</PageModal> | ||
); | ||
}; | ||
|
||
export default Page; |
Oops, something went wrong.