-
Couldn't load subscription status.
- Fork 64
Dev Environment
Since I'm no longer actively maintaining this project, this guide should hopefully help any potential contributors get set up to modify Cryptofolio.
My Setup:
- WAMP, LAMP or MAMP with PHP 8.2.0 (I personally use MAMP Pro on my MacBook most of the time).
- Git.
- VS Code.
Start by using git clone https://github.com/Xtrendence/Cryptofolio to clone the repository. Set the document root to the root of the project (i.e. if you cloned to /Users/Username/GitHub/Cryptofolio/, then that would be the project's root folder). Start your Apache server, and go to the /website route (MAMP Pro defaults to port 8888, so for me it's http://localhost:8888/website/). Make sure the API is working as well by checking http://localhost:8888/api/. Log in using admin for both username and password.
When I made Cryptofolio, I wasn't developing apps professionally yet, so little thought was put into structuring the code, although it's not too messy. The entire HTML can be found in website/index.html with no server-side pre-processing of any kind. I get the icons from https://github.com/Rush/Font-Awesome-SVG-PNG/tree/master/black/svg and use the SVG code directly. The website/assets/js/api.js file contains the simulated API that allows the "No API" mode to work. Initially, CoinGecko's limits were also way higher, with more recent changes making Cryptofolio hit the limit very quickly.
99% of the JS code for the project can be found in website/assets/js/main.js, which is where that lack of structure comes in. Most of the functions aren't actually that long unless they're doing more complex things, but there are a lot of them. They have pretty clear and self-documenting names though, so in most cases it should be clear what they're doing. If not, I tried pasting a few into ChatGPT and it seems to do a decent job explaining what's going on. All of it is 100% vanilla JS, and at the time I wasn't familiar with things like .reduce() and Promise.all, so there will be inefficiencies.
The API, in comparison, is much more structured and easy to understand. The documentation on it should be fairly up-to-date as well: https://github.com/Xtrendence/Cryptofolio/wiki/API-Documentation
The desktop app is quite simple to build, just run npm install in the desktop directory, and use npm run dist to build it for all platforms (you will need to be on macOS to build for it). The HTML for the desktop app is in desktop/app/views/index.ejs, with the body ID being hardcoded to "desktop", and a few small differences such as the window title, and the close, maximize and minimize buttons. There are some small differences in the desktop/app/assets/js/main.js file as well in order to allow interactions between the Electron Node.js server and the front-end. Most notably, the storage mechanism is different as electron-store is used instead of localStorage.
The mobile app is much more complicated to get running and to build. You will need React Native installed, which has quite a long setup process (https://reactnative.dev/docs/environment-setup). I use a Pixel_3_API_27 emulator when developing, then a mix of various emulators and my own physical Pixel to test. The React code is quite messy as well as this was one of the first times I ever used React, but it's split up and structured much better than the website.
Contributions and PRs are welcome, and will be reviewed as soon as possible. I appreciate that the project still gets attention after all this time, and I'd love to keep it going myself, but with a full-time job, other hobbies, people, and new personal projects, there simply isn't enough time to revisit old projects.
The only stipulation is that PRs cannot modify the app in ways that would make it completely deviate from its original purpose. No paid API usage, no data hosted in external servers, no calls home, no huge UI changes that completely change the look and feel of the app. Essentially, I want the app to still feel like something I made, and I absolutely want privacy and freeware to be at the forefront of the project's mission.