Giter VIP home page Giter VIP logo

krixano / zeronet-dev-center Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 1.33 MB

A Development Center for the ZeroNet. Tutorials on ZeroNet Zite Development, Collaboration, and Questions

Home Page: http://127.0.0.1:43110/14pM9huTYzJdyQyHRj6v2kfhMe8DrxwpGt/

License: MIT License

CSS 76.61% HTML 5.20% JavaScript 18.19%
zeronet zite tutorials collaboration question-answering buefy vuejs bulma

zeronet-dev-center's Introduction

ZeroNet-Dev-Center

A Development Center for the ZeroNet. Tutorials on ZeroNet Zite Development, Collaboration, and Questions

Our Goal is to provide useful information, tutorials, and help to those who want to develop Zites in order to inspire more development on the ZeroNet. This site will not teach the basics of front-end web development (this may change in the future). This site only focuses on ZeroNet-specific development, including the ZeroFrame API.

Finished Tutorials

Tutorials In Progress

Tutorial Ideas

  • Database Basics
  • User login
  • Building a basic dynamic zite
  • Client-Side Routing (pushState, etc.)
  • Setting Up Git/Github with ZeroNet
  • How siteowner can modify each users' data.json file
  • Optional Files
  • Encrypting User's Private Data
  • Merger Zites
  • How Certificate Authorities Work

Want to Write A Tutorial?

If you would like to help me out and write a tutorial, either from one above or one you come up with that you think is needed, simply create an Issue detailing what you want the tutorial to cover and (anytime you think of it), it's outline. This allows people to talk about what the tutorial should or shouldn't include.

Since I don't have a system up for creating tutorials on the zite, you will have to do it through Github for now. Simply fork this repository and create your tutorial in a markdown file in the tutorials directory. Once you have completed the tutorial, create a pull request. Then, the tutorial will go through a review for corrections, additions, deletions, etc. If the people involved agree that the tutorial is well enough to be published, I will merge the pull request.

zeronet-dev-center's People

Contributors

anoadragon453 avatar anthyg avatar krixano avatar rllola avatar

Stargazers

 avatar

Watchers

 avatar  avatar

zeronet-dev-center's Issues

Dynamic Markdown-loading System

This "Dynamic System" should load a Tutorials Markdown-File and present it in HTML, which means, the file can't be accessed directly (e.g. /tutorials/Tutorial_1.html), but has to be accessed via query-string (e.g. /tutorials?Tutorial_1).
Then of course, there also has to be a dynamic list on the main /tutorials-Page, containing all the tutorials in the subdir /tutorials.
The list probably has to be saved in the Database (which is, kind of already happening (but there is an error with the json-Table)).

The system at it's base, won't be that hard to code (just FYI ๐Ÿ˜‰) (Markdown-it should work just fine, I think).

Questions Edit Route

When going directly to the questions edit route (on first load of the zite), there is a problem where I am not able to access the site_info from the before hook (I need to access it to check that the current user is the one who posted the question, if not, I don't let the route resolve - by returning false from the before hook).

This is because the before hook is happening before site_info is set. Usually this would be fixable by just calling the function that set's site_info before the function that eventually calls the before hook, however this is already the case and it doesn't work because the ZeroFrame command that set's site_info happens asynchronously - it doesn't wait until it is done before eventually calling the before hook.

I could fix this by having the Router start (init) in the callback function from the ZeroFrame command. This would wait until site_info is set before the router starts working. However, not only will the routing lag until the site_info is set (only on first load of the zite) but also setting the correct vuejs component for the current route will lag.

The other way I could fix this is just by allowing the route to resolve, then once site_info is set, check that the current user can edit the question, and if not, navigate back. However, this will show the page for a second (until site_info is set), then go back instead of it just not showing the page at all.

Support syntax highlighting

In markdown, you can specify the language you are using in a code block by doing something like this: ```javascript
Markdown parses this and puts a class on the code block (language-javascript in this case). So all I would need to do is include a library that uses this to highlight the text properly.

Editing and Deleting Posts

  • Edit Questions
  • Edit Answers
  • Edit Comments
  • Delete Questions
  • Delete Answers
  • Delete Comments

Issue #16 will need to be done before implementing the deletion of posts.

Create a ZeroNet plugin tutorial

Hello,

Would a tutorial on how to create a plugin have its place on ZeroNet Dev Center ? It is not directly linked to zite but allow to enhance ZeroNet and can also introduce new feature in zite.

The Basics Tutorial

This will be the tutorial that introduces the very basics needed in order to start creating zites. It will cover how zites work, where they are stored, how they are updated, how content.json files are constructed, and how a zite is kept secure using signatures. You can view the tutorial here.

Topics Covered:

  1. Introduction ( @krixano )
  2. Creating A Zite ( @krixano, @AnthyG )
  3. The Sidebar ( @AnthyG )
    • Zite Address
    • Changing Basic Zite Settings
  4. Where You Zite is Stored Locally
  5. Content.json File - What is It? ( @krixano )
  6. Signing the Content.json File ( @krixano )
  7. How Zites Are Kept Secure ( @krixano )
  8. Publishing Your Zite ( @krixano )
  9. Keeping Your Zite Online ( @krixano )
  10. Updating Your Zite ( @krixano )

Topics and their orders may change in the future.

Database Basics

This tutorial should talk about setting up databases (including json files specific to users) and using them in your projects.

  • Talk about how Databases work in ZeroNet
    • JSON Files
    • Database File
    • How Database is Updated
  • Setting up the dbschema.json file
    • db_name and db_file
    • version
    • maps and how they connect the json files to the database
    • tables
      • All the types/options for the Columns (talk later about the json_id column)
      • indexes (talk later on about why you must add an index linking to json_id)
      • schema_changed and how it is involved in the updating of the database
    • What the json table is used for
      • to_json_table in maps
    • What the keyvalue table is used for
      • to_keyvalue in maps
  • Tool(s) you can use to look into sqlite database files

ZeroFrame API Basics

This Tutorial Should talk more about the ZeroFrame API and the most useful API calls when starting out.

  • Wrapper API Calls
    • Open New Window
    • Notification
    • Prompt and Confirm
    • Push and Replace State (link to my ZeroFrame Router library)
  • Files
    • File Get
    • File Query
    • File Write
    • File Delete
  • Sign and Publish
  • Link to ZeroNet Docs Zite
  • Link to ZeroFrame Docs from Dev Center (when available)

Users In ZeroNet

This tutorial should talk about these things:

  • Certificate Authorities (zeroid.bit, kaffie.bit, cryptoid.bit)
    • How ids/certificates are generated
    • Decentralized vs. Centralized
    • How ids/certificates are verified
  • Username Uniqueness
  • Auth public and private keys
    • Generated and different for each zite you login to
    • When id providers generate your certificate, they use this default auth address as the auth address for your user id.
  • Special section on the exact process ZeroId does when registering a new id
  • How to Allow Logins on Your Zite

Code Review Tutorial Series/Track

It might be cool to do some type of tutorial series/track that goes through an existing zite's code step by step and explaining everything that it does. It may help people understand how current zites do things, especially database-wise, etc. Just an interesting thought I had. Will most definitely be a long series and take a lot of work to create though.

User Permissions/Roles

I'm unsure how to do user roles/permissions. For example, I want to let some users be writers - they are allowed to write tutorials, some will be editors - they can only edit existing tutorials and not create new tutorials, etc. I'm not sure how I should setup the database for this, etc.

Merger Zite(s)

The Questions part of the zite should use a merger zite (so other zites can access the data).

When I turn it into a merger zite, I would also want to add some way to determine it's topic, because I want people to be able to clone it for different topics (like Stack Exchange).

Databases In ZeroNet

This will give the most basic concepts on how databases work within ZeroNet. I was going to put this into the Database Basics tutorial; however, what this new one will contain is essential information for understanding the Users In ZeroNet tutorial.

This tutorial should talk about content.json files, what they are used for. A very short description of the dbschema file. How json files are used to store information. How the database is reloaded upon a change of the dbschema file. How the database is rebuilt (modified?) when a modified json file has been received.

Major Code Cleanup

There are certain things in the code that are pretty terrible, like doing a database query for comments multiple times instead of just once (especially since some of the queries get the same information), etc.

Static Zite

This is the next tutorial. It will cover creating a static zite, along with setting options in the content.json file and some information on the ZeroFrame class and it's methods.

  • Starting with an empty zite
  • Where your zite's files are located
  • Setting options in content.json
  • The ZeroFrame class
    • onOpenWebsocket
    • onRequest
  • Signing and Publishing
  • Link to content.json docs (from ZeroDocs Zite)
  • Link to zeroframe api docs (from ZeroDocs Zite)
  • Link to ZeroFrame API tutorial (once written)

Following Functionality

Add a button to follow things so you are notified of any new posts/comments in your feed on ZeroHello. Things you can follow:

  • Blog
  • Blog Post Comments
  • New Tutorials
  • Comments on tutorials
  • Mentions
  • Questions
  • Questions that use a specific tag
  • Question Answers
  • Answers on your questions
  • Comments on your answers

Keyvalue Table

Use keyvalue table to store next_[blank]_id for next question id, answer id, etc. that way I can implement deleting (issue #12). Currently, if someone deleted their last/latest question, then added another question, the id would be the same as the question they just deleted which means all answers and comments that referenced the deleted question would now reference the new question - this is obviously not a good thing. Therefore, using a next_question_id will allow me to skip over id's that were deleted (because currently I calculate the id of a posted question by getting the id of last (most recently posted) question of the current user from the database and adding 1).

Blog

A blog so I can post about new and upcoming features and tutorials for the zite.

Tutorial Tracks

This is not definite. It's just an idea.

It might be good to have tutorial tracks which are like overall topics that many tutorials cover. For example, there may be a zeronet plugin scripting track, a the basics track, (maybe) a databases track (for the basics of databases as well as more advanced things, including database optimization), etc. where each have multiple tutorials that cover one aspect of the overall topic and build upon each other.

Expand Questions

Expand Questions to include these features:

  • Mark answer as solution
  • Show solution as first answer
  • Voting on questions
  • Voting on answers
  • Sort answers by votes
  • Liking comments
  • Tags
  • See list of questions with a certain tag (route: questions/tags/:tag)
  • Search through Questions
    • Search by date
    • Search by time
  • Show Related Questions (based on tags and title of question)

Switch From Cert_User_Id To Auth_Address

I have been informed by @kaffie and @Plasmmer (and other people) that it is not guaranteed that user id's (except of zeroid) are unique. Therefore it is better to manage referencing things by the auth_address instead, which are guaranteed to be unique.

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.