r/learnprogramming • u/LRandomDudeV • 11h ago
Help needed How to i turn my code into app?
I want to make a simple music player app for my school project, but they only thought us how to make stuff in web, so i want to do something more unique for the graduation project. I dont need any fancy app hosting, just a way i can download my code and use it as an app
ill be mainly using php, sql and css
0
Upvotes
3
u/Quantum-Bot 10h ago
You can run your website locally just by opening up your HTML file like a document.
If you want to package it as an exe I would look at Electron.js. This might be a little involved for a school project though.
Your third option is to just rewrite your project in a native language. It’s not that hard to learn a new programming language after learning your first one. Switching programming languages is less like switching from English to French and more like switching from PC to Mac.
1
u/DiodeInc 11h ago
In what language? For what platform?
1
u/kutac56 10h ago
Be a little more specific. What languages is it in? What type of app do you want (web app or normal app)?
1
u/rupertavery64 9h ago
The short answer is, with php and sql, you can"t.
If you make a web page in php, it is probably running on some php server like IIS, plus you have the data on a sql database.
Those aren't exactly desktop application frameworks.
The most direct way to make a desktop application is to use a language that has first party support for desktop.
If Windows, the easiest would be C# and WPF, or Avalonia. With linux you would use C/C++ and something like Qt, which I wouldn't call easy.
Basically you need a language that complies to native code that runs directly in your OS.
There are other options like Electron (which you write the UI part as a webpage, but basically you package an entire web browser in your app) and probably Python, but the end user has to have python installed.
1
u/BranchLatter4294 11h ago
Pick a language. Write your app. Run your app.
1
u/DragonfruitGrand5683 10h ago
You can make it in HTML, CSS, JavaScript. If you want it on desktop you can install it as a progressive web app.
1
u/Sea_Athlete1378 10h ago
You can just host it locally? Npm run dev, run through maven or whatever builder/language you're using and you're there no?
1
u/Feeling_Photograph_5 10h ago
You can use electron with a wrapper for PHP, since that is what you say you're using in another answer. That will get you an app you can download onto a laptop.
If you want to make it work on a phone you might need to refactor the app to Flutter and Dart, but it is possible to download an app built that way directly onto your device without going through the App store.
1
u/betarage 10h ago
For andriod apps you should probably learn kotlin or maybe dart making ios apps is harder. you can also just make a web page and save it as a html file and you can use it on your phone and pc.
1
u/Correct_Rain_9438 10h ago
Heads up on GitHub Pages. GitHub describes it as a static site host for HTML, CSS and JavaScript files, so a PHP and SQL project won't run there. It's fine for storing and sharing the code, but not for running the app.
1
u/Ahmed_Hisham0 7h ago
php needs a server to run, so "download and double click" isn't going to work on its own. two ways around it for a school project.
the cheap one is to make it a PWA. the site stays a site, but the browser can install it to the desktop and it runs in its own window offline-ish. no packaging, works on windows and mac, and it looks good in a demo.
the other is phpdesktop, which wraps php plus a small browser into a single exe. it's old and fiddly on mac, but it does produce a real file you can hand in.
for a music player, the PWA is the honest answer. pick it before you write much, because retrofitting it later is annoying.
1
u/AdhesivenessFew8441 4h ago
Since you already know PHP and SQL, you do not have to rewrite anything. Two simple ways to make it feel like a real Windows app: 1) PHP Desktop, an open source project that bundles a small browser window with PHP built in. You drop your PHP files into its www folder, double click the exe, and your project opens in its own window, no server needed. 2) If you use Laravel, NativePHP does the same with more features. For the database, use SQLite instead of MySQL: it is a single file that ships with the app, so whoever downloads it does not have to install a database server. For the player itself, the HTML audio tag plus a little JavaScript for play, pause and next is enough, and PHP can scan a music folder and save the song list in SQLite. Then zip the folder or put it in a GitHub release so people can download it. That would make a nice graduation project.