Skip to content

Commit

Permalink
feat: intial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
nyomansunima committed Apr 14, 2023
1 parent 08ff7cd commit 239e99f
Show file tree
Hide file tree
Showing 189 changed files with 37,629 additions and 355 deletions.
73 changes: 0 additions & 73 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,73 +0,0 @@
# Turborepo starter

This is an official npm starter turborepo.

## What's inside?

This turborepo uses [npm](https://www.npmjs.com/) as a package manager. It includes the following packages/apps:

### Apps and Packages

- `docs`: a [Next.js](https://nextjs.org/) app
- `web`: another [Next.js](https://nextjs.org/) app
- `ui`: a stub React component library shared by both `web` and `docs` applications
- `eslint-config-custom`: `eslint` configurations (includes `eslint-config-next` and `eslint-config-prettier`)
- `tsconfig`: `tsconfig.json`s used throughout the monorepo

Each package/app is 100% [TypeScript](https://www.typescriptlang.org/).

### Utilities

This turborepo has some additional tools already setup for you:

- [TypeScript](https://www.typescriptlang.org/) for static type checking
- [ESLint](https://eslint.org/) for code linting
- [Prettier](https://prettier.io) for code formatting

### Build

To build all apps and packages, run the following command:

```
cd my-turborepo
npm run build
```

### Develop

To develop all apps and packages, run the following command:

```
cd my-turborepo
npm run dev
```

### Remote Caching

Turborepo can use a technique known as [Remote Caching](https://turbo.build/repo/docs/core-concepts/remote-caching) to share cache artifacts across machines, enabling you to share build caches with your team and CI/CD pipelines.

By default, Turborepo will cache locally. To enable Remote Caching you will need an account with Vercel. If you don't have an account you can [create one](https://vercel.com/signup), then enter the following commands:

```
cd my-turborepo
npx turbo login
```

This will authenticate the Turborepo CLI with your [Vercel account](https://vercel.com/docs/concepts/personal-accounts/overview).

Next, you can link your Turborepo to your Remote Cache by running the following command from the root of your turborepo:

```
npx turbo link
```

## Useful Links

Learn more about the power of Turborepo:

- [Tasks](https://turbo.build/repo/docs/core-concepts/monorepos/running-tasks)
- [Caching](https://turbo.build/repo/docs/core-concepts/caching)
- [Remote Caching](https://turbo.build/repo/docs/core-concepts/remote-caching)
- [Filtering](https://turbo.build/repo/docs/core-concepts/monorepos/filtering)
- [Configuration Options](https://turbo.build/repo/docs/reference/configuration)
- [CLI Usage](https://turbo.build/repo/docs/reference/command-line-reference)
4 changes: 0 additions & 4 deletions apps/docs/.eslintrc.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.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

8 changes: 8 additions & 0 deletions apps/frontend/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "next/core-web-vitals",
"rules": {
"no-unused-vars": "off",
"react-hooks/exhaustive-deps": "off",
"react/no-unescaped-entities": "off"
}
}
37 changes: 37 additions & 0 deletions apps/frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# local env files
.env*.local
.env

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
4 changes: 4 additions & 0 deletions apps/frontend/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"semi": false,
"singleQuote": true
}
59 changes: 59 additions & 0 deletions apps/frontend/components/blog/blog-card.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import { FunctionComponent } from 'react'
import styles from '@styles/components/blog/blog-card.module.scss'
import Image from 'next/image'
import { ArticlePost } from '~/types/content'

interface BlogCardProps {
view?: 'grid' | 'full' | 'slide'
randomLayout?: boolean
className?: string
data: ArticlePost
}

/**
* # BlogCard
*
* card to showing the blog article
* including the list, grid, and the slide
*
* @returns JSX.Element
*/
const BlogCard: FunctionComponent<BlogCardProps> = ({
view = 'grid',
className,
randomLayout,
data,
}): JSX.Element => {
const openLink = () => {
window.open(`https://nyomansunima.hashnode.dev/${data.slug}`)
}

return (
<div
onClick={openLink}
className={`${styles.card} ${className} ${styles[view]} ${
randomLayout ? styles.random_layout : ''
}`}
>
<div className={styles.wrapper}>
<button type="button">
<i className="fi fi-bs-arrow-up-right"></i>
</button>
<div
data-cursor-text="Read"
data-cursor-size="80"
className={styles.thumbnail}
>
<Image src={data.coverImage} fill alt={data.title} />
</div>
<div className={styles.category}>
<span className={styles.indicator}></span>
<span className={styles.label}>{data.type}</span>
</div>
<span className={styles.title}>{data.title}</span>
</div>
</div>
)
}

export default BlogCard
3 changes: 3 additions & 0 deletions apps/frontend/components/blog/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import BlogCard from './blog-card'

export { BlogCard }
Loading

0 comments on commit 239e99f

Please sign in to comment.