The website of inkan, the API framework for Node where the docs can't lie: the landing page, the docs, and a playground that talks to a real inkan app.
It runs on Next.js, and its API is an inkan app (server/app.ts) served through
@inkanjs/next. The docs
are MDX under content/docs, read by Fumadocs. The animations are
Motion, the clips under "under the hood" are
Remotion scenes played in the page.
npm install
npm run devhttp://localhost:3000 is the site, /docs the docs, /api/docs the docs of the playground
API. npm run check runs the API's examples as tests.
npm ci
npm run build
npm startThe build is a standalone Next.js server in .next/standalone, with public/ and
.next/static copied next to it: the folder is the whole site. npm start runs it on PORT
(default 3000) and HOSTNAME (default 0.0.0.0):
PORT=3000 npm startKept running by systemd, pm2 or a container like any Node server, or under
warden: warden run -- npm start.
Build on the machine it runs on (a Raspberry Pi builds it fine, only slower): the standalone
folder carries the node_modules it needs, for the platform it was built on.
Import the repository on vercel.com: it finds Next.js and builds it as
it is, with no settings to change. The standalone folder is made only off Vercel, which serves
the build itself. Set GITHUB_TOKEN (a fine-grained token with read access to public repositories
is enough) so the community page is not held to GitHub's 60 asks an hour per address.
The playground API keeps its teas in memory, and on Vercel every function instance has its own: a new instance starts from the shelf as it ships. That is all the playground needs.
app/ pages: the landing page, /docs, /api (the inkan app), /api/search
components/ the landing page's sections, the Remotion scenes, the code windows
content/docs/ the docs, as MDX
server/app.ts the playground API, an inkan app
scripts/ the step after next build that makes .next/standalone whole