All Projects → remoteinterview → zero

remoteinterview / zero

Licence: Apache-2.0 license
Zero is a web server to simplify web development.

Programming Languages

javascript
184084 projects - #8 most used programming language
python
139335 projects - #7 most used programming language
Vue
7211 projects

Projects that are alternatives of or similar to zero

Koa React Universal
lightweight React-Koa2 universal boilerplate, only what is essential
Stars: ✭ 112 (-98.08%)
Mutual labels:  hmr, ssr
react-ssr-starter
📚 Featuring Webpack 4, React 17-18, SSR, HMR, prefetching, universal lazy-loading, and more
Stars: ✭ 18 (-99.69%)
Mutual labels:  hmr, ssr
react-redux-typescript-dotnet-core-ssr-hmr
React + Redux + TypeScript + .NET Core + Server-Side Rendering (SSR) + Hot Module Replacement (HMR)
Stars: ✭ 17 (-99.71%)
Mutual labels:  hmr, ssr
Webpack Hot Server Middleware
🔥 Hot reload webpack bundles on the server
Stars: ✭ 319 (-94.53%)
Mutual labels:  hmr, ssr
Ts React Boilerplate
Universal React App with Redux 4, Typescript 3, and Webpack 4
Stars: ✭ 104 (-98.22%)
Mutual labels:  hmr, ssr
React Firebase Starter
Boilerplate (seed) project for creating web apps with React.js, GraphQL.js and Relay
Stars: ✭ 4,366 (-25.18%)
Mutual labels:  hmr, ssr
react-kits
⚔️ Opinionated Fullstack React toolkits featuring project generation, dev server, build production bundle, and common dev-tools. This is simple DIY create-react-app.
Stars: ✭ 13 (-99.78%)
Mutual labels:  hmr, ssr
Aspnetcore Angular Universal
ASP.NET Core & Angular Universal advanced starter - PWA w/ server-side rendering for SEO, Bootstrap, i18n internationalization, TypeScript, unit testing, WebAPI REST setup, SignalR, Swagger docs, and more! By @TrilonIO
Stars: ✭ 1,455 (-75.06%)
Mutual labels:  hmr, ssr
Reeakt
A modern React boilerplate to awesome web applications
Stars: ✭ 116 (-98.01%)
Mutual labels:  hmr, ssr
electron-react-bloatfree
A simple alternative to electron-react-boilerplate
Stars: ✭ 17 (-99.71%)
Mutual labels:  hmr
ng-universal
Angular Universal & SEO Utilities/Helpers - Brought to you by Trilon
Stars: ✭ 39 (-99.33%)
Mutual labels:  ssr
LeelaMasterWeight
Leela Master weight is training from leela zero self-play sgf and human sgf file
Stars: ✭ 49 (-99.16%)
Mutual labels:  zero
svelte-loader-hot
Webpack loader for svelte components with HMR support
Stars: ✭ 22 (-99.62%)
Mutual labels:  hmr
personal-website
Personal website – made with Next.js, Preact, MDX, RMWC, & Vercel
Stars: ✭ 16 (-99.73%)
Mutual labels:  ssr
svelte-template-hot
Copy of official Svelte template with added HMR support
Stars: ✭ 61 (-98.95%)
Mutual labels:  hmr
react-auth-kit
universal react app with flux, altjs, passportjs and server side rendering
Stars: ✭ 21 (-99.64%)
Mutual labels:  ssr
react-typescript
React16 + HMR + typescript + webpack + tslint + tests
Stars: ✭ 21 (-99.64%)
Mutual labels:  hmr
Zero
Zero Currency Blockchain Project
Stars: ✭ 19 (-99.67%)
Mutual labels:  zero
async-react-router
Client side react router with async. It like next.js!
Stars: ✭ 21 (-99.64%)
Mutual labels:  ssr
react-redux-immutable-webpack-ssr-starter
React + React-Router 4 + Redux + ImmutableJS + Bootstrap + webpack 3 with with Server side rendering, Hot Reload and redux-devtools STARTER
Stars: ✭ 21 (-99.64%)
Mutual labels:  ssr

Zero Server

Zero configuration web framework.

Features | Installation | Getting Started | Examples | Docs

Join the community on Discord


Zero is a web framework to simplify modern web development. It allows you to build your application without worrying about package management or routing. It's as simple as writing your code in a mix of Node.js, React, HTML, MDX, Vue, Svelte, Python, and static files and putting them all in a folder. Zero will serve them all. Zero abstracts the usual project configuration for routing, bundling, and transpiling to make it easier to get started.

An example project with different types of pages, all in one folder:

A basic mono-repo

Features

Auto Configuration: Your project folder doesn't require config files. You just place your code and it's automatically compiled, bundled and served.

File-system Based Routing: If your code resides in ./api/login.js it's exposed at http://<SERVER>/api/login. Inspired by good ol' PHP days.

Auto Dependency Resolution: If a file does require('underscore'), it is automatically installed and resolved. You can always create your own package.json file to install a specific version of a package.

Multiple Languages: Zero is designed to support code written in many languages all under a single project. Imagine this:

  1. Exposing your Tensorflow model as a python API.
  2. Using React pages to consume it.
  3. Writing the user login code in Node.js.
  4. Your landing pages in a mix of HTML or Markdown/MDX.

All under a single project folder as a single web application.

Play on Glitch

You can play with Zero without installing it locally. Click the button below:

remix this

Installation

You can install zero globally by:

npm install -g zero

Getting Started

Let's start by making a website that tells us server time.

First we need to create an API endpoint in Node.js to tell us time in JSON.

Create a new folder and add a new file time.js in that folder. In this file, export a function that accepts Request and Response objects (like Express):

// time.js
const moment = require("moment");

module.exports = (req, res) => {
  var time = moment().format("LT"); // 11:51 AM
  res.send({ time: time });
};

Once saved, you can cd into that folder and start the server like this:

zero

Running this command will automatically install any dependencies (like momentjs here) and start the web server.

Open this URL in the browser: http://localhost:3000/time

You just created an API endpoint 🎉:

Time API

Keep the server running. Now let's consume our API from a React page, create a new file index.jsx and add the following code:

// index.jsx
import React from "react";

export default class extends React.Component {
  static async getInitialProps() {
    var json = await fetch("/time").then(resp => resp.json());
    return { time: json.time };
  }

  render() {
    return <p>Current time is: {this.props.time}</p>;
  }
}

This is a standard React component. With one additional hook for initial data population:

getInitialProps is an async static method which is called by zero when the page loads. This method can return a plain object which populates props.

Now go to this URL: http://localhost:3000/ and you should see the current server time rendered by React while fetch-ing an API endpoint you created earlier:

Time In React

zero automatically bundles your code and supports server-side rendering. You don't need to fiddle with webpack anymore.

That's it! You just created a web application.

Supported Languages

Auto Dependency Resolution

If a file does require('underscore'), the latest version of that package is automatically installed from NPM and resolved.

But sometimes you want to use a specific version or a dependency from a private repository. You can do that by creating a package.json in your project folder and adding dependencies to it. Zero will install those versions instead.

Example (package.json):

{
  "name": "myapp",
  "dependencies": {
    "underscore": "^1.4.0",
    "private_ui_pkg": "git+https://github.com/user/repo.git"
  }
}

Contributing

Please see our CONTRIBUTING.md

License

Zero is Apache-2.0 licensed.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].