Coder Social home page Coder Social logo

mk3-server's Introduction

Mk3::AppServer

App server for the Mk3 EMFCamp badge.

Initial Setup

Environment

First step, is to set up your environment. For this, you will need:

  • curl
  • build-essential (or whatever your distro has for make etc.)

And then just run the following commands:

curl -L https://cpanmin.us/ | perl - App::cpanminus local::lib --local-lib=~/perl5
echo 'eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)' >> ~/.bashrc
eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)

Database

For any deployment, whether this be Production, Testing or Development, you will need to create a database. You have the options of using PostgreSQL, MySQL, or SQLite for the database. here are some example connection strings for each:

# SQLite
dbi:SQLite:dbname=mydb.db

# MySQL
dbi:mysql:database=mydb;host=localhost

# PostgreSQL
dbi:Pg:dbname=mydb;host=localhost

With this you can deploy the schema to the database (for PostgreSQL and MySQL you may need a username and password, if it is set up that way). To deploy to each of these databases, run the following:

# Without username or password
./script/deploy.pl install -c <connection string>

# With username and password
./script/deploy.pl install -c <connection string> -u <username> -p <password>

Config File

For the config file, create a file called 'mk3_appserver_local.conf', and add the following to it:

<Model::DB>
  <connect_info>
    dsn <connection string from above>
    user <username, if applicable>
    password <pass, if applicable>
  </connect_info>
  storage_path /path/to/filestore
</Model::DB>

Replacing the dsn, user, password, and storage path as required.

Deployment

To deploy the app, first set up your environment, database, and config file, and then run the following commands:

cpanm --installdeps .
./script/deploy.pl install -c <connection string>

and then you can start the server as one of the following methods.

Production

To start a production server, run the following:

./script/init.pl start

This will start the application up, listening on http://localhost:5000/

Development

To set up for development, run the following commands:

CATALYST_DEBUG=1 ./script/mk3_appserver_server.pl -r

This will start up a local testing server in debug mode, which will automatically reload on any changes to the codebase, listening on http://0:3000/

Postgres support

To install the required postgres modules, run the following:

cpanm --installdeps --with-feature postgres .

mk3-server's People

Contributors

tbsliver avatar marekventur avatar

Stargazers

Kurt avatar Paul Williams avatar Tasmo avatar Peter Fox avatar

Watchers

Jonty Wareing avatar James Mastros avatar Mark Steward avatar Nathan Dumont avatar  avatar Jason Morley avatar  avatar dps.lwk avatar Alistair MacDonald avatar James Cloos avatar Eugene Nadyrshin avatar  avatar Will Hargrave avatar  avatar NotQuiteHere avatar Ben Dooks avatar Chris avatar  avatar  avatar

Forkers

davea kmisiunas

mk3-server's Issues

Upload issues

Test uploading from Firefox and other browsers, as some users are finding errors

disallow spaces

App names, filenames, and usernames should not have spaces in.

Authorise apps

Need a method for authorising the apps so that we dont end up with 500 torch apps.

Before an app is authorised, it is only visible to its owner or an admin.

Prefetch in DB Queries

Need to add some prefetching in DB queries, especially for the app endpoints - otherwise it will take down the local postgres...

Rejection reason

Allow for internal emailing for admins to users for a reason why we have rejected their app - or add an option to add a comment for a rejection/approval reason.

App specific API endpoint version issue

The verison listed in the App specific API (/api/apps//) gives the wrong version to download - need to change from 'latest_version' to 'latest_allowed_version'.

Admin Role

need an admin role for us so we can authorise apps - see #1

File viewer

Add ability to view app files in a popover or something instead of downloading them

Upload files modifications

Remove any files and folders which start with a '.'

Ignore folders called __MACOSX

If only one folder and no files in the root of the archive, change into that dir and sort files from there - otherwise complain.

Add github issues link

Add a github issues link to the footer if people have found a bug on the site.

something like 'Found a bug? let us know!'

Allow main.mpy as a replacement for main.py

Some apps cannot be run on the badge within the menu system, due to memory limitations causing the parser to fail. It does not appear to be possible to build frozen bytecode files on device, so the app store should allow distributing them.

.py files are loaded in preference to .mpy files, so both can't be included. There could also be a check that main-src.py (or similar) and README is there, to ensure people distribute source and instructions too.

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.