The source code for the Neat F2P website.
- Node 22
- Copy
.env.distto.envand fill in empty values. - Run
npm run devto run the server locally. It will be available atlocalhost:3000.
This went away when I installed node/lts and used it. However I also noted that after switching nvs back to 16.14.0, which was the Node version I had installed when I originally had this problem, the problem was gone. Somehow, nvs installing newer Node verisons, or switching them, fixed this.
Instructions:
- Add a new property to the
typographyobject insrc/theme/theme.ts. - Add the new typography name to the following interfaces:
a.
TypographyVariantsb.TypographyVariantsOptionsc.TypographyPropsVariantOverrides - Set the new typography's element in
variantMapping
To set up a web client page that connects to the Neat F2P test server (running off of my desk laptop), do the following:
- Add the
clientfolder (available here) topublic. That way the webclient HTML file is accessible via{HOST}/client/index.html. - Create a
testwebclientfolder undersrc/pages, and then aindex.tsxfile underneath it, similar to the existingwebclient/index.tsx, but with code like this:
const TestWebclientPage = () => {
const [hideAds, setHideAds] = useState(false)
const [hideRunescapeBanners, setHideRunescapeBanners] = useState(false)
const [showHelpModal, setShowHelpModal] = useState(false)
const protocol = getProtocol()
const webclientHost = process.env.NEXT_PUBLIC_WEBSITE_HOST
const gameServerHost = '71.205.248.145'
const gameServerRsaPublicKey =
'10434129247747875206749322994737259335353815224197943208197420577351164491111787501201706919192564129410096061100941383106949396063257493621975484273337067'
const webclientUrl = `${protocol}://${webclientHost}/client/index.html#free,${gameServerHost},43494,65537,${gameServerRsaPublicKey},true`
- Add
"ignorePatterns": ["public/client"]to.eslintrc.jsonso that the web client files do not throw errors. - In
_app.tsx, add|| router.asPath === '/testwebclient'toisWebclientPage. - Push these changes up to the website and have it deploy. Then you need an SSL cert that is issued from the same domain.
This is a Next.js project bootstrapped with create-next-app.
First, create your .env file:
cp .env.dist .env
Next, run the development server:
npm run dev
# or
yarn dev
# or
pnpm devOpen http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying pages/index.tsx. The page auto-updates as you edit the file.
API routes can be accessed on http://localhost:3000/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 instead of React pages.
This project uses next/font to automatically optimize and load Inter, a custom Google Font.
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!
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.