Welcome to Next.js - Hygraph news starter, an open-source plug and play template and starter for you media apps or blogs! It's build on top of next-enterprise so it comes packed with functionalities designed to assist you in creating an app that is not only high-performing and maintainable but also enjoyable to use.
You can find more in depth dive into project's underlying architecture in the next-enteprise repository.
To get started with this boilerplate, follow these steps:
- Fork & clone repository:
## Don't forget to ⭐ star and fork it first :)
git clone https://github.com/<your_username)/next-news.git
- Install the dependencies:
yarn install --frozen-lockfile
- Provide required env variables:
# url of your site, used for SEO and sitemaps
NEXT_PUBLIC_SITE_URL="my-site.app"
# hygraph's graphql content api url - you can find it in API Acess tab on Hygraph
NEXT_PUBLIC_HYGRAPH_CONTENT_API_URL="https://region.hygraph.com/v2/projectId/environment"
# secret used for authenticating webhooks (generate it yourself)
HYGRAPH_WEBOOK_SECRET="my-secret-123"
Search engine - take it from your algolia project's config
NEXT_PUBLIC_ALGOLIA_API_ID=""
NEXT_PUBLIC_ALGOLIA_SEARCH_API_KEY=""
Analytics - used for counting views on your articles. Needed for 'Trending Articles' section
GA_MEASUREMENT_ID=""
GA_PROPERTY_ID=""
# Base64 endoded service account containing:
# {
# "private_key: "private-key-value"
# "client_email": "service-account-email@project.iam.gserviceaccount.com"
# }
GA_BASE64_SERVICE_ACCOUNT=""
- Run the development server:
yarn dev
- Open http://localhost:3000 with your browser to see the result.
Easily deploy your Next.js app with Vercel by clicking the button below:
The following scripts are available in the package.json
:
dev
: Starts the development server along with codegen watcherbuild
: Builds the app for productionstart
: Starts the production serverlint
: Lints the code using ESLintlint:fix
: Automatically fixes linting errorsprettier
: Checks the code for proper formattingprettier:fix
: Automatically fixes formatting issuesanalyze
: Analyzes the bundle sizes for Client, Server and Edge environmentsstorybook
: Starts the Storybook serverbuild-storybook
: Builds the Storybook for deploymenttest
: Runs unit and integration testscodegen
: Runs codegen on your public content api urle2e:headless
: Runs end-to-end tests in headless modee2e:ui
: Runs end-to-end tests with UIformat
: Formats the code with Prettierpostinstall
: Applies patches to external dependenciespreinstall
: Ensures the project is installed with Yarncoupling-graph
: Generates a coupling and cohesion graph for the components
Contributions are always welcome! To contribute, please follow these steps:
- Fork the repository.
- Create a new branch with a descriptive name.
- Make your changes, and commit them using the Conventional Commits format.
- Push your changes to the forked repository.
- Create a pull request, and we'll review your changes.
If you're looking for help or simply want to share your thoughts about the project, we encourage you to join our Discord community. Here's the link: https://blazity.com/discord. It's a space where we exchange ideas and help one another. Everyone's input is appreciated, and we look forward to welcoming you.
This project is licensed under the MIT License. For more information, see the LICENSE file.
Marcin Szczepaniak 💻 |
Max 💻 |
Bart Stefanski 💻 |
Jakub Jabłoński 🚇 |
|||
Add your contributions |