A fully featured web MVC framework for NodeJS

OstroJS is a framework that can grow with you, whether you're new to NodeJS or web frameworks or have years of expertise. We'll guide you through your initial steps as a web developer or give you a boost as you advance your skills. We're excited to see what you come up with.

Installation Configuration Directory Structure Deployment Request Lifecycle Service Container Service Providers Routing Middleware Controllers Assistant Console Cache
const route = require('@ostro/support/facades/route')
route.get('/greeting', function ({ response }) {
    response.send('Hello World');
});
route.domain('admin.domain.com').group(function(route){
    route.prefix('users').middleware('admin').name('admin.users.').group(function(route){
        route.put('profile','adminController::updateProfile').name('profile.update');
        // Route assigned name "admin.users.profile.update" Matches The "admin.domain.com/users/profile" URL and
    })
})

route.view('/welcome', 'welcome', {'name' : 'Amar'});
const Controller = require('~/app/http/controllers/controller');
const User = require('~/app/models/user')

class UserController extends Controller {

    async show({view,params}) {
        view('user.profile', {
            'user' : await User.findOrFail(params.id)
        });
    }
}

module.exports = UserController
route.get('/user/:id', 'userController::show');
let Flight = require('~/app/models/flight');

let flights = await Flight.where('active', 1)
               .orderBy('name')
               .take(10)
               .get();

let flight = await Flight.create({
    'name' : 'London to Paris',
});

let user = await DB.table('users').where('name', 'John').first();

console.log(user.email);
/**
 * Store a new blog post.
 */
async store({ request }) {
    await request.validate({
        'title': 'required|unique:posts|max:255',
        'body': 'required',
    });

    // The blog post is valid...
}
const Controller = require('~/app/http/controllers/controller');

class LoginController extends Controller {
    async login({ request, validate, auth, redirect }) {
        await this.validate(request, {
            'email': 'required|email',
            'password': 'required'
        })
        if(await auth.attempt(credentials)){
            return redirect.route('admin.dashboard.index');
        }
        return redirect.withInput().withErrors({email:['Invalid email password']}).back();
    }

}

module.exports = LoginController
const Crypt = require('@ostro/support/facades/crypt')
let decrypted = Crypt.decryptString($encryptedValue);
const Hash = require('@ostro/support/facades/hash')
let $hashed = Hash.make('password', {
    'rounds' : 12,
});
let $value = await Cache.get('key');

let $value = await Cache.get('key', 'default');
await Cache.put('key', 'value');
await Storage.disk('s3').put('avatars/1', $content);
let $path = await request.file('avatar').storeAs(
    'avatars', (await request.user()).id
);
await Storage.put('avatars/1', $content);
await Storage.disk('s3').delete('path/file.jpg');
Log.info('User failed to login.', {'id' : $user.id});
Log.channel('slack').info('Something happened!');

Framework Architecture

OstroJS is a web application framework with a syntax that is both expressive and beautiful. A web framework gives your application structure and a starting point, allowing you to concentrate on building something wonderful while we sweat the specifics. OstroJS is full featured MVC framework for NodeJS.

Development

Easy and fast development.

Flexiblity

Full controller over framework.

Performance

Cluster and caching.

Deployment

Easy to deploy on Any Server.


A Framework for Progressive

OstroJS is a "progressive" framework, as we like to call it. That is to say, OstroJS improves along with you. If you're new to web development, Ostro's extensive library of tutorials and instructions can help you get started without feeling stressed.

20+ packages

from OstroJS

Javascript

Designed Pattern

© 2021-2022 All right Reversed. NPM Discord Slack