r/learnprogramming • u/New_Discipline_775 • 24d ago
Web App How do I create a web app?
Hi everyone,
I’ve been programming for years but have never worked on a real project, and I’ve decided I want to create a web app that can render .md files into a manageable note-taking interface (a classic .md file editor, like Logseq or Obsidian, for example), but I’m not quite sure how to get started. Here’s what I’ve figured out so far (let me know if I’ve misunderstood anything):
- Software of this type “translates” .md files into HTML, so what we see in the app is just a “translation” (via a parser) of the actual file (without those weird Markdown symbols, so to speak).
But there are so many things I still don’t understand how to implement:
- LaTeX: How do I handle this? Do I simply use MathJax on the front end by intercepting the dollar signs and rendering the contents?
- Okay, JavaScript for the front end, but I don’t want to use Electron as the backend (I was thinking of C++ or Rust [Tauri]). In that case, does it make sense to use a graphics engine like OpenGL or Vulkan for graph mode to achieve maximum performance, instead of Tauri, for example, or does that make very little sense?
- This might be a silly question, but while experimenting with javascript, I discovered that (understandably, otherwise every website could steal everything from me) javascript functions called from HTML can’t read the user’s local files (for example, via `require`). So, how can I access the MD files?
3
u/Arsonist07 24d ago
I would start by looking into web servers like Nginx, Flask, or Apache. Once you can render a web page with html then figure out how to run JavaScript and tie it to a back end with something like Python.
I’d say from there it should be easy to render a file to screen so after that figure out how to edit it.
1
u/banbeucmas 24d ago
Not gonna claim I know the answer to all of this
- Generally if that is possible that then do it. At least I think it's correct to have a library rendering it. You can also do it yourself for funsies
- Electron is a framework. At least in most context Frontend means anything that user facing (Code that will run in user machine, stuff that shows to the user). Backend is the layer where all of the calculation is done on the server. You are overcomplicating this. Either you have a framework to make it a desktop client or if you are just planning for a web app then just pick any popular frontend framework that you want to learn. React, Vue, Sveltes. All of the shebang
- It depends on how you serve the .md files. Do you let the user upload it? Do you call it from the server? Or if you are using a framework (assuming you actually want a desktop client here) then does the framework gives you the ability to access the user file system?
There might be more context needed so I am just throwing suggestion out of my head here.
But tldr: Make it works first, optimization later. Talking optimization now is probably not the best interest when you don't even know where to start
1
u/jakingo 24d ago
Start with a simple web editor using a Markdown parser, MathJax for LaTeX, and Tauri's file system APIs to access local files. You don't need OpenGL or Vulkan unless you run into real performance issues.
1
u/Only_Wealth4053 24d ago
You're right that a web page can't just read files off the disk, and that's a good thing. The usual ways in are an upload button (an input of type file) or drag and drop, and Chrome-based browsers also have the File System Access API, which lets the user pick a file or folder and then save back to it. If you go with Tauri instead, the app gets proper native file access through its own file APIs, so that part gets much easier. I'd skip OpenGL or Vulkan for now and get a basic editor working first.
1
u/verstands 24d ago
For LaTeX, KaTeX is worth a look too. It's a lot faster than MathJax and renders synchronously, which matters in a note app where you re-render on every keystroke. For the editor itself, CodeMirror 6 handles the markdown side so you don't have to build text editing from scratch.
1
u/One-Entrepreneur8557 24d ago
Tauri is the right call here. You are overcomplicating it with C++ or Rust backends that don't exist. Use Tauri. It gives you a native window and direct access to the local filesystem via its API so you can read your .md files without the browser sandbox limitations. For LaTeX, stick to KaTeX because it renders faster than MathJax which matters when you re-render on every keystroke. Do not touch OpenGL or Vulkan. The graph mode in Obsidian uses D3.js and HTML canvas and it runs fine without raw GPU code. Just build the parser in JS and let Tauri handle the disk I/O.
1
u/dhinesh_s_dev 24d ago
Build the smallest version that works first. Load one .md file, render it to HTML on the page, and stop there. Once that works, add the file list, then editing, then LaTeX.
If you try to plan the whole app before writing anything, you will not start. That is the part that gets most people.
1
u/Pale-Preparation-354 23d ago
Main thing is to keep the first version simple. For the Markdown side, CodeMirror 6 with KaTeX sounds like a good starting point, and Tauri can handle local file access without getting into OpenGL or Vulkan right away. If you later need to export notes or generate PDFs from HTML, IronPDF is worth checking out too. It supports C# and .NET, along with Java, Node.js, and Python, so there are a few ways to fit it into a project like this. I'd focus on getting the editor and file saving working first, then add the fancy graph features once the basics feel solid.
1
u/burlingk 21d ago
So, are you trying to get it to read and edit a users .md files, or are you trying to set something up so that you can use markdown to create a website that is then uploaded and rendered by the server?