Skip to content

Commit

Permalink
Merge branch 'dev' into 6-create-blog-posts-page
Browse files Browse the repository at this point in the history
  • Loading branch information
Andry925 authored May 23, 2024
2 parents a5b46dc + d573b2e commit 9e31c3a
Show file tree
Hide file tree
Showing 10 changed files with 644 additions and 29 deletions.
40 changes: 16 additions & 24 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,37 +1,29 @@
# Since the ".env" file is gitignored, you can use the ".env.example" file to
# build a new ".env" file when you clone the repo. Keep this file up-to-date
# when you add new variables to `.env`.

# This file will be committed to version control, so make sure not to have any
# secrets in it. If you are cloning this repo, create a copy of this file named
# ".env" and populate it with your secrets.

# When adding additional environment variables, the schema in "/src/env.js"
# should be updated accordingly.

# Drizzle
# Get the Database URL from the "prisma" dropdown selector in PlanetScale.
# Change the query params at the end of the URL to "?ssl={"rejectUnauthorized":true}"
DATABASE_URL='mysql://YOUR_MYSQL_URL_HERE?ssl={"rejectUnauthorized":true}'
# DATABASE_URL='mysql://someurlYOUR_MYSQL_URL_HERE?ssl={"rejectUnauthorized":true}'
# DB-related environment variables
DATABASE_URL=http://localhost:5432/postgres

# Next Auth
# You can generate a new secret on the command line with:
# openssl rand -base64 32
# https://next-auth.js.org/configuration/options#secret
NEXTAUTH_SECRET==
NEXTAUTH_SECRET=9df44P4igvwXwXksdJIe3jhB3dnXwJe/PZzjh2WD/6M=
NEXTAUTH_URL="http://localhost:3000"

# Next Auth Discord Provider
GOOGLE_CLIENT_SECRET=
GOOGLE_CLIENT_ID=
# Google creds fot oauth2
GOOGLE_CLIENT_SECRET=foo
GOOGLE_CLIENT_ID=foo

# Telegram stuff
TELEGRAM_BOT_TOKEN=
MY_TELEGRAM_CHAT_ID=
TELEGRAM_BOT_TOKEN=foo
MY_TELEGRAM_CHAT_ID=foo

#AWS S3
S3_ACCESS_KEY=foo
S3_SECRET_ACCESS_KEY=foo
AWS_REGION=foo
BUCKET_NAME=foo

# S3 api stuff
S3_ACCESS_KEY=
S3_SECRET_ACCESS_KEY=
AWS_REGION=
BUCKET_NAME=
#OPENAI API KEY
OPENAI_API_KEY=foo
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Specify location of manifest files for each package manager

version: 2
updates:
- package-ecosystem: "npm"
# Files stored in `app` directory
directory: "/app"
schedule:
interval: "weekly"

- package-ecosystem: "github-actions"
# Workflow files stored in the default location of `.github/workflows`. (You don't need to specify `/.github/workflows` for `directory`. You can use `directory: "/"`.)
directory: "/"
schedule:
interval: "weekly"
29 changes: 29 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Playwright Tests
on:
push:
branches: [ main, dev ]
pull_request:
branches: [ main, dev ]
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm install -g [email protected] && pnpm install
- name: Install Playwright Browsers
run: pnpm exec playwright install --with-deps
- name: Run Playwright tests
run: pnpm exec playwright test
env:
PLAYWRIGHT_TEST_BASE_URL: ${{ github.event.deployment_status.target_url }}
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,7 @@ yarn-error.log*

# typescript
*.tsbuildinfo
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"db:generate-migration": "drizzle-kit generate:pg",
"dev": "next dev",
"lint": "next lint",
"start": "next start"
"start": "next start",
"test": "npx playwright test --reporter line"
},
"dependencies": {
"@auth/drizzle-adapter": "^0.3.6",
Expand Down Expand Up @@ -68,6 +69,7 @@
"zod": "^3.22.4"
},
"devDependencies": {
"@playwright/test": "^1.44.0",
"@tailwindcss/typography": "^0.5.12",
"@types/eslint": "^8.44.7",
"@types/node": "^18.17.0",
Expand Down
57 changes: 57 additions & 0 deletions playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import { defineConfig, devices } from "@playwright/test";
import * as process from "node:process";
import { config } from "dotenv";
/**
* Read environment variables from file.
* https://github.com/motdotla/dotenv
*/
config({
path: ".env.example",
});

export default defineConfig({
testDir: "./tests",
/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
/* Retry on CI only */
retries: process.env.CI ? 2 : 0,
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: "html",
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
// baseURL: 'http://127.0.0.1:3000',

/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: "on-first-retry",
},

/* Configure projects for major browsers */
projects: [
{
name: "chromium",
use: { ...devices["Desktop Chrome"] },
},

{
name: "firefox",
use: { ...devices["Desktop Firefox"] },
},

{
name: "webkit",
use: { ...devices["Desktop Safari"] },
},
],

/* Run your local dev server before starting the tests */
webServer: {
command: "pnpm dev",
url: "http://127.0.0.1:3000",
reuseExistingServer: !process.env.CI,
},
});
35 changes: 35 additions & 0 deletions pnpm-lock.yaml

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

13 changes: 9 additions & 4 deletions src/app/projects/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@ import { ProjectCard } from "@/app/projects/_components/ProjectCard";

export default function Projects() {
return (
<main className="md:px-30 grid grid-cols-1 gap-6 px-16 py-20 sm:grid-cols-2 md:grid-cols-3">
{projects.map((project) => (
<ProjectCard project={project} key={project.title} />
))}
<main className="px-15 flex flex-col gap-8 py-20 md:px-32">
<h1 className="self-center text-2xl font-bold">
Here are some of my projects
</h1>
<ul className="grid grid-cols-1 gap-6 sm:grid-cols-2 md:grid-cols-3">
{projects.map((project) => (
<ProjectCard project={project} key={project.title} />
))}
</ul>
</main>
);
}
Loading

0 comments on commit 9e31c3a

Please sign in to comment.