A minimal React framework with file-based routing and TypeScript-first approach.
- ⚡️ Vite-powered development
- 🗂 File-based routing (Next.js style)
- 🛠 TypeScript support out-of-the-box
- 🚀 Zero-config setup
- 🔥 Hot Module Replacement (HMR)
Create a new project with:
npx revine my-projectnpx revine <project-name>Generated projects follow this structure:
my-project/
├── src/
│ ├── pages/ # Route components
│ │ └── index.tsx
│ ├── App.tsx # Router configuration
│ └── main.tsx # Entry point
├── public/ # Static assets
├── vite.config.ts # Vite configuration
└── package.json
src/pages/index.tsx → /
src/pages/about.tsx → /about
src/pages/blog/[slug].tsx → /blog/:slug
Revine includes built-in support for cached API calls, allowing you to easily store and reuse server responses.
A wrapper around the native fetch API with caching capabilities.
import { revineFetch } from "revine";
const data = await revineFetch("https://api.example.com/data", {
cacheTTL: 60000, // Cache for 1 minute (in ms)
persist: true // Optional: Persist to localStorage
});A React hook for making cached API calls within components.
import { useFetch } from "revine";
function MyComponent() {
const { data, loading, error, revalidate } = useFetch("https://api.example.com/data", {
cacheTTL: 300000, // 5 minutes
persist: true
});
if (loading) return <div>Loading...</div>;
if (error) return <div>Error: {error.message}</div>;
return (
<div>
<pre>{JSON.stringify(data, null, 2)}</pre>
<button onClick={() => revalidate()}>Refresh Data</button>
</div>
);
}git clone [https://github.com/your-username/revine.git](https://github.com/rachit-bharadwaj/revine)npm installnpm run build
npm linkrevine test-project