Git Product home page Git Product logo

fablabs.io's Introduction

FabLabs

Code Climate Test Coverage

This is the official repository for fablabs.io platform project.

Fab labs provide widespread access to modern means for invention. They began as an outreach project from MIT’s Center for Bits and Atoms (CBA), and became into a collaborative and global network. You can find more information about Fab Labs on the Fab Foundation Website.

If you are a Fab labs entusiast and/or you would like to contribute to the project please feel free to get in touch by opening a new issue.

Getting started

The platform is built with Ruby on Rails. We recommend reading the guide.

You can develop locally, or by using docker-compose (advanced).

  1. Start by creating the config file and edit as needed
    • cp .env.example .env

Local development (recommended)

We recommend using rbenv to handle different Ruby versions, and nvm to handle Node versions.

Install dependencies and create a database:

  1. npm i

  2. bundle

  3. rake db:setup

  4. rails s

  5. Visit http://localhost:3000

Setup on MacOS

On MacOS to have the exact Ruby version, use a version manager. Default MacOS Ruby is incompatible. See example article how to setup on mac

With chruby installed, you can do something like this:

  1. ruby-install 2.6.10
  2. chruby 2.6.10
  3. gem install bundler:2.3.26 (check Gemfile.lock file)
  4. bundler install (optional: bundle config set --local without 'test')
  5. nvm use (setup NodeJS with )

Trouble shooting Issue with bundle install and postgress a. brew install libpq () a. export PKG_CONFIG_PATH="/usr/local/opt/libpq/lib/pkgconfig"

Tests

Run tests with:

bundle exec rake

Using docker-compose (optional, for advanced users)

  1. Start the project:

    docker-compose up app

  2. Create database (only the first time):

    docker-compose exec app rake db:setup

    OR

    docker-compose exec app rake db:schema:load

    If npm does not successfully install do:

    docker-compose exec app npm i

  3. Add this to your /etc/hosts:

    127.0.0.1   www.fablabs.local
    127.0.0.1   api.fablabs.local
    
  4. Visit http://www.fablabs.local:3000

  5. API is served on http://api.fablabs.local:3000

  6. Add test users and data with

    docker-compose exec app rake db:seed

    This will create a normal user (email=[email protected], password=password) and an admin user (email=[email protected], password=password)

  7. Run tests with

    docker-compose exec app rake db:setup RAILS_ENV=test

    docker-compose exec app rake spec

  8. If you make changes to the code, rebuild the app and deploy the new image

    docker-compose build

    docker-compose up -d

  9. Backup your db at any time with the included script:

    ./scripts/docker-backup-db.sh
    
  10. Other:

    docker compose exec app bundle update --patch

  11. Access Postgress database:

    docker exec -it fablabsio_db_1 psql -d fablabs -U postgres

Getting an API Token

  1. Login to fablabs.io
  2. Go to the developer console (on the upper-right menu)
  3. Create a New application, or edit an existing one.
  4. Fill in the form, Redirect URI can be 'https://example.com'
  5. Submit

Copy the Personal access token

Verify the token is working with the following terminal command:

curl -X GET 'https://api.fablabs.io/0/me' -H 'Authorization: Bearer <your_personal_token>'
curl -X GET 'https://api.fablabs.io/2/labs?page=0&per_page=100'  -H 'Authorization: Bearer <your_personal_token>'

Production notes

If you are running in production:

  • you need to setup the SSL hosts and .env vars from the docker-compose.yml

  • you must define Amazon S3 env vars, all thumbnails and images depend on this:

S3_BUCKET=your_fablabs.io
S3_KEY=<amazon key>
S3_SECRET=<amazon secret>
S3_REGION=<amazon region code>
  • you need to run the assets pipeline to update public/assets

docker-compose exec app bundle exec rake tmp:clear

docker-compose exec app bundle exec rake assets:precompile

docker-compose restart app

Pull requests

All PRs are tested on Github Actions. Make sure the tests run.

Languages and translation

The project is now on Crowdin https://crwd.in/fablabsio

Use the i18n-tasks normalize before submitting language changes

Styleguide

There is a minimal styleguide on http://localhost:3000/styleguide

Use it and update it if you add new reusable classes

Versioning

Currently using this tool to manually handle versioning: https://github.com/gregorym/bump

Use this command to update the VERSION file + create a git tag

bump patch --tag

Then push the git tag with:

git push --tags

License

This project is licensed under the GNU Affero General Public License v3.0 (AGPL) - see the LICENSE.md file for details.

fablabs.io's People

Contributors

ceritium avatar dependabot[bot] avatar fbaiodias avatar fibasile avatar has256 avatar hiromipaw avatar jmmolenaar avatar johnrees avatar lyla-fischer avatar mactwister avatar openp2pdesign avatar pral2a avatar tuengominh avatar viktorsmari avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fablabs.io's Issues

Lab added in August 2015 not yet approved

Hi
I added my lab on 22 august 2015.
Few days later i've recieved this mail:

"Hi Valerio,
Your lab Fablab Bergamo, was approved by the designated referee it is now awaiting for admin approval. -"
When will it be approved?
Thank you

Problem with map visualization

screen shot 2015-07-15 at 21 11 56

The map page is cut in a weird way at the moment: it is very short and there's a lot of empty white space under it. Google Chrome on Mac (both updated).
It did work well in the morning.

Todo for this week

To do/to fix:

  • Fix user mailers
    • User is not mailed
    • Referee is mailed as if they were the users
    • Need more info doesn't send emails
    • On more infor added doesn't send emails
  • Add referee mailers
  • Check admin mailers
  • Improve test coverage
  • Reduce overall complexity
  • Address opbeat errors
  • Add voting machine
  • Add compulsory checkboxes
    • The submitted Fab Lab is committed with the principles of the Fab Lab Charter: http://www.fabfoundation.org/fab-labs/the-fab-charter/
    • The submitted Fab Lab has a compatible set of tools related with the official fab lab inventory
    • The submitted Fab Lab commits to participate in the network activities: regional meetings, FABX conferences
    • Our staff is (or will be) trained in the Fab Academy or compatible programs

Lab approval process

After having tested the lab approval process we have agreed on the following flow:

  • User submit lab and designates 3 referees.
  • If all 3 referees approve the lab the lab is approved. Otherwise the lab is either rejected:
    • 2/3 or all (3/3) referees have rejected the lab.
    • Or the lab is sent for admin approval (2/3 referees have approved the lab)

Especial TAG pages

We need a way to showcase projects linked to a specific project or event as for example Fab Awards 2015.

This requires:

  • The possibility to add a nice header image, title, description + links before the index of projects containing the tag. (This can be an admin limited function and it can be a full html editable area or something more advanced with a template)
  • Having a nice perm link like https://www.fablabs.io//fabawards2015

https://www.fablabs.io/projects/tags?q=Fab%20Awards%2015

Updating existing lab details process

Process:

  • when updating whatever information on the existing lab page it still asks for 3 referee labs.
  • after selecting the 3 labs and submitting the updates appears then feedback pop-up
  • the detail page is updated

It works but it's confusing, why should an approoved lab need to be referenced with three supernodes? Maybe, it just needs some brief explanation

Feature Request: Sending GPS coordinates through API

It would be awesome if Mobile Fab Labs could send live their coordinates to fablabs.io using the API. So you can see the actual position (bearing, speed?).

I still don't have an final opinion about the security issues. Maybe some mobile labs don't want to do that all the time.

Hyper up machines

Machine can be added from labs
Machine can be added to projecs
Machine can be reserved
Super admin can add new machines.

Update icons in maps

Supernode: w/ yellow border
Mini: 50% smaller
Planned: monocormo

Find a different map template.

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.