-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adding documentation to docs app (#34)
- Loading branch information
Showing
28 changed files
with
660 additions
and
393 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import type { AppProps } from 'next/app' | ||
import type { ReactElement } from 'react' | ||
|
||
import '../style.css' | ||
|
||
export default function Nextra({ Component, pageProps }: AppProps): ReactElement { | ||
return <Component {...pageProps} /> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Guide | ||
|
||
This is the index page for the Guide folder! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
import { Callout } from 'nextra-theme-docs' | ||
|
||
## 🚩 Requirements | ||
|
||
- **macOS** Monterey+ or **Linux** | ||
- **Docker** 20.10 or newer | ||
- [How To Install and Use Docker on Ubuntu 22.04](https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-22-04) | ||
- **Cloned, configured and running** [docker-shared-services](https://github.com/wayofdev/docker-shared-services), to support system-wide DNS, Routing and TLS support via Traefik. | ||
|
||
## 💨 Quick Start from Template | ||
|
||
### → Fork and Deploy to Vercel | ||
|
||
You can start by creating your monorepo with web and docs applications by deploying to Vercel by clicking the link: | ||
|
||
[](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fwayofdev%2Fnext-starter-tpl%2Ftree%2Fmaster) | ||
|
||
### → Manual Setup | ||
|
||
You can use GitHub built-in functionality, to generate your repository from this template. Generated repository can always be synced using [manual GitHub workflow](https://github.com/wayofdev/next-starter-tpl/blob/master/.github/workflows/sync-from-tpl.yml). | ||
|
||
- Open this repository template in GitHub - [wayofdev/next-starter-tpl](https://github.com/wayofdev/next-starter-tpl) | ||
- Click on the [Use this template](https://github.com/wayofdev/next-starter-tpl/generate) button | ||
- Enter repository name, select repository visibility | ||
- Click on the **Create repository from template** button | ||
- To periodically sync your repository from upstream, use [manual GitHub workflow](https://github.com/wayofdev/next-starter-tpl/actions/workflows/sync-from-tpl.yml). `.templatesyncignore` file can be used to ignore files from syncing. More info about syncing can be found in [AndreasAugustin/actions-template-sync](https://github.com/AndreasAugustin/actions-template-sync) | ||
|
||
### → Using Terraform | ||
|
||
At WoD we use Terraform to automate the process of creating new repositories from templates. [mineiros-io/terraform-github-repository](https://github.com/mineiros-io/terraform-github-repositor) repository can be used, to manage your GitHub organization state, all repositories and their templates. | ||
|
||
Example configuration for creating new repository from template: | ||
|
||
```hcl filename="repos-frontend.tf" | ||
module "repository_next_frontend_[project-name]" { | ||
source = "mineiros-io/repository/github" | ||
version = "~> 0.18.0" | ||
name = "next-frontend-[project-name]" | ||
description = "NextJS based frontend application for [project-name]" | ||
visibility = "private" | ||
homepage_url = "https://[project-name].io" | ||
push_teams = [module.team_vb.id] | ||
admin_teams = [module.team_infra.id] | ||
template = { | ||
include_all_branches = true | ||
owner = "wayofdev" | ||
repository = "next-starter-tpl" | ||
} | ||
branches = [ | ||
{ | ||
name = "develop" | ||
source_branch = "master" | ||
}, | ||
] | ||
default_branch = "develop" | ||
branch_protections_v4 = [ | ||
{ | ||
pattern = "master" | ||
}, | ||
{ | ||
pattern = "develop" | ||
require_conversation_resolution = true | ||
required_pull_request_reviews = { | ||
require_code_owner_reviews = false | ||
required_approving_review_count = 0 | ||
} | ||
} | ||
] | ||
issue_labels = tolist(local.default_issue_labels) | ||
issue_labels_merge_with_github_labels = false | ||
} | ||
``` | ||
|
||
## 💻 Setup | ||
|
||
<Callout type="warning"> | ||
Repository with [docker-shared-services](https://github.com/wayofdev/docker-shared-services) | ||
should be configured, up and running, to ensure `*.docker` domain support system-wide. | ||
</Callout> | ||
|
||
<div className="steps-container"> | ||
|
||
### → Clone Repository | ||
|
||
After forking or creating generating repository from template, you can clone it to your local machine. In this example we will use `next-starter-tpl` repository as starting point. | ||
|
||
```bash | ||
$ git clone [email protected]:wayofdev/next-starter-tpl.git | ||
``` | ||
|
||
### → Generate `.env` file | ||
|
||
Generate .env file from .env.example file. | ||
|
||
```bash | ||
# add FORCE=true to overwrite existing .env file | ||
$ make env \ | ||
APP_NAME=tpl \ | ||
SHARED_SERVICES_NAMESPACE=ss \ | ||
PROJECT_SERVICES_NAMESPACE=wod | ||
``` | ||
|
||
Change generated `.env` file to match your needs, if needed. | ||
|
||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,65 @@ | ||
# Introduction | ||
import { Callout } from 'nextra-theme-docs' | ||
|
||
Welcome to Nextra! This is a basic docs template. You can use it as a starting point for your own project :) | ||
# NextJS Starter Template | ||
|
||
## What is Nextra? | ||
## 📄 About | ||
|
||
A **simple**, **powerful** and **flexible** site generation framework with everything you love from Next.js. | ||
This repository contains a [monorepo](https://turbo.build/repo/docs/handbook/what-is-a-monorepo) boilerplate written in [Next.js](https://nextjs.org/), managed by the [pnpm](https://pnpm.io) package manager. | ||
|
||
## Documentation | ||
You can use it with the backend template, written in Laravel — [laravel-starter-tpl](https://github.com/wayofdev/laravel-starter-tpl). | ||
|
||
The documentation is available at [https://nextra.site](https://nextra.site). | ||
### → Purpose | ||
|
||
- Establish a **structure** and present a lifecycle perspective (dx, ci/cd, deployments); | ||
- Show how to create and consume shared packages, locales, assets, and API types; | ||
- Ship fully configured repository with integrated **tools & configs**, like tsconfig, eslint, jest, cypress, tailwind, changelogs, versioning, codecov, codeclimate, sentry, and others; | ||
- Clarify some **advantages** of monorepo (team cohesion, consistency, duplication, refactorings, atomic commits) | ||
|
||
## 🤔 What's inside? | ||
|
||
[](https://gitpod.io/#https://github.com/wayofdev/next-starter-tpl) | ||
|
||
This turborepo uses [pnpm](https://pnpm.io) as a package manager. It includes the following packages/apps: | ||
|
||
### → Apps | ||
|
||
| Name | URL | Description | | ||
| ----------- | ---------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| `apps/docs` | 🌎 [Demo](https://next-starter-tpl-docs.vercel.app/) | [Nextra](https://nextra.site/) documentation template generated from [Nextra: Docs Starter Kit](https://vercel.com/templates/next.js/documentation-starter-kit) | | ||
| `apps/web` | 🌎 [Demo](https://next-starter-tpl-web.vercel.app/) | [Next.js](https://nextjs.org/) app with tailwindcss and sentry support. | | ||
|
||
<Callout type="note">Apps should not depend on apps, they can depend on packages.</Callout> | ||
|
||
### → Packages | ||
|
||
| Name | Description | | ||
| ------------------------------- | ------------------------------------------------------------------------------------ | | ||
| `packages/ui` | a stub React component library shared by the `web` application | | ||
| `packages/common-i18n` | locales for multi-language support | | ||
| `packages/eslint-config-custom` | `eslint` configurations (includes `eslint-config-next` and `eslint-config-prettier`) | | ||
| `packages/jest-config` | [JestJS](https://jestjs.io) configs used across the monorepo | | ||
|
||
<Callout type="note">Apps can depend on packages, packages can depend on each others.</Callout> | ||
|
||
### → Utilities and Features | ||
|
||
This repository has some additional tools already setup for you: | ||
|
||
- Supporting [NextJS 13.1.1+](https://nextjs.org/blog/next-13) | ||
- [TypeScript](https://www.typescriptlang.org/) support for static type checking | ||
- Strict Mode for TypeScript and React 18 | ||
- [ESLint](https://eslint.org/) for code linting and configured presets: NextJS Recommended, NextJS Core Web Vitals and [Airbnb Style Guide](https://www.npmjs.com/package/eslint-config-airbnb) | ||
- Code formatting with [Prettier](https://prettier.io/) | ||
- Integrated with [Tailwind CSS](https://tailwindcss.com/) | ||
- [PostCSS](https://postcss.org/) for processing Tailwind CSS and [CSSNANO](https://cssnano.co/) for CSS optimization on production systems | ||
- [Husky](https://typicode.github.io/husky/#/) for modern native git hooks | ||
- [Lint-staged](https://github.com/okonet/lint-staged) for running linters on Git staged files | ||
- [GitHub Actions](https://github.com/features/actions) support out of the box | ||
- SEO metadata, JSON-LD and Open Graph tags with [Next SEO](https://github.com/garmeeh/next-seo) | ||
- Sitemap support using [next-sitemap](https://www.npmjs.com/package/next-sitemap) | ||
- [Bundler Analyzer](https://www.npmjs.com/package/@next/bundle-analyzer) — Visualize size of webpack output files with an interactive zoomable treemap | ||
- Optimized [Lighthouse](https://web.dev/performance-scoring/) performance score | ||
- End-2-end testing with [cypress](https://www.cypress.io/) and [JestJS](https://jestjs.io/) support for writing unit tests | ||
- Package auto-update in all workspace projects using [npm-check-updates](https://www.npmjs.com/package/npm-check-updates) | ||
- Keep package.json sorted using [sort-package-json](https://www.npmjs.com/package/sort-package-json) | ||
- Client and server side [error reporting](https://sentry.io/) supported by [@sentry/nextjs](https://www.npmjs.com/package/@sentry/nextjs) |
Oops, something went wrong.
99f6111
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
next-starter-tpl-web – ./apps/web
next-starter-tpl-web.vercel.app
next-starter-tpl-web-git-master-wayofdev.vercel.app
next-starter-tpl-web-wayofdev.vercel.app
99f6111
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
next-starter-tpl-docs – ./apps/docs
next-starter-tpl-docs-git-master-wayofdev.vercel.app
next-starter-tpl-docs.vercel.app
next-starter-tpl-docs-wayofdev.vercel.app