Giter Club home page Giter Club logo

fssnip.website's Introduction

F# Snippets web site

This is a work-in-progress project to build a new version of the www.fssnip.net web site. The project has some basic structure, but there is still a lot of work that needs to be done, so I'm looking for contributors!

Running web site locally

There is one manual step you need to do before you can run the web site locally, which is to download sample data. To do this, download data.zip from this web page and extract the contents into data (so that you have data/index.json) in your root.

Once you're done with this, you can run build.sh (on Mac/Linux) or build.cmd (on Windows) to run the web site. There is also a Visual Studio solution which can be started with F5, but the build scripts are nicer because they automatically watch for changes.

Project architecture & structure

In the current (development) version, the project uses file system as a data storage. In the final version, we'll store the snippets in Azure blob storage (see the issue for adding this).

The web page is mostly read-only. There are about 2 new snippets per day, so insertion can be more expensive and not particularly sophisticated. Also, the metadata about all the snippets is quite small (about 1MB JSON) and so we can keep all metadata in memory for browsing. When a snippet is inserted, we update the in-memory metadata and save it to a JSON file (in a blob).

So, if you download the data.zip file (above), you get the following:

  • data/index.json - this is the JSON with metadata about all snippets. This is loaded when the web site starts (and it is updated & saved when a new snippet is inserted)
  • data/formatted/<id>/<version> is a file that contains formatted HTML for a snippet with a specified ID; we also support multiple versions of snippets.
  • data/source/<id>/<version> is a file with the original source code for a snippet

Other most important files and folders in the project are:

  • app.fsx defines the routing for web requests and puts everything together
  • code/pages/*.fs are files that handle specific things for individual pages
  • code/common/*.fs are common utilities, data access code etc.
  • templates/*.html are DotLiquid templates for various pages
  • web/* is folder with static files (CSS, JavaScript, images, etc.)

fssnip.website's People

Contributors

abjrcode avatar darklajid avatar forki avatar ilmaestro avatar marcinjuraszek avatar patrick-mackay avatar takemyoxygen avatar tpetricek avatar

Watchers

 avatar

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.