Skip to content
This repository has been archived by the owner on Feb 5, 2023. It is now read-only.

feat: contact profile page #48

Closed
wants to merge 48 commits into from
Closed
Show file tree
Hide file tree
Changes from 47 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
ef8695a
chore(global): :hammer: debug config
JoeKarow Jun 19, 2022
08a6490
chore(web): :hammer: prisma seed instruction
JoeKarow Jun 19, 2022
62c8693
chore(web): :hammer: prisma seed script
JoeKarow Jun 19, 2022
e3b7169
chore(web): :hammer: prisma schema building
JoeKarow Jun 19, 2022
3b96293
feat(ui): :sparkles: getProviders hook for login button
JoeKarow Jun 19, 2022
5f0ade0
feat(ui): :sparkles: make UserButton dynamic based off session status
JoeKarow Jun 19, 2022
df82bb4
refactor(ui): :recycle: use UserButton in main page header
JoeKarow Jun 19, 2022
764b8e3
chore(web): :hammer: install zod for validation
JoeKarow Jun 19, 2022
0e572ec
chore(web): :hammer: generate zod schemas
JoeKarow Jun 19, 2022
eb24f7f
feat(web): :sparkles: start profile page & api call
JoeKarow Jun 19, 2022
9cd5eda
chore(web): :hammer: create fake db seed generator
JoeKarow Jun 20, 2022
c94d189
chore(web): :hammer: db schema updates
JoeKarow Jun 21, 2022
297a333
refactor(web): :recycle: nextauth signin
JoeKarow Jun 21, 2022
23f6041
refactor(web,lib): :recycle: move prisma client to netwerkr-lib package
JoeKarow Jun 21, 2022
cf50142
Merge develop into JoeKarow/47-feat-Contact-Profile-Page
github-actions[bot] Jun 21, 2022
c7ce4eb
refactor(web): :recycle: profile page from api -> getServerSideProps
JoeKarow Jun 22, 2022
4b71390
chore(lib): :hammer: index file generation
JoeKarow Jun 22, 2022
a513f4e
feat(lib): :sparkles: prisma data transformation
JoeKarow Jun 22, 2022
9f90de0
refactor(ui): :recycle: removed some prop drilling for session params
JoeKarow Jun 22, 2022
dc9a657
feat(lib): :sparkles: getter - basic contact info
JoeKarow Jun 22, 2022
d176507
Merge develop into JoeKarow/47-feat-Contact-Profile-Page
github-actions[bot] Jun 22, 2022
f887403
Merge develop into JoeKarow/47-feat-Contact-Profile-Page
github-actions[bot] Jun 22, 2022
41f9a75
chore(global): :hammer: stop yelling, eslint. You can find next/babel!
JoeKarow Jun 22, 2022
21fd355
chore(global): :hammer: added: luxon; cross-installed other deps
JoeKarow Jun 22, 2022
ed38f48
chore(lib): :hammer: schema updates - relation/optional fields
JoeKarow Jun 22, 2022
87c8f5d
feat(ui): :sparkles: janky devtools - json viewer component
JoeKarow Jun 22, 2022
da4c1b3
refactor(lib): :recycle: contact getter & DateTime -> string converter
JoeKarow Jun 22, 2022
ea731ee
feat(ui): :sparkles: start of contact profile display
JoeKarow Jun 22, 2022
dcbd6c3
Merge develop into JoeKarow/47-feat-Contact-Profile-Page
github-actions[bot] Jun 22, 2022
df64604
Merge develop into JoeKarow/47-feat-Contact-Profile-Page
github-actions[bot] Jun 22, 2022
2ce6b22
Merge develop into JoeKarow/47-feat-Contact-Profile-Page
github-actions[bot] Jun 22, 2022
5839c27
fix(global): :bug: correct boolean on todo workflow
JoeKarow Jun 22, 2022
25ce688
Merge remote-tracking branch 'origin/JoeKarow/47-feat-Contact-Profile…
JoeKarow Jun 22, 2022
73595cd
chore(global): :hammer: update min node ver
JoeKarow Jun 22, 2022
b97fd0d
build(global): :package: set up semantic-release
JoeKarow Jun 23, 2022
d824af7
Merge develop into JoeKarow/47-feat-Contact-Profile-Page
github-actions[bot] Jun 23, 2022
a27342d
Merge develop into JoeKarow/47-feat-Contact-Profile-Page
github-actions[bot] Jun 23, 2022
26cfce7
Merge develop into JoeKarow/47-feat-Contact-Profile-Page
github-actions[bot] Jun 23, 2022
58e5071
Merge branch 'develop' into JoeKarow/47-feat-Contact-Profile-Page
kodiakhq[bot] Jun 23, 2022
cc751dc
Merge branch 'develop' into JoeKarow/47-feat-Contact-Profile-Page
kodiakhq[bot] Jun 24, 2022
8e992f5
build(global): :package: uninstall semantic release
JoeKarow Jun 24, 2022
329a920
Merge branch 'develop' into JoeKarow/47-feat-Contact-Profile-Page
kodiakhq[bot] Jun 24, 2022
7b14933
Merge branch 'develop' into JoeKarow/47-feat-Contact-Profile-Page
kodiakhq[bot] Jun 24, 2022
8022d5f
Merge branch 'develop' into JoeKarow/47-feat-Contact-Profile-Page
JoeKarow Jun 24, 2022
db32c73
Merge branch 'develop' into JoeKarow/47-feat-Contact-Profile-Page
kodiakhq[bot] Jun 24, 2022
660726f
chore(global): :hammer: remove docs pkg
JoeKarow Jun 24, 2022
f1fbadc
chore(global): :hammer: update lock
JoeKarow Jun 24, 2022
4019082
chore(global): :hammer: update lock file
JoeKarow Jun 26, 2022
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
4 changes: 2 additions & 2 deletions .github/workflows/issues-from-TODO-comments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:
inputs:
importAll:
default: 'false'
default: false
required: false
type: boolean
description: Enable, if you want to import all TODOs. Runs on checked out branch! Only use if you're sure what you are doing.
Expand All @@ -27,6 +27,6 @@ jobs:
- name: Run Issue Bot
uses: derjuulsn/todo-issue@main
with:
excludePattern: '^(node_modules/)'
excludePattern: "^(node_modules/)"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45 changes: 45 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Release
on:
push:
branches:
- main
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "lts/*"
- uses: pnpm/action-setup@v2.0.1
name: Install pnpm
id: pnpm-install
with:
version: 7
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install

- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
run: pnpx semantic-release
70 changes: 44 additions & 26 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,41 +1,59 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Next.js: debug server-side",
"name": "Next.js: app:web",
"type": "node-terminal",
"request": "launch",
"command": "pnpm dev"
"command": "pnpx turbo run dev --filter '!*docs'",
// "cwd": "${workspaceFolder:✨ @joekarow/netwerkr}",
"sourceMaps": true,
},
{
"name": "Next.js: debug client-side",
"type": "firefox",
"request": "launch",
"type": "chrome",
"runtimeExecutable": "/Applications/Brave Browser.app/Contents/MacOS/Brave Browser",
// "runtimeArgs": ["--remote-debugging-port=9222"],
"port": 9222,
"reAttach": true,
"name": "Launch Firefox Dev",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}",
"outFiles": [
"${workspaceFolder}/**/*.js",
"!**/node_modules/**"
"webRoot": "${workspaceFolder:🚀 @joekarow/netwerkr-web}/",
"enableCRAWorkaround": true,
"skipFiles": [
"**/node_modules/**",
"<node_internals>/**/*.js"
],
"showConsoleCallLocation": true,
"suggestPathMappingWizard": true,
"pathMappings": [
{
"url": "webpack://_n_e/packages",
"path": "${workspaceFolder}/packages"
}
]
},
// {
// "name": "Next.js: debug web",
// "request": "launch",
// "type": "chrome",
// "runtimeExecutable": "/Applications/Brave Browser.app/Contents/MacOS/Brave Browser",
// "port": 9222,
// "url": "http://localhost:3000",
// "cwd": "${workspaceFolder:🚀 @joekarow/netwerkr-web}",
// "webRoot": "${workspaceFolder:🚀 @joekarow/netwerkr-web}/",
// "sourceMaps": true,
// "resolveSourceMapLocations": [
// "${webRoot}",
// "${workspaceFolder}",
// "!node_modules"
// ]
// },
],
"compounds": [
{
"name": "Next.js: debug full stack",
"type": "node-terminal",
"request": "launch",
"command": "pnpm run dev",
"outputCapture": "std",
// "console": "integratedTerminal",
"serverReadyAction": {
"pattern": "started server on .+, url: (https?://.+)",
"action": "startDebugging",
"name": "Next.js: debug client-side",
}
"name": "Debug netwerkr w/ Firefox Dev",
"configurations": [
"Next.js: app:web",
"Launch Firefox Dev"
],
"stopAll": true
}
]
}
4 changes: 0 additions & 4 deletions apps/docs/.eslintrc.js

This file was deleted.

10 changes: 0 additions & 10 deletions apps/docs/.lintstagedrc.js

This file was deleted.

30 changes: 0 additions & 30 deletions apps/docs/README.md

This file was deleted.

5 changes: 0 additions & 5 deletions apps/docs/next-env.d.ts

This file was deleted.

5 changes: 0 additions & 5 deletions apps/docs/next.config.js

This file was deleted.

29 changes: 0 additions & 29 deletions apps/docs/package.json

This file was deleted.

10 changes: 0 additions & 10 deletions apps/docs/pages/index.tsx

This file was deleted.

11 changes: 0 additions & 11 deletions apps/docs/tsconfig.json

This file was deleted.

11 changes: 1 addition & 10 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,7 @@
"build": "next build",
"start": "next start",
"lint": "next lint",
"db": "",
"db:push": "prisma db push",
"db:generate": "prisma generate",
"db:studio": "prisma studio",
"test": "jest",
"postinstall": "pnpm db:generate"
"test": "jest"
},
"lint-staged": {
"*": "next lint"
Expand All @@ -21,12 +16,9 @@
"@joekarow/eslint-config-netwerkr": "workspace:^1.0.0",
"@joekarow/netwerkr-lib": "workspace:^1.0.0",
"@joekarow/netwerkr-ui": "workspace:*",
"@next-auth/mongodb-adapter": "^1.0.3",
"@next-auth/prisma-adapter": "^1.0.3",
"@prisma/client": "^3.15.2",
"axios": "^0.27.2",
"dotenv": "^16.0.1",
"mongodb": "^4.7.0",
"next": "^12.1.6",
"next-auth": "^4.4.0",
"react": "^18.1.0",
Expand All @@ -46,7 +38,6 @@
"jest-environment-jsdom": "^28.1.1",
"msw": "^0.42.1",
"next-transpile-modules": "9.0.0",
"prisma": "^3.15.2",
"typescript": "^4.7.3"
}
}
22 changes: 20 additions & 2 deletions apps/web/pages/api/auth/[...nextauth].js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import NextAuth from "next-auth"
import TwitterProvider from 'next-auth/providers/twitter'
import Auth0Provider from 'next-auth/providers/auth0'
import { PrismaAdapter } from "@next-auth/prisma-adapter"
import { PrismaClient } from "@prisma/client"
import prisma from '@joekarow/netwerkr-lib/prisma'


// For more information on each option (and a full list of options) go to
// https://next-auth.js.org/configuration/options


const prisma = new PrismaClient()


export default NextAuth( {
adapter: PrismaAdapter( prisma ),
Expand All @@ -19,6 +19,11 @@ export default NextAuth( {
clientId: process.env.TWITTER_ID,
clientSecret: process.env.TWITTER_SECRET,
version: "2.0",
authorization: {
params: {
scope: 'tweet.read users.read list.read list.write'
}
},
} ),
Auth0Provider( {
clientId: process.env.AUTH0_CLIENT_ID,
Expand All @@ -30,6 +35,19 @@ export default NextAuth( {
maxAge: 7 * 24 * 60 * 60, // 7 days
updateAge: 24 * 60 * 60 // 24 hours
},
callbacks: {
async session ( { session, user } ) {
session.user.id = user.id
session.user.role = user.role
return session
},
async signIn ( { user, account, profile } ) {
if ( user.disabled ) return false
return true

}
},

debug: true,
} )

38 changes: 38 additions & 0 deletions apps/web/pages/dash/profile/[uid].jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import React from "react";
import { getContact } from '@joekarow/netwerkr-lib/db'
import { DashLayout } from '@joekarow/netwerkr-ui/layout'
import { ProfileGrid } from '@joekarow/netwerkr-ui/section'
import { JsonView } from '@joekarow/netwerkr-ui/devtools'

const Profile = ( props ) => {
const { data } = props
// console.log( data )
return (
<>
<ProfileGrid />
<JsonView data={ data } />
</>
)




}
Profile.getLayout = ( page ) => {
return (
<DashLayout>
{ page }
</DashLayout>
)
}

export const getServerSideProps = async ( { params } ) => {
const data = await getContact( params.uid )

if ( !data ) return { notFound: true }

return {
props: { data }
}
}
export default Profile
Loading