Skip to content

alechash/BetterMacStore

Repository files navigation

BetterMacStore

This is a Mac App Store on the web, created because I don't like the real one.

Table of Contents

Click me to view the TOC

Features

  • developer organizations
  • release apps under personal accounts
  • release apps for organizations and personal accounts
  • upload .app, .zip, and .dmg files
  • upload .gif, .png, and .jpg files as app icons and screenshots
  • for our electron developers, binary uploads up to 500 megabytes
  • and soooo much more!

How it Works

Translations

This will be displayed in the steps it takes for translations to work

  • static translations are stored in the ./translations folder
  • a user translates by editing those files
  • to add more strings to be translated, run the translate script
  • compiling languages
  • because some languages arent 100% translated, it took a lot of server time merging the English and other lanhguages file for each request
  • we fixed this by "compiling" the languages
  • the script i18n_comp compiles the languages into a folder called ./i18n_compiled
  • now, the server only has to access one translation file instead of going into two files and dynamically merging them
  • how to compile languages
  • you should never have to manually compile a langauge because the start script runs the i18n_comp script at the beginning
  • i18n_comp folder is ignored because it is dynamic and changes

Translating

Hey! We appreciate translations sooo much! We want to bring forward an internet were no one is left behind, we can help start this by providing translations on the Better Mac Store!

If you translate anything, you can give yourself credit in the JavaScript file in a comment and/or below in the contributors section.

There are two ways you can help translate:

  • by directly translating to the actual webiste (you will help contribute to this repo)
  • by helping translate an app hosted on https://bettermacstore.com (you will need to contact the developers of other apps and translate)

Translating Apps

You'll need to reach out to the app developer and ask them if you can translate, we don't have control over that part

Translating the Website

First, define what language you'll want to translate English into. You can view needed translations by going here and finding a language file that hasnt been translated. (just open the file and you'll see if its been translated, but make sure you check everything because it might only be 50 or 75% translated)

Now, you can go in and translate the sentence on the left, and put the translated sentence into the quotes on the right! Once you have done this (you dont have to translate all of it, just as much as you can/want to), you can go ahead and open a pull request! We will approve and generally check the translations them merge it!

If there is a language you don't see in that folder, just open an issue and we'll take it from there. Or, you can do it yourslef:

  • go and add a new file with the title being the language name in the /translations folder (make sure it ends in .js)
  • then, go to /views/partials/footer.ejs and add a new select option to the dropdown (preferably in ABC order)

Running Locally

These instructions will be for macOS/Linux systems. Other instructions might be available in the wiki. If they aren't feel free to contribute to the wiki.

Wasabi Setup

  • create a wasabi account @ https://wasabi.com
  • set up billing for public access to files
  • create access keys and fill them in in the .env
  • create a unique bucket name, I suggest also adding some random characters at the end so as not to mess with other buckets with similar names
  • go into your bucket settings and press "POLICIES"
  • paste this into the input, and change YOUR_BUCKET with your bucket name:
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "AllowPublicRead",
      "Effect": "Allow",
      "Principal": {
        "AWS": "*"
      },
      "Action": "s3:GetObject",
      "Resource": "arn:aws:s3:::YOUR_BUCKET/*"
    }
  ]
}

Prerequisites

You will need MongoDB, available here (you can install through Brew and Apt-Get).
You will need Node.JS, available here.

Git Steps

First, Clone the Repo

git clone https://github.com/alechash/BetterMacStore

CD to The Dir

cd BetterMacStore

NPM Steps

Install Packages

npm install

ENV Steps

Renaming ENV

Find the file named .env.example, then rename that file to .env

Filling in the Data

Because you are running the website locally, you can leave the MONGO entry alone
ENV will need to be changed to d because we are in the development mode, if you were to actually deploy the website, you'd want this to be p
NAME is what will show up on the website, this can be whatever you want
SECRET is the encryption key for sessions, this can be whatever you want
ANALYTICS is a boolean (true, or false) of whether to load Google Analytics onto the site
if ANALYTICS was set to true, you need to provide a GA tracking code (available from analytics.google.com)

Filling in the Wasabi Data

Wasabi is the provider who stores the files (dmg, app, zip, png, jpg, and gif files)
You'll need to signup at https://wasabi.com
When you create an account, you'll need to create access keys

WASABI_API_KEY, you can press "Access Keys" from the dashboard and generate a new API Key
WASABI_SECRET_KEY, you will also get a "Secret Key", copy that and input it into the entry
WASABI_BUCKET_NAME, is up to you, it is basically what folder your data will be stored in

More NPM Steps

Now you can run npm start in your terminal, now navigate to http://localhost:3000 in your browser

Making a User Admin

Once you create an account, you can access the database using a tool like Robo 3T to access the database and find that account. Then you can right-click and edit entry then change "admin": false to "admin": true

Contributors

You can view all contributors here.

Contribute

Pull requests and issues are welcome :)

File Structure

All the files are structured in an easy to use manner.

Routes

All routes are available in the ./routes folder

Config

Config files are files with exports, like passport and functions

All config files are available in the ./config folder

Models

All database model files are available in the ./models folder

Scripts and Tests

All scripts and tests are available in the ./.scripts folder
Inside this folder is scripts like translate.js and then there are tests in the ./.scripts/.tests folder
In the tests folder is files like EJS linting

Donate

If you want to support the project, not just the continual coding of the site, but also the upkeep of the actual website (database, hosting, file store, and domain) then you can donate using crypto. If you are a company and would like advertising for a donation, please first email me personally, jude@alecw.net.

If you can't donate, I appreciate you even taking a look at the project (it really does mean a lot).

Bitcoin

bc1qjfe239yrr0qprg8tz8gtzsvxujk0pp465y4u4y

Dogecoin

much wow: DQ5xZ9Wg5UpyamsciRkggoHc4bVUzUuW9s

Ethereum

0x439FC978639D9b0d1b11b869b92889cD004E0fA2

Litecoin

ltc1qglc620uem04l6xjkjr3ncften3dleqhd757e08

License

This project is 100% maintained under the MIT License, please view the license.