GithubHelp home page GithubHelp logo

jstnmthw / jx Goto Github PK

View Code? Open in Web Editor NEW
8.0 1.0 0.0 415 KB

An opinionated application starter kit built on NextJS tailored for Laravel's Sanctum API.

Home Page: https://jx-next.vercel.app

License: MIT License

JavaScript 1.08% TypeScript 97.76% CSS 1.16%
nextjs react sanctum-authentication tailwindcss typescript

jx's Introduction

Jx - Starter kit for NextJS apps.

ts ts

An opinionated application starter kit to built on NextJS tailored to Laravel Sanctum API. The authentication is mainly focused on using Laravel's backend API which utilizes CRSF token for secure authentication and sessions.

Features

  • Laravel Sanctum compatible
  • Authentication
  • Roles & Permissions
  • Data Tables
  • Dark Mode
  • SWR Requests

Packages Included

The following are preinstalled and ready out of the box for quick application scaffolding.

Getting Started

Create an .env file and place your API url.

NEXT_PUBLIC_BACKEND_URL=http://localhost:8000

Development

First, run the development server:

npm run dev
# or
yarn dev

Open http://localhost:3000 with your browser to see the result.

You can start editing the page by modifying pages/index.tsx. The page auto-updates as you edit the file.

Production

Build and run your NextJS app.

npm run build && npm run start

TypeScript

Strict mode is set by default.

npm run type-check
# or
npm run tc

Documentation

User Model

In order for authentication to work out of the box, some assumptions need to be made. The following is how we assume your User model is set up. Jx checks for the role Admin behind the scenes and is what is checked for /admin/ dashboard.

{
  "id": 1,
  "name": "Justin",
  "email": "[email protected]",
  "avatar": "https://www.gravatar.com/avatar/xx?d=blank",
  "enabled": true,
  "email_verified": true,
  "created_at": "2022-01-01T00:00:00.000000Z",
  "roles": [
    {
      "id": 1,
      "name": "User"
    },
    {
      "id": 2,
      "name": "Admin"
    }
  ]
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.