A modern React boilerplate for creating static projects
Start your static projects in seconds with an optimized architecture
Installation β’ Usage β’ Features β’ Examples
- π― About
- β¨ Features
- π Installation
- π Usage
- π Revalidation
- βοΈ Configuration
- π Examples
- π License
StaticJS is a powerful and modern boilerplate designed for creating static projects. It integrates development best practices and offers advanced features like specific page revalidation.
- β‘ Ultra-fast startup - Initialize your project in seconds
- π Smart revalidation - Rebuild specific pages on demand
- ποΈ Modern architecture - Optimized and maintainable project structure
- π Production ready - Production-ready configuration
- π± Responsive - Native support for all devices
| Feature | Description |
|---|---|
| π Fast generation | Project creation with a single command |
| π WebSocket Hot Reloading | Real-time WebSocket-based development reloading |
| π¦ Optimized build | Production-optimized bundle |
| π― Targeted revalidation | Specific page reconstruction via API |
| π οΈ Flexible configuration | Advanced customization according to your needs |
| π Performance | Automatic performance optimizations |
- Node.js >= 16.0.0
- npm >= 7.0.0
npm i @bouygues-telecom/staticjs -gπ‘ Tip: Global installation allows you to use the
create-staticjs-appcommand from anywhere on your system.
create-staticjs-appThis command will:
- π Create the folder structure
- βοΈ Configure base files
- π¦ Prepare the development environment
cd your-project
npm inpm run startπ Your project is now accessible at http://localhost:3300
StaticJS offers a unique targeted revalidation feature that allows rebuilding specific pages without rebuilding the entire project.
curl -X POST http://localhost:3000/revalidate \
-H "Content-Type: application/json" \
-d '{ "paths": ["page.tsx"] }'curl -X POST http://localhost:3000/revalidate \
-H "Content-Type: application/json" \
-d '{ "paths": ["home.tsx"] }'curl -X POST http://localhost:3000/revalidate \
-H "Content-Type: application/json" \
-d '{ "paths": ["home.tsx", "about.tsx", "contact.tsx"] }'your-project/
βββ π src/
β βββ π pages/ # Your pages
β βββ π components/ # Reusable components
β βββ π styles/ # Style files
β βββ π utils/ # Utilities
βββ π public/ # Static assets
βββ π package.json
βββ π server.js # StaticJS server
| Script | Description |
|---|---|
npm run build |
Build the project for production |
npm run start |
Start the production server |
This project is licensed under the MIT License. See the LICENSE file for more details.
Developed with β€οΈ by the Bouygues Telecom team