Git Product home page Git Product logo

luarocks-site's Introduction

LuaRocks.org

https://luarocks.org

spec

The official module repository of the LuaRocks package manager for Lua.

The entire site runs on OpenResty, an Nginx based platform with Lua support. The site itself is coded in MoonScript and uses Lapis as a web framework.

Files are stored on Google Cloud Storage. PostgreSQL is used as a database.

Tup is the build system.

How To Run Locally

Install the following dependencies:

Check out this repository.

Install dependencies:

luarocks build --only-deps --lua-version=5.1 --local

Run these commands to build:

tup init
tup

Create the schema:

make init_schema

Start the server:

lapis server

Now http://localhost:8080 should load.

If you edit any MoonScript or SCSS files you should call tup to rebuild the changes. You can run tup monitor -a to watch the filesystem to rebuild.

Running tests

This site uses Busted for its tests:

make test_db
busted

The make test_db command will copy the schema of the moonrocks local database into the test database, wiping out what whatever was there. You'll only need to run this command once and the beginning any any time the schema has changed.

Setting up Google Cloud Storage

In production all files are stored on Google Cloud Storage. With no configuration (default), files are stored on the file system using the storage bucket mock provided by the cloud_storage rock.

To configure cloud_storage to talk to a live bucket make a file secret/storage_bucket.moon, it must return a bucket instance. It might look something like:

-- secret/storage_bucket.moon
import OAuth from require "cloud_storage.oauth"
import CloudStorage from require "cloud_storage.google"

o = OAuth "[email protected]", "PRIVATEKEY.pem"
CloudStorage(o, "PROJECT_ID")\bucket "BUCKET_NAME"

Setting up email

If you want to test sending emails you'll have to provide Mailgun credentials. Create a file secret/email.moon and make it look something like this: (it must return a table of options)

{ -- secret/email.moon
  key: "api:key-MY_KEY"
  domain: "mydomain.mailgun.org"
  sender: "MoonRocks <[email protected]>"
}

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.