This is a bugout-dev frontend app template ment to be bootstrapped with create-next-app
.
npx create-next-app app-name -e https://github.com/bugout-dev/frontend_template
cd app-name
cp sample.env my.env
and setup variablessource my.env
- Modify
src/core/constants.js
to configure app constants
First, run the development server:
npm run dev
# or
yarn dev
Open http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying pages/index.js
. The page auto-updates as you edit the file.
For each page url page you need to create a file in /pages
directory. See examples in /pages_templates
NEXT js app can be used with SSR - API routes can be accessed on http://localhost:3000/api/hello. This endpoint can be edited in pages/api/hello.tsx
.
The pages/api
directory is mapped to /api/*
. Files in this directory are treated as API routes instead of React pages.
To learn more about Bugout and Moonstream, take a look at the following resources:
- Moonstream.to Documentation - learn about Moonstream.to features and API.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
First lint your files. Happy linter - happy life!
yarn lint
Next
yarn build
Your project will be generated in /build
directory
Since you might have dynamic routes that have no physical index.html that will correspond to your route, your routes will eventually be handled by s3 error redirect.
In order to display dynamic routes correctly, set S3 404 redirect to /base_url/entry-point/index.html
This route will ensure correct load and entrying in the next js app
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.