Skip to content

7nights/bv2ex

Repository files navigation

bv2ex Logo

bv2ex

A Better Way to Experience is a redesigned V2EX web application.

Release log

Please visit https://github.com/7nights/bv2ex/releases for more information.

Recent update: add dark mode.

Installation

Please install get-v2ex first. And then follow the instruction below.

To install bv2ex:

Step 1

Click the Releases tab, find the latest release and download it on your server.

wget [bv2ex.zip release path]

Step 2

Move the zip file to the directory of get-v2ex and unzip it there.

mv bv2ex.zip [path to your get-v2ex] && cd [path to your get-v2ex]
unzip bv2ex.zip

Step 3

Rename [path to your get-v2ex]/public/config-tpl.js to config.js.

Open [path to your get-v2ex]/public/config.js, then fill in all properties. For example:

module.exports = {
  serverAddress: 'https://example.com/api',
  clientAddress: 'https://example.com',
  firebaseConfig: {},
  fcmPublicVapidKey: ''
};

To get Firebase configuration:

  1. Register your app in your FCM project
  • In the Firebase console's project overview page, click the Web icon (< >) to launch the setup workflow.

  • Enter your app's nickname then click Register.

  • At right now you can see a code snippet, then copy what the firebaseConfig is to your config.js. For example:

    module.exports = {
      serverAddress: 'https://example.com/api',
      clientAddress: 'https://example.com',
      firebaseConfig: {
        apiKey: "AIzaSyAmn_CNq_-aun4d428kYKAbjfgsVrhLibc",
        authDomain: "bv2ex-35d15.firebaseapp.com",
        databaseURL: "https://bv2ex-35d15.firebaseio.com",
        projectId: "bv2ex-35d15",
        storageBucket: "bv2ex-35d15.appspot.com",
        messagingSenderId: "728560720104",
        appId: "1:728560720104:web:c834eb2349eb7c64"
      },
      fcmPublicVapidKey: ''
    };
  1. Configure web credentials with FCM
  • Open the Cloud Messaging tab of the Firebase console Settings pane and scroll to the Web configuration section.
  • In the Web Push certificates tab, click Generate Key Pair. The console displays a notice that the key pair was generated, and displays the public key string and date added.
  • Fill in fcmPublicVapidKey with the key pair you just generated.

Step 4

Run build command under the public directory.

npm run build

Upgrade

  • Download lastest release on your server
  • Unzip it under get-v2ex directory
  • Run npm run build under get-v2ex/public directory
cd [get-v2ex path]
wget [bv2ex.zip release path]
unzip bv2ex.zip
cd public
npm run build

Develop

npm run start
npm run sass

You can config serverAddress in config.js to your local get-v2ex server.

Build

npm run build
cd build
mv ./default/ ./public
zip -r ./bv2ex.zip ./public