r/learnprogramming • u/LRandomDudeV • 4d 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
7
u/Quantum-Bot 4d 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.
2
u/kutac56 4d ago
Be a little more specific. What languages is it in? What type of app do you want (web app or normal app)?
2
u/BranchLatter4294 4d ago
Pick a language. Write your app. Run your app.
1
u/DiodeInc 4d ago
In what language? For what platform?
1
u/rupertavery64 4d 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.
2
u/Ahmed_Hisham0 4d 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.
2
u/Murlock_Holmes 2d ago
You didn’t mention HTML or JavaScript, which are both things you need to know for web apps (which is what PHP is used for).
I’d recommend doing an easy index.html, put all of the JavaScript in <script> tags, and then sample music you can play. No SQL or PHP needed.
I do not believe you can (legally) create a music player that streams the music from another source, so local files will be best for this.
1
u/DragonfruitGrand5683 4d 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 4d 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 4d 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 4d 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 4d 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.
0
u/BlindTeemo 3d ago
Try using Angular and then host it on Github pages. Works well for simple apps, and feels just like a real mobile app.