Skip to content

Commit

Permalink
feat(init): copy from frontend dir of monorepo
Browse files Browse the repository at this point in the history
  • Loading branch information
NicoSerranoP committed Jul 7, 2023
1 parent 29758d4 commit b1afe8a
Show file tree
Hide file tree
Showing 60 changed files with 6,607 additions and 119 deletions.
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# editorconfig.org
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
5 changes: 5 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
API_URL='http://localhost:8000/api'
NEXT_PUBLIC_API_URL='http://localhost:8000/api'
NEXT_PUBLIC_API_LOGIN_SECRET="login to backend"
NEXT_PUBLIC_RPC_URL='https://sepolia.infura.io/v3/<YOUR_INFURA_KEY>'
NEXT_PUBLIC_CONTRACT_ADDRESS=0xE2A943638d71c26cEE411d3432a3A95Bd0F4a1a9
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dist/*
.cache
public
node_modules
*.esm.js
31 changes: 31 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"$schema": "https://json.schemastore.org/eslintrc",
"root": true,
"extends": [
"next/babel",
"next/core-web-vitals",
"prettier",
"plugin:tailwindcss/recommended"
],
"plugins": ["tailwindcss"],
"rules": {
"@next/next/no-html-link-for-pages": "off",
"react/jsx-key": "off",
"tailwindcss/no-custom-classname": "off"
},
"settings": {
"tailwindcss": {
"callees": ["cn"],
"config": "./tailwind.config.js"
},
"next": {
"rootDir": ["./"]
}
},
"overrides": [
{
"files": ["*.ts", "*.tsx"],
"parser": "@typescript-eslint/parser"
}
]
}
142 changes: 24 additions & 118 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,130 +1,36 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# Runtime data
pids
*.pid
*.seed
*.pid.lock
# dependencies
node_modules
.pnp
.pnp.js

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
# testing
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history
# next.js
.next/
out/
build

# Output of 'npm pack'
*.tgz
# misc
.DS_Store
*.pem

# Yarn Integrity file
.yarn-integrity
# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# dotenv environment variable files
.env
# local env files
.env.local
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test
# turbo
.turbo

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
.contentlayer
.env
12 changes: 12 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
cache
.cache
package.json
package-lock.json
public
CHANGELOG.md
.yarn
dist
node_modules
.next
build
.contentlayer
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"typescript.tsdk": "../../node_modules/.pnpm/[email protected]/node_modules/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true
}
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,22 @@
# channel-4-frontend-poc2
Frontend code for the Channel-4's POC2 built with NextJS
Frontend code for the Channel-4's POC2 built with NextJS.

# To start
Download the repository and move to the project folder. Then run the following commands:

```bash
# 1 - Create a .env file like the .env.example file
cp .env.example .env

# 2 - Install the dependencies
pnpm install

# 3 - Run the project in dev mode
pnpm dev

# 4 - Build the project
pnpm build

# 5 - You can clear cache using
pnpm clean
```
14 changes: 14 additions & 0 deletions app/analytics.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"use client"

import { useSwetrix } from "@swetrix/nextjs"

export default function AnalyticWrapper({
children,
}: {
children: React.ReactNode
}) {
useSwetrix(`${process.env.NEXT_PUBLIC_SWETRIX}`, {
debug: true,
})
return <div className="flex-1">{children}</div>
}
21 changes: 21 additions & 0 deletions app/discover/SiteFrame.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
"use client";

import { C4Content } from "@/types";





const SiteFrame = ({ content }: { content: C4Content | null }) => {
if (!content) return null

return (
<section className="bg-c4-gradient-main h-[768px] rounded-2xl pe-2 ps-2">
<div className="bg-secondary relative flex h-full w-full items-center justify-center overflow-hidden rounded-xl">
<iframe src={content.url} className="h-full w-full"></iframe>
</div>
</section>
)
}

export default SiteFrame
16 changes: 16 additions & 0 deletions app/discover/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { BottomNavigation } from "@/components/bottom-nav"

export default function DiscoverLayout({
children,
}: {
children: React.ReactNode
}) {
return (
<>
{children}
<div className="block md:hidden">
<BottomNavigation />
</div>
</>
)
}
Loading

0 comments on commit b1afe8a

Please sign in to comment.