Skip to content

Commit

Permalink
📝 Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
ryichk committed Nov 7, 2021
1 parent 4e61c45 commit 5353a80
Showing 1 changed file with 110 additions and 11 deletions.
121 changes: 110 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,50 @@
# Next.js Boilerplate

This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).

## Features

- 🎉 [Next.js](https://nextjs.org/) for Static Site Generator

- 🔧 Type checking [TypeScript](https://www.typescriptlang.org/)

- 💚 Integrate with [TailwindCSS](https://tailwindcss.com/)

- ✨ Code Formatter with [Prettier](https://prettier.io/)

- 🚨 Linter with [ESLint](https://eslint.org/)

- ✅ Testing with [Jest](https://jestjs.io/)

- 🎨 Build a design system with [Storybook](https://storybook.js.org/)

- 🚀 Deploy with [AWS Amplify](https://docs.amplify.aws/guides/hosting/nextjs/q/platform/js/)

## Requirements

- [Docker Desktop](https://www.docker.com/get-started)

## Getting Started

First, run the development server:
Run the development server:

```bash
npm run dev
# or
yarn dev
```sh
docker-compose up
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
- Next.js App: [http://localhost:8000](http://localhost:8000)

- Storybook: [http://localhost:6006](http://localhost:6006)

## Development

You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file.

[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`.
[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:8000/api/hello](http://localhost:8000/api/hello). This endpoint can be edited in `pages/api/hello.ts`.

The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.

## Learn More
### Learn More

To learn more about Next.js, take a look at the following resources:

Expand All @@ -27,8 +53,81 @@ To learn more about Next.js, take a look at the following resources:

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!

## Deploy on Vercel
### Format the code

```sh
docker-compose run --rm app yarn format
```

### Linting

```sh
docker-compose run --rm app yarn lint
```

### Testing

```sh
docker-compose run --rm app yarn test
```

## Deploy to AWS Amplify

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
### Prerequisites

```sh
npm install -g @aws-amplify/cli
```

```sh
amplify configure
```

### Deploy and host a hybrid app (SSG and SSR)

Initialize a new Amplify project.

```sh
$ amplify init

? Enter a name for the project: # <your app name>
? Enter a name for the environment: # dev
? Choose your default editor: # Visual Studio Code (or your preferred editor)
? Choose the type of app that youre building: # javascript
? What javascript framework are you using: # react
? Source Directory Path: # src
? Distribution Directory Path: # .next
? Build Command: # npm run-script build
? Start Command: # npm run-script start
? Select the authentication method you want to use: # AWS profile
? Please choose the profile you want to use: # <your profile>
```

Add hosting with Amplify `add` command:

```sh
$ amplify add hosting

? Select the plugin module to execute: # Hosting with Amplify Console
? Choose a type: # Manual deployment
```

The Amplify Console opens and displays your deployed backend environment.

Choose the Frontend environments tab, select your Git provider, then choose Connect Branch.

Follow the steps in the Amplify console to choose the branch to connect, and deploy your app.

After your site is successfully deployed, you'll see green checkmarks.

To view the live site, click on the automatically generated URL.

### Deleting the App

To delete the app and the deployment, run the `delete` command:

```sh
amplify delete
```

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
[Deploy and host a hybrid app (SSG and SSR)](https://docs.amplify.aws/guides/hosting/nextjs/q/platform/js/#deploy-and-host-a-hybrid-app-ssg-and-ssr)

0 comments on commit 5353a80

Please sign in to comment.