Skip to content

Commit

Permalink
docs: update README.md for examples/nextjs/starter (#14)
Browse files Browse the repository at this point in the history
* docs: Add instructions in nextjs starter readme

* feat: 🔥 remove developement.md

* chore: cleanup

---------

Co-authored-by: bhumik <[email protected]>
Co-authored-by: Dovid Levine <[email protected]>
  • Loading branch information
3 people authored Jan 30, 2025
1 parent c4ee5a2 commit 11c0361
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 25 deletions.
21 changes: 0 additions & 21 deletions examples/nextjs/starter/DEVELOPMENT.md

This file was deleted.

51 changes: 47 additions & 4 deletions examples/nextjs/starter/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,41 @@
# NextJS Starter
# 🫰 SnapWP - Next.js Starter Example

This is a [Next.js](https://nextjs.org/) application that serves as a headless WordPress frontend using SnapWP.
This is a headless WordPress application built with [Next.js](https://nextjs.org/), powered by [WPGraphQL](https://www.wpgraphql.com/) and [SnapWP](https://github.com/rtCamp/snapwp).

## Getting Started

@todo
```bash
# Install dependencies
npm install

## Route Handling
# Run the development server
npm run dev
```

Your Next.js app will be available at http://localhost:3000 🎉

## Commands

`npm run <command>`

- `build` Builds the production Next app. This command is usually followed by `start` which starts a server to server the next app.
- `dev` Builds the next app in development mode and watches for changes in the source files and graphql schema.
- `format` formats the codebase using prettier.
- `lint` and `lint:fix`: verifies (and fixes, respectively) linting and formatting rules with ESLint.
- `test` Runs unit tests configured with Jest.
- `typecheck` runs Typescript type checking.

For more information about developing with SnapWP, please refer to the [SnapWP documentation](https://github.com/rtCamp/snapwp/blob/develop/DEVELOPMENT.md).

## Usage

For detailed instructions on how to use SnapWP, please refer to the [SnapWP documentation](https://github.com/rtCamp/snapwp/blob/develop/docs).

## Features

@todo - Add directory structure and features.

### Route Handling

The application uses NextJS's [App router](https://nextjs.org/docs/app/building-your-application/routing) to manage routes.

Expand All @@ -16,3 +45,17 @@ The application uses NextJS's [App router](https://nextjs.org/docs/app/building-
### Custom Routes

To add a custom route, create a folder with its name, e.g. [./src/app/example-route](./src/app/example-route/page.tsx). The route will be available at `/example-route`, and have access to WordPress global styles and settings.

### Middleware

- @see [middleware.md](../../../docs/middleware.md)

## Contributing

This example project is part of [SnapWP's monorepo](https://github.com/rtCamp/snapwp) and is actively maintained by [rtCamp](https://rtcamp.com/). Examples are stored in the `examples` directory, and can be setup locally using the `npx snapwp` command.

Contributions are _welcome_ and **encouraged!** To learn more about contributing to this package or SnapWP as a whole, please read the [Contributing Guide](https://github.com/rtCamp/snapwp/blob/main/.github/CONTRIBUTING.md).

## Want to expand what's possible with WordPress?

<a href="https://rtcamp.com/"><img src="https://rtcamp.com/wp-content/uploads/sites/2/2019/04/[email protected]" alt="Join us at rtCamp, we specialize in providing high performance enterprise WordPress solutions."></a>

0 comments on commit 11c0361

Please sign in to comment.