Skip to content

xrviv/Simple-Nostr-Tutorial-Series

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Nostr Tutorial Series

  • Who: For beginner programmers who want to learn how to build on Nostr
  • What: A course with the assumption that the user has the least amount of knowledge.
    • Minimum knowledge requirements:
      • HTML, javascript, linux, node.js
      • At least what Nostr is all about.
  • Why: I want to learn as well.
  • How: The course will be 100% sourced through prompts from ChatGPT4. Assume that I am copying almost verbatim from ChatGPT. I will be testing this as I go along
  • Problems: Pull requests, issues, suggestions and corrections welcome.

Disclaimer: I am learning about Nostr myself and absolutely do not consider myself an expert on the matter. This is experimental. I could not vouch for the security or feasibility of any of the code. In short, by following this, you are taking responsibility for your own risks. Warning: As of March 4, 2024, there are bugs borne from the changes in nostr-tools and some other dependencies. I haven't gotten the time to review the code until lesson 4.6, but I am working on it.

The Evolving Nostr Tutorial Outline

  1. Introduction to Nostr and Setting Up the Environment
    • Overview of Nostr protocol
    • Installation of Node.js and setting up a new Node.js project
    • Basics of using npm (Node Package Manager)
  2. Generating and Understanding Keys
    • 2.1 Generating a private and public key using nostr-tools
    • 2.2 Understanding the role of keys in Nostr
  3. Creating and Signing Events
    • 3.1 Understanding what events are in Nostr
    • 3.2 Code to create a basic event (e.g., a text post)
  4. Interacting with Relays
    • 4.1 Explanation of Nostr relays and their role
    • 4.2 Connecting to a relay and understanding relay functions
    • 4.3 Nostr kinds
    • 4.4 Project - Connect to a relay and subscribe to all kind 1 events
    • 4.5 Project - Querying a relay NIP-11
    • 4.6 Project - Publishing an event to a relay + NoteID
  5. Building a Basic User Interface
    • 5.1 Setting up a basic web server with Express.js
    • 5.2 Create a Basic Front End for the Express.js Nostr Server
    • 5.3 Sending and receiving data from the client to the server
  6. Handling Real-time Updates with WebSockets
    • 6.1 Integrating WebSockets for real-time communication
    • 6.2 Establishing WebSocket connections between the client and server
    • 6.3 Real-time display of events on the web app
  7. User Authentication and Session Management
    • 7.1 Implementing basic user authentication using Nostr keys
    • 7.2 Managing user sessions in the application
    • 7.3 Enhancing security for user authentication
  8. Advanced Event Handling
    • 8.1 Parsing and handling different types of events (e.g., likes, replies)
    • 8.2 Implementing event filters and search functionality
    • 8.3 Handling event validation and errors
  9. Building a Follow System
    • 9.1 Implementing a system to follow/unfollow users
    • 9.2 Fetching and displaying posts from followed users
    • 9.3 Managing a user's follow list
  10. Optimizing and Scaling the Application
    • 10.1 Best practices for code organization and modularity
    • 10.2 Handling large numbers of concurrent users and events
    • 10.3 Scaling the application with additional relays or resources
  11. Adding Additional Features
    • 11.1 Implementing features like retweets, likes, and replies
    • 11.2 User profile management
    • 11.3 Customizing the user interface
  12. Deployment and Maintenance
    • 12.1 Deploying the web application to a cloud provider
    • 12.2 Setting up continuous integration/continuous deployment (CI/CD) pipelines
    • 12.3 Monitoring and maintaining the application post-deployment
  13. Finalizing and Testing the Application
    • 13.1 Conducting thorough testing (unit tests, integration tests)
    • 13.2 Collecting user feedback and making final adjustments
    • 13.3 Launching the application officially
  14. Conclusion and Future Directions
    • 14.1 Recap of what has been built and learned
    • 14.2 Discussing potential extensions and new features
    • 14.3 Community involvement and open-source contributions

About

Simple Nostr Tutorial Series

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published