1.2.2 • Published 5 years ago

@phnq/webapp v1.2.2

Weekly downloads
1
License
ISC
Repository
-
Last release
5 years ago

@phnq/webapp

CircleCI

npm version

Aggressively opinionated framework for building webapps. It's so opinionated that nobody should use it except me. This module is really just to help me repeat myself less in web projects.

  • React frontend, Node.js backend
  • Authentication, account management, including bare bones UI
  • WebSocket-based client/server communication with @phnq/message
  • State management with @phnq/state
  • Data persistence with @phnq/model

Usage

Client

import { WebappClient } from "@phnq/webapp/client";
import React, { Component } from "react";
import ReactDOM from "react-dom";
import UI from "./ui";

const server = {
  host: process.env.HOST,
  port: Number(process.env.PORT),
  secure: process.env.SECURE === "true"
};

class App extends Component {
  public render() {
    return (
      <WebappClient server={server}>
        <UI />
      </WebappClient>
    );
  }
}

ReactDOM.render(<App />, document.getElementById("app"));

Server

import { WebappServer } from "@phnq/webapp/server";

// Native Node.js HTTP server
const httpServer = http.createServer();
httpServer.listen(process.env.PORT);

// The Phnq Server just wraps the native server
const server = new WebappServer(httpServer);

// Tell the server where to discover the backend services
server.addServicePath(path.resolve(__dirname, "services"));
1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.32

5 years ago

1.0.31

5 years ago

1.0.30

5 years ago

1.0.29

5 years ago

1.0.27

5 years ago

1.0.26

5 years ago

1.0.25

5 years ago

1.0.24

5 years ago

1.0.23

5 years ago

1.0.22

5 years ago

1.0.21

5 years ago

1.0.20

5 years ago

1.0.19

5 years ago

1.0.18

5 years ago

1.0.17

5 years ago

1.0.16

5 years ago

1.0.15

5 years ago

1.0.14

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago