Skip to content

Commit

Permalink
Merge pull request #17 from kujo205/dev
Browse files Browse the repository at this point in the history
Merging posts creation flow into productions branch
  • Loading branch information
kujo205 authored May 29, 2024
2 parents ea27ab1 + a124327 commit 789c124
Show file tree
Hide file tree
Showing 85 changed files with 10,791 additions and 2,252 deletions.
35 changes: 19 additions & 16 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,26 +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}'
# 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
DISCORD_CLIENT_ID=""
DISCORD_CLIENT_SECRET=""
# Google creds fot oauth2
GOOGLE_CLIENT_SECRET=foo
GOOGLE_CLIENT_ID=foo

# Telegram stuff
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

#OPENAI API KEY
OPENAI_API_KEY=foo
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src/misc/prism.js
3 changes: 3 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const config = {
parserOptions: {
project: true,
},

plugins: ["@typescript-eslint"],
extends: [
"next/core-web-vitals",
Expand All @@ -13,10 +14,12 @@ const config = {
rules: {
// These opinionated rules are enabled in stylistic-type-checked above.
// Feel free to reconfigure them to your own preference.
"@typescript-eslint/no-unsafe-argument":"off",
"@typescript-eslint/array-type": "off",
"@typescript-eslint/consistent-type-definitions": "off",
"@typescript-eslint/no-unsafe-assignment": "warn",
"@typescript-eslint/no-unsafe-call": "warn",
"@typescript-eslint/no-floating-promises": "warn",
"@typescript-eslint/consistent-type-imports": [
"warn",
{
Expand Down
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/
38 changes: 23 additions & 15 deletions README.md
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,28 +1,36 @@
# Create T3 App
# Personal portfolio site-blog

This is a [T3 Stack](https://create.t3.gg/) project bootstrapped with `create-t3-app`.
This is a `portfolio site` with the `blog` created using `T3 stack`

## What's next? How do I make an app with this?
The site was created and is maintaned by `@kujo205` and `@Andry925`

We try to keep this project as simple as possible, so you can start with just the scaffolding we set up for you, and add additional things later when they become necessary.

If you are not familiar with the different technologies used in this project, please refer to the respective docs. If you still are in the wind, please join our [Discord](https://t3.gg/discord) and ask for help.
## What technologies were used?

- [Next.js](https://nextjs.org)
- [NextAuth.js](https://next-auth.js.org)
- [Prisma](https://prisma.io)
- [Drizzle](https://orm.drizzle.team/)
- [Tailwind CSS](https://tailwindcss.com)
- [tRPC](https://trpc.io)
- [Playwright](https://playwright.dev/)

## Learn More

To learn more about the [T3 Stack](https://create.t3.gg/), take a look at the following resources:

- [Documentation](https://create.t3.gg/)
- [Learn the T3 Stack](https://create.t3.gg/en/faq#what-learning-resources-are-currently-available) — Check out these awesome tutorials
## What side services were used?

You can check out the [create-t3-app GitHub repository](https://github.com/t3-oss/create-t3-app) — your feedback and contributions are welcome!
- [AWS S3](https://aws.amazon.com/s3/)
- [OpenAI API](https://platform.openai.com/docs/overview)
- [Figma](https://www.figma.com/)
- [Google's Oauth protocol](https://developers.google.com/identity/protocols/oauth2)
- [Telegraf](https://www.npmjs.com/package/telegraf)

## How do I deploy this?

Follow our deployment guides for [Vercel](https://create.t3.gg/en/deployment/vercel), [Netlify](https://create.t3.gg/en/deployment/netlify) and [Docker](https://create.t3.gg/en/deployment/docker) for more information.
## Milestones
- [ ] Create `about` page
- [ ] Create `projects` page
- [ ] Create `blog posts` page
- [ ] Create `personal blog page` page
- [ ] Add ablity to comment
- [ ] Create a page where admins can create and preview posts, assign tags to the posts
- [ ] Create a page where admins can update posts
- [ ] Add ability to delete posts
- [ ] Add ability to like posts
- [ ] Statitics of how many people hava seen the post
21 changes: 19 additions & 2 deletions drizzle.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,27 @@ import { env } from "@/env";

export default {
schema: "./src/server/db/schema.ts",
driver: "mysql2",
dbCredentials: {
uri: env.DATABASE_URL,
connectionString: env.DATABASE_URL,
},
verbose: true,
driver: "pg",
tablesFilter: ["kujo205-blog_*"],
out: "./src/server/db",
} satisfies Config;

/*
* import "dotenv/config";
import type { Config } from "drizzle-kit";
if (!process.env.DATABASE_URL) {
throw new Error("DATABASE_URL is missing");
}
export default {
schema: "./src/schema.ts",
out: "./drizzle",
connectionString: process.env.DATABASE_URL,
} satisfies Config;
*
* */
10 changes: 0 additions & 10 deletions next.config.js

This file was deleted.

22 changes: 22 additions & 0 deletions next.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially useful
* for Docker builds.
*/
await import("./src/env.js");

import remarkGfm from 'remark-gfm'
import createMDX from '@next/mdx'

/** @type {import('next').NextConfig} */
const nextConfig = {
pageExtensions: ['js', 'jsx', 'md', 'mdx', 'ts', 'tsx'],
output:"standalone"
}

const withMDX = createMDX({
options: {
remarkPlugins: [remarkGfm],
},
})

export default withMDX(nextConfig)
35 changes: 31 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,39 @@
"type": "module",
"scripts": {
"build": "next build",
"db:push": "drizzle-kit push:mysql",
"db:migrate": "tsx src/scripts/migrate.ts",
"db:studio": "drizzle-kit studio",
"db:generate-migration": "drizzle-kit generate:mysql",
"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",
"@aws-sdk/client-s3": "^3.515.0",
"@aws-sdk/s3-request-presigner": "^3.515.0",
"@hookform/resolvers": "^3.3.4",
"@mdx-js/loader": "^3.0.1",
"@mdx-js/react": "^3.0.1",
"@next/mdx": "^14.2.1",
"@planetscale/database": "^1.11.0",
"@radix-ui/react-avatar": "^1.0.4",
"@radix-ui/react-dialog": "^1.0.5",
"@radix-ui/react-popover": "^1.0.7",
"@radix-ui/react-progress": "^1.0.3",
"@radix-ui/react-select": "^2.0.0",
"@radix-ui/react-separator": "^1.0.3",
"@radix-ui/react-slot": "^1.0.2",
"@radix-ui/react-tabs": "^1.0.4",
"@t3-oss/env-nextjs": "^0.7.1",
"@tanstack/react-query": "^4.36.1",
"@trpc/client": "^10.43.6",
"@trpc/next": "^10.43.6",
"@trpc/react-query": "^10.43.6",
"@trpc/server": "^10.43.6",
"@types/mdx": "^2.0.13",
"axios": "^1.6.7",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.0",
"cmdk": "^0.2.0",
Expand All @@ -36,10 +47,20 @@
"lucide-react": "^0.312.0",
"next": "^14.0.4",
"next-auth": "^4.24.5",
"next-mdx-remote": "^4.4.1",
"next-themes": "^0.3.0",
"openai": "^4.38.5",
"postgres": "^3.4.4",
"prismjs": "^1.29.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-hook-form": "^7.49.3",
"react-intersection-observer": "^9.10.2",
"rehype-code-titles": "^1.2.0",
"rehype-prism-plus": "^2.0.0",
"remark-gfm": "3.0.0",
"server-only": "^0.0.1",
"sonner": "^1.4.41",
"superjson": "^2.2.1",
"tailwind-merge": "^2.2.0",
"tailwindcss-animate": "^1.0.7",
Expand All @@ -48,22 +69,28 @@
"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",
"@types/prismjs": "^1.26.3",
"@types/react": "^18.2.37",
"@types/react-dom": "^18.2.15",
"@types/react-highlight": "^0.12.8",
"@types/react-syntax-highlighter": "^15.5.11",
"@typescript-eslint/eslint-plugin": "^6.11.0",
"@typescript-eslint/parser": "^6.11.0",
"autoprefixer": "^10.4.14",
"drizzle-kit": "^0.20.9",
"eslint": "^8.54.0",
"eslint-config-next": "^14.0.4",
"mysql2": "^3.6.1",
"postcss": "^8.4.31",
"prettier": "^3.1.0",
"prettier-plugin-tailwindcss": "^0.5.7",
"tailwindcss": "^3.3.5",
"ts-node": "^10.9.2",
"tsconfig-paths": "^4.2.0",
"tsx": "^4.7.2",
"typescript": "^5.1.6"
},
"ct3aMetadata": {
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,
},
});
Loading

0 comments on commit 789c124

Please sign in to comment.