Git Product home page Git Product logo

project-loved-web's Introduction

This project contains the web client (https://loved.sh), web server (https://loved.sh/api), and related tools for osu!'s Project Loved. See cl8n/project-loved for more management tools.

Development with Docker

The provided docker-compose configuration sets up a development environment with the client, API, MySQL, and Nginx. The client is served from http://localhost:8080 by default. Server environment variables under "API server options" and "MySQL connection options" are overridden in this environment.

Bridge package

The bridge directory contains a package required by both the client and server, but it's not built automatically by either. You will need to rebuild it yourself if changes are made:

cd bridge
npm install
npm run build

The package will also need to be reinstalled in client and server if any of its dependencies change, with npm install ../bridge.

Database migrations

/server/migrations contains SQL to create the project_loved database schema. There are no backward migrations.

On the first run of the database container, the project_loved user will be created with an empty password. MySQL is exposed to the host machine on port 3306. The project_loved database will be created and existing migrations will be applied, but future ones need to be run manually.

Live data

Regular database exports (sans extra_tokens and sessions) are posted to https://loved.sh/exports. This will drop and re-create all other tables!

docker-compose exec database /import-live-data.sh [export URL]

Creating an admin user

docker-compose run --rm api ./build/bin/create-admin.js <osu! username>

Deployment

Dependencies

Client

  • cd bridge
    npm install
    npm run build
    
  • cd client
    npm install
    npm run build
    

The built webpage will be in /client/build; it's an SPA.

Server

  • cd bridge
    npm install
    npm run build
    
  • cd server
    npm install
    npm run build
    
  • Copy .env.example to .env and fill in the options, or export the environment variables separately
  • Run the server: NODE_ENV=production ./build/bin/server.js

Request paths under /api should proxy to the server, paths exactly matching files should serve the files, and everything else should serve the client's index.html.

Also note that the loved-bridge package is installed as a link to ../bridge, so it will need to be deployed either at that path or at the target of a symbolic link from that path.

project-loved-web's People

Contributors

cl8n avatar freshleaf1095 avatar furiner avatar kazuorz avatar kotoki1337 avatar marcostudios avatar slofp avatar tpgpl avatar tybug avatar ubinici avatar vladden4 avatar walavouchey avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.