Giter VIP home page Giter VIP logo

fastn-stack / fastn Goto Github PK

View Code? Open in Web Editor NEW
463.0 14.0 36.0 48.5 MB

๐Ÿšง (Alpha stage software) fastn - better way to build websites ๐Ÿšง

Home Page: https://fastn.com

License: GNU Affero General Public License v3.0

Rust 69.14% JavaScript 21.27% CSS 8.67% TypeScript 0.58% Python 0.01% WebAssembly 0.15% Clojure 0.11% WGSL 0.01% NSIS 0.03% Nix 0.02% Lua 0.02%
html-css-javascript json markdown static-site-generator rust rust-lang ft-code-repo hacktoberfest

fastn's Introduction

Contributors Issues License Discord

fastn

fastn - Full-stack Web Development Made Easy

ftd is a programming language for building user interfaces and content centric websites. ftd is easy to learn, especially for non programmers, but does not compromise on what you can build with it.

fastn is a web-framework, a content management system, and an integrated development environment for ftd. fastn is a webserver, and compiles ftd to HTML/CSS/JS, and can be deployed on your server, or on fastn cloud by FifthTry.

The quickest way to learn fastn is the short video course we have created: expander, it takes you through the basics.

Then checkout the frontend and backend sections of our documentation.

ftd: Programming Language For The Next Billion Programmers

ftd is designed with minimal and uniform syntax, and at first glance does not even look like a programming language.

No quotes for string, multi-line strings are easy

-- amitu: Hello World! ๐Ÿ˜€

-- amitu:

you can also write multiline messages easily!

no quotes. and **markdown** is *supported*.

We have called a "function" named "amitu" with "Hello World! ๐Ÿ˜€" as input, yet it does not feel technical.

This is what it produces:

img.png

Learn more about ftd Programming Language.

There are a lot of ready made ftd components available today

Ready made components can be imported and used.

-- import: fifthtry.github.io/bling/quote

-- quote.charcoal: Amit Upadhyay
label: Creator of FTD
avatar: $fastn-assets.files.images.amitu.jpg
logo: $fastn-assets.files.images.logo-fifthtry.svg

The web has lost some of the exuberance from the
early 2000s, and it makes me a little sad.

img_1.png

Or you can create your own components

Creating a custom component

-- component toggle-text:
boolean $current: false
caption title:

-- ftd.text: $toggle-text.title
align-self: center
text-align: center
color if { toggle-text.current }: #D42D42
color: $inherited.colors.cta-primary.text
background.solid: $inherited.colors.cta-primary.base
$on-click$: $ftd.toggle($a = $toggle-text.current)
border-radius.px: 5

-- end: toggle-text

-- toggle-text: `ftd` is cool!

toggle button

ftd's event handling capabilities can be used for form validation, ajax requests etc, to create fully functional frontend applications.

You Use fastn To Work With ftd

We ship pre built binaries for Linux, Mac and Windows.

curl -fsSL https://fastn.com/install.sh | bash

fastn.png

Integrated Web Development Experience

ftd and fastn come with package management, web server, opinionated design system, dark mode and responsive by default.

If you are getting started with frontend development, fastn framework takes care of a lot of things for you, and all you have to focus on is your product.

We are working towards our own hosted web based IDE, version controlled code hosting and collaboration platform so you and your team gets a one stop solution for building websites.

fastn for Static Sites

fastn websites can be compiled into static html, js, css etc, and can be deployed on any static hosting providers eg Github Pages, Vercel etc.

ftd source code of the page you are reading

-- import: fifthtry.github.io/bling/quote
-- import: fastn.com/ftd as ftd-index

-- my-ds.page: Overview of `fastn` and `ftd`

`ftd` is a programming language for building user interfaces and content centric
websites. `ftd` is easy to learn, especially for non programmers, but does not
compromise on what you can build with it.

ftd is a good alternative for content websites like blogs, knowledge bases, portfolio websites, project and marketing websites etc. It is cheap, fast, and requires little maintenance.

github-pages.png

Data Driven Website

fetching data from API

-- import: fastn/processors as pr

-- result r:
$processor$: pr.http
url: https://api.github.com/search/repositories
sort: stars
order: desc
q: language:python

Working With SQL Is Breeze

-- import: fastn/processors as pr

-- people:
$processor$: pr.package-query
db: db.sqlite

SELECT * FROM user;


-- show-person: $p
$loop$: $people as $p

fastn can be used to create data driven website, dashboards.

Dynamic URLs

-- fastn.dynamic-urls:

# Profile Page
url: /<string:username>/
document: profile.ftd

fastn can be used for creating a lot of web application backends as well.

Upcoming WASM Support

We are working on wasm support so developers can extend ftd's standard libraries and offer access to more backend functionalities.

wasm.png

Hosting Dynamic Sites

For dynamic sites you can deploy fastn cli on the platform of your choice. We ship ready made Docker containers that you can add to your infrastructure.

fastn Cloud

We also offer our own hosting solution for your static and dynamic sites. Using fastn Cloud frees you from devops needs, and you get a fully integrated, managed hosting solution, that a non programmers can use with ease.

Usage with Nix

nix run github:fastn-stack/fastn

In a flake.nix file:

{
  inputs = {
    flake-utils.url = "github:numtide/flake-utils";
    nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
    fastn.url = "github:fastn-stack/fastn";
  };

  outputs = { self, flake-utils, nixpkgs, fastn }:
    flake-utils.lib.eachDefaultSystem (system:
      rec {
        # nix develop
        devShell = pkgs.mkShell {
          nativeBuildInputs = [ fastn ];
        };
      }
    );
}

Contributors

Arpita Jaiswal
Arpita Jaiswal

๐Ÿ’ป ๐Ÿ“– ๐Ÿ’ก ๐Ÿ“‹ ๐Ÿค” ๐Ÿšง ๐Ÿง‘โ€๐Ÿซ ๐Ÿ‘€ ๐Ÿ”ง โš ๏ธ โœ… ๐Ÿ“น ๐Ÿ“
Amit Upadhyay
Amit Upadhyay

๐Ÿ’ป ๐Ÿ“– ๐Ÿ’ก ๐Ÿ“‹ ๐Ÿค” ๐Ÿšง ๐Ÿง‘โ€๐Ÿซ ๐Ÿ‘€ ๐Ÿ”ง โš ๏ธ โœ… ๐Ÿ“น ๐Ÿ“
Rithik Seth
Rithik Seth

๐Ÿ’ป ๐Ÿ“– โš ๏ธ ๐Ÿค” ๐Ÿ‘€ ๐Ÿšง ๐Ÿ“
Ganesh Salunke
Ganesh Salunke

๐Ÿ’ป ๐Ÿ“– โš ๏ธ ๐Ÿค” ๐Ÿง‘โ€๐Ÿซ ๐Ÿ‘€
Priyanka
Priyanka

๐Ÿ’ป ๐Ÿ“–
Ajit Garg
Ajit Garg

๐Ÿ’ป ๐Ÿ“– ๐Ÿ“
Abrar Khan
Abrar Khan

๐Ÿ’ป ๐Ÿ“– ๐Ÿ‘€ โš ๏ธ
Shobhit Sharma
Shobhit Sharma

๐Ÿ’ป ๐Ÿ“– โš ๏ธ
Aviral Verma
Aviral Verma

๐Ÿ’ป ๐Ÿ“– โš ๏ธ ๐Ÿค”

License

This project is licensed under the terms of the AGPL-3.

Examples

The following examples are intended for testing purposes and showcase the range of capabilities of ftd language, from basic to advanced use cases. These examples are provided to ensure the proper functioning of ftd and to highlight its diverse features.

You can find the examples at the following link: https://fastn-stack.github.io/fastn/

fastn's People

Contributors

abhiramiyer avatar abrarnitk avatar aditirai290698 avatar akasahi avatar allcontributors[bot] avatar amitu avatar arcoprova avatar arpita-jaiswal avatar artstyle46 avatar aviralverma13 avatar dependabot[bot] avatar fossabot avatar gsalunke avatar harshdoesdev avatar heulitig avatar ishaan701 avatar notnotrachit avatar priyanka9634 avatar sharmashobhit avatar siddhantk232 avatar sourabh-garg avatar wasif1024 avatar wilderbitnet avatar xypnox avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fastn's Issues

do not include variables with no dependencies in HTML

In generated HTML we currently include:

  "fpm#document-id": {
    "value": "FPM.ftd",
    "dependencies": {}
  },

These are not needed by operation of event handlers as dependencies is empty. Only entries with non empty dependencies must be included.

ftd.markup: `color` is not conditional

-- ftd.markup markup:
body body:
value: $body
color: $ft.neutral-700
color if $fpm-ui.dark-mode: $ft.neutral-200

Is not having the desired effect, text color is not changing.

`$CHILDREN_COUNT`

For a container component, eg ones based on ftd.row or ftd.column, the number of outside children, would be stored in a variable $CHILDREN_COUNT.

-- ftd.row foo:

--- ftd.integer: $CHILDREN_COUNT

-- foo:

--- ftd.text: child one
--- ftd.text: child two

In this case, technically the row has three children, one is the ftd.integer, but only the ftd.text passed from outside are counted as real children.

Same with this:

-- foo:
open: false
id: f

-- container: f

-- ftd.text: child one
-- ftd.text: child two

Also this is equivalent:

-- ftd.row foo:
append-at: inner-main

--- ftd.integer: $CHILDREN_COUNT
--- ftd.column:
id: inner-main

-- foo:

--- ftd.text: child one
--- ftd.text: child two

In all examples, $CHILDREN_COUNT is 2.

logical linking

How to create links such that they work with CRs/Versions/Translation etc? Eg if intro.ftd of a v2 of Ensligh is linking to tutorial.ftd, and reader is viewing v27 of Spanish, the link works (takes you to to Spanish tutorial in v27).

https://www.fifthtry.com/fpm/~/2/

optional list component argument not working correctly

Say I have following in lib.ftd:

-- toc-item list toc:

-- ftd.column doc-page:
toc-item list toc: $toc
width: fill
open: main-container

And I try to use it from index.ftd:

-- lib.doc-page:

-- lib.h0: Upgrade `fpm`

We get: Error: PackageError { message: "failed to parse ParseError { message: \"toc is not present in doc, Err(ParseError { message: \\\"how-to/update.ftd: not found (\\\\\\\"toc\\\\\\\"), f: get_thing\\\", doc_id: \\\"index.ftd\\\", line_number: 4 })\", doc_id: \"index.ftd\", line_number: 4 }" }.

Implement recursion check

If a module is importing itself directly or indirectly, ftd interpreter should detect this and abort with error instead of overflowing the stack.

access parent variables using `$PARENT`

-- ftd.row foo:
integer current: 0

--- child:

--- ftd.integer: $CHILDREN_COUNT


-- ftd.text child: $title
caption title:
if: $SIBLING-INDEX == $PARENT.current
$on-click$: increment $PARENT.current clamp $PARENT.CHILDREN-COUNT

-- foo:

--- child: child one
--- child: child two

ftd.markup should inherit inline component definitions recursively

As of now its only looking for components defined directly as child of ftd.markup component, not when component is being initialised:

-- markup:

{ftd} is a language to create web pages or documents for
publishing on the web. It starts with Markdown, but adds features to create full
page layouts, lets you create reusable "ftd components", and has first class 
support for data modelling, so the `ftd` document can be used as an data exchange
format as well (as a replacement of JSON/CSV etc).

`fpm` is "`ftd` package manager", defines a package format for packaging `ftd` 
files. `fpm` packages can depend on other `fpm` packages, and `fpm` can install
all the dependencies of a package.

`fpm` can also convert `ftd` files to static HTML files, so you can publish FTD 
files on github pages, S3 etc static site hosting sites.

/--- ftd.text ftd: you can not yet define this, you have to put it in the definition of `markup` itself
link: /


-- ftd.markup markup:
body body:
optional boolean collapsed:
optional caption title:
value: $body
color: $ft.neutral-700
color if $fpm-ui.dark-mode: $ft.neutral-200
padding-bottom: 8

--- ftd.text ftd:
link: /

record fields can not be used with if

-- record character:
caption name:
string dexterity:

-- dd wizard: Wizard
dexterity: high

-- show-dd:
character: $wizard

-- ftd.row show-dd:
character c:

--- ftd.text: $c.name

--- ftd.text: Armour: High
if: $c.dexterity == high

--- ftd.text: Armour: Low
if: $c.dexterity == low

line-height is not conditional

line-height if $fpm-ui.mobile: 34 doesn't work and throws error:

Error: PackageError { message: "failed to parse ParseError { message: \"unknown style name: `line-height` value:`Integer { value: 34 }`\", doc_id: \"index.ftd\", line_number: 527 }" }

email text color not changing - always blue

email-blue-color

-- ftd.text author-email: $title
caption title:
color if $fpm-ui.dark-mode: #BFBFBF
color: #000000
size: 24
line-height: 28
align: left
font: Itim

though in above code color is mentioned still it takes default blue color for email! check attached output screen-grab

ftd.markup to accept `{$variable}`

We can currently do:


-- ftd.markup:

Hello, {name}.

-- ftd.text name: $name

We should be able to also do:


-- ftd.markup:

Hello, {$name}.

`$private$` on records record, variables, components

-- integer foo: 20
$private$: true


-- ftd.text foo: 20
$private$: true

-- record foo:
$private$: true
boolean private:

This should be at "package" level, but FTD has no concept of a package, only FPM does. How to think about this?

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.