π Introducing yet another js framework, Blazze.js
Build your web apps with ease
Blazze.js enables you to write Typesafe API's for the web with ease and powerfull Rust-based JavaScript tooling for the fastest builds. It makes you complete your projects blazzingly fast.
What's in Blazze ?
All you need to write API's with ease & peace π
1Routing
Keep the logic separated without any setup. Routes are based on the directory structure.
2Powered by SWC
Super speed transpilation via the power of Rust.
3Request Caching
Blazze handles caching automatically to optimize large computations in both dev and prod envs.
4TypeScript
No configurations and environment setup, just get started directly
5Fast & Robust
Built on top of express, for better developer experience.
6Build Optimization
Makes a single optimized bundle for your app
7Easy Setup
Hit `npx blazze-init` to start building your projects.
8No Boiler Plate Code
Install, Init and start, no imports, nothing else π
Start Building with Blazze.js
Not a new framework for you to learn, Zero learning curve, built to enhance developer experience. Get started by checking out few foundational rules of blazze.
npm install blazze@latest -g >> npx blazze-init
1 What is your project named ? (myApp)
2 What will be root endpoint for your project ? (api/v1)
3 Would you like to use TypeScript ? (yes)
4 Which port should the server listen to ? (3000)
5 Where would you like to keep your static content like html, imgs, etc ? (public)
6 Would you like to enable request caching ?
1Create & Configure
Get started quickly with Blazze cli. You will be asked a few questions to configure
blazze.config.js
YourBlazzeApp
βββ api/v1 (root-endpoint)
β βββ Route-1
β β βββ GET.ts
β β βββ POST.ts
β β βββ PUT.ts
β β βββ DELETE.ts
β β βββ PATCH.ts
β βββ Other-routes / ...
βββ blazze (for typescript)
βββ cache (if enabled)
βββ public (static-root)
βββ blaze.config.js (from blazze-init)
βββ package.json
βββ packagelock.json
βββ ...
2Project Structure
Blazze creates a root endpoint dir that you specified in the cli. You can add your
API
routes in it, each with its own respective files namely:GET
To handle get requestsPOST
To handle post requestsPUT
To handle put requestsPATCH
To handle patch requestsDELETE
To handle delete requests
1. For nested route like this "users/new/payments" create this
"users@new@payments" route folder.
2. For dynamic routes create folder with "_" (underscore)
at the beggining ex: "_users"
3Conventions
To have nested
API
routes use "@"
symbol, and for dynamic routes use "_"
underscore symbol.import { Request, Response } from "express";
export default async function (req: Request,res: Response){
// do something usefull here ...
let query = req.query;
let params = req.params;
}
4Start Building !
You need to
export
a default normal function from each file, this function recives express req
& res
objects from blazze.β οΈ Exporting arrow functions can cause build errors.
By developer, for developer's
Blazze is an opensource project to make API dev a breeze, become a part of the hottest JS community π₯ wheather you are a begginar like me π
or a JS chad π, and help me start my first opensource project.