Skip to content

fachryansyah/fotonjs

Repository files navigation

FotonJS

The simple framework for building nodejs rest api with expressjs

Installation

install foton-cli

$ npm i -g foton-cli

creating project

$ foton create --project <project-name>

Manual

This boilerplate have a AuthServiceProvider for Manage authenticated user easily, like get authenticated user data, Atempt login, Logout authenticated user.

for example i want retrive authenticated user data, i just write code in the controller like this.

// import AuthServiceProvider
const Auth = require("../../Providers/AuthServiceProvider")

const UserController = {
    getProfile: async function(req, res) {

        // use the AuthServiceProvider
        const users = await Auth.user(req) // output should user data

        return res.json({
            "message" : "OKE!",
            "status" : 200,
            "data" : users
        })
    }
}

Todo

  • Seperate route and handler
  • Env configuration
  • Database Connection
  • ORM integration
  • Middleware
  • Auth Service Provider
  • Auto Migrate Database
  • Database seeder
  • Unit Testing
  • Code generator Like artisan laravel
  • Add Socket connection
  • BREAD Sample
  • End to end encryption connection

About

This is boilerplate for building Rest api expressjs

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published