/smartlab-initiative

Front-end of the Smartlab Initiative

Primary LanguageVueMIT LicenseMIT

smartlab-initiative

This repository holds the code for the front-end of the Smartlab Initiative. We invite all the community to join us in our mission and contribute. To do so, we recommend reading this first.

Creating a local environment

To run the project locally, you'll need to download and install node (with npm), if you don't have it, and go through some setup first.

Step 1. Fork & Clone smartlab-initiative

Please, read this to better understand why and how to fork a project.

Step 2. Create a reference to the platform content repository

If you don't want to change the content

If you don't want to work in the content, just set an environment variable:

GIT_VIEWCONF_TAG_URL=https://raw.githubusercontent.com/smartlab-br/smartlab-initiative-viewconf/master/

To be able to change the content

Otherwise, if you want to be able to change the content and see it working locally, you have to fork and clone this repository under the /app/static/ dir.

Step 3. Subscribe to datahub-api & acidentometros-api

At the moment, we're working in a self-service subscription. Until it becomes a reality, please, send us an e-mail (smartlab-dev@mpt.mp.br) - we'll be glad to provide you with an API Key. Remember, though, that the access is not guaranteed - we might want to know you a little better (where you're from, if you're representing an organization, if there are more people in the organization that will use the data and so on...).

Step 4. Set environment variables

DATAHUB_API_BASE_URL = <the endpoint to the datahub-api>
DATAHUB_APP_KEY = <your application credential obtained in the subscription step>
      
ACIDENTOMETROS_API_BASE_URL = <the endpoint to the datahub-api>
ACIDENTOMETROS_APP_KEY = <your application credential obtained in the subscription step>

Step 5. Run the project

Go to the app folder and run scripts for installing and building the project:

$ cd app
$ npm install
$ npm run dev

I can see it running! Now what?

You can start contributing! Just make sure to create a pull request to the contrib branch, otherwise it may be dismissed. We strongly recommend adding automated tests to the codebase. Read this to understand better about pull requests.

We'll do our best to give a quick feedback - bear in mind we're a small team, though.

How to contribute

There are plenty of ways to contribute to opensource projects, as we can read in this post. Some examples:

  1. Translation of content (editing smartlab-initiative-viewconf yamls);
  2. Code optimization;
  3. Enhancing unit testing coverage;
  4. Proposing new features and
  5. Repository and code documentation.

Attention to the working repository!

If you're working in the smartlab-initiative-viewconf repository, make sure you're running git commands (pushes, branching, sending pull-requests) from it. Since in some cases you may have nested repositories, it's a common mistake to change the files and forget that the inner one is actually completely independent.

Do I need to be in a team to collaborate?

No, you don't! This is an opensource project and we intend to keep it as democratic as we can. Anyone can clone, fork and send pull requests to our repositories. We'll check the PR code quality and if it can be merged without breaking stuff. As long as the PR is clean and sent to the correct branch (contrib), we'll do our best to approve it timely.

Eventually, we'll come up with a policy to add people to our ranks, as committers. When we do so, the access will be granted per repository or team (with a set of repositories under their responsibility).

Some tools you can use

Git

Gitkraken

Github Desktop

Sourcetree

Coding

There are a lot of tools to help in editing the files - some of them offer integration with terminal and other tools. Here are some alternatives:

VS Code

Webstorm

Atom

Third-party components used in our platform

Font Awesome Free
Copyright © Fonticons, Inc. - MIT License

Ajv
Copyright © 2015-2017 Evgeny Poberezkin - MIT License

Axios
Copyright © 2014-present Matt Zabriskie - MIT License

Babel/Polyfill
Copyright © 2014-present Sebastian McKenzie and other contributors - MIT License

Compression
Copyright © 2014 Jonathan Ong, Copyright © 2014-2015 Douglas Christopher Wilson - MIT License

Cross-Env
Copyright © 2017 Kent C. Dodds - MIT License

D3
Copyright © 2019 Mike Bostock - BSD 3-Clause License

D3-Sankey
Copyright © 2015 Mike Bostock - BSD 3-Clause License

D3-Scale-Chromatic
Copyright © 2010-2018 Mike Bostock - BSD 3-Clause License

D3 Plus
Copyright © 2013 Alexander Simoes - MIT License

D3 Bullet
Copyright © 2012-2016 Mike Bostock - BSD 3-Clause License

ES6-Promise
Copyright © 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors - MIT License

Express
Copyright © 2017 StrongLoop, IBM, and other expressjs.com contributors, Copyright © 2014-2015 Douglas Christopher Wilson, Copyright © 2013-2014 Roman Shtylman, Copyright © 2009-2014 TJ Holowaychuk - MIT License

Extract Text Plugin
Copyright © JS Foundation and other contributors - MIT License

FS Listener
Copyright © 2013 Vladimir Kirillov - ISC License

JSON Loader
Copyright © JS Foundation and other contributors - MIT License

JSON2CSV
Copyright © 2012 [Mirco Zeiss] - MIT License

Leaflet
Copyright © 2017 Vladimir Agafonkin - BSD 2-Clause License

Leaflet-EasyPrint
Copyright © 2015 Rowan Winsemius - MIT License

Leaflet.Heat
Copyright © 2014, Vladimir Agafonkin - BSD 2-Clause License

Leaflet.MarkerCluster
Copyright © 2012 David Leaver - MIT License

Lru Cache
Copyright © Isaac Z. Schlueter and Contributors - ISC License

Odometer
Copyright © 2013 HubSpot, Inc. - MIT License

Path
Copyright © Joyent, Inc. and other Node contributors - MIT License

Serialize JavaScript
Copyright © 2014 Yahoo! Inc. - BSD 3-Clause License

Serve-Favicon
Copyright © 2010 Sencha Inc., Copyright © 2011 LearnBoost, Copyright © 2011 TJ Holowaychuk, Copyright © 2014-2017 Douglas Christopher Wilson - MIT License

Vue
Copyright © 2014-2019 Evan You - MIT License

Vue-Analytics
Copyright © 2016-2017 Matteo Gabriele - MIT License

Vue-Cookies
Copyright © 2016-present, cmp-cc - MIT License

Vue Router
Copyright © 2013-present Evan You - MIT License

Vue Server Renderer
Copyright © 2014-2019 Evan You - MIT License

Vue-SVG_Sprite
Copyright © 2016 Thierry Michel - MIT License

VueWorker
Copyright © 2017 Israel Sant'Anna - MIT License

Vuetify
Copyright © 2016-2019 Vuetify, LLC, Copyright © 2016-2019 John Jeremy Leider - MIT License

Vuex
Copyright © 2015-present Evan You - MIT License

Vuex-Router-Sync
Copyright © 2016 Evan You - MIT License

Yaml-Loader
Copyright © 2014 Andrey Okonetchnikov - MIT License

Vue Test Utils
Copyright © 2017-present vuejs - MIT License

Autoprefixer
Copyright © 2013 Andrey Sitnik - MIT License

Babel-Core
Copyright © - MIT License

Babel-Jest (Jest)
Copyright © Facebook, Inc. and its affiliates - MIT License

Babel Loader
Copyright © 2014-2019 Luís Couto - MIT License

Babel-Plugin-Transform-Runtime
Copyright © - MIT License

Babel-Preset-Stage-2
Copyright © - MIT License

Babel-Register
Copyright © - MIT License

CSS Loader
Copyright © JS Foundation and other contributors - MIT License

EventSource Polyfill
Copyright © 2014 AmvTek - MIT License

File-Loader
Copyright © JS Foundation and other contributors - MIT License

Friendly-Errors-Webpack-Plugin
Copyright © 2016 Geoffroy Warin - MIT License

Highlight.js
Copyright © 2006, Ivan Sagalaev - BSD 3-Clause License

HTML Webpack Plugin
Copyright © JS Foundation and other contributors - MIT License

Jest
Copyright © Facebook, Inc. and its affiliates - MIT License

Jest-Serializer-Vue
Copyright © 2017 Edd Yerburgh - MIT License

Jest-Sonar-Reporter
Copyright © 2017-2018 Christian Wlatschiha - MIT License

Jest-Junit
Copyright © - Apache License 2.0

Pug
Copyright © - MIT License

Rimraf
Copyright © Isaac Z. Schlueter and Contributors - ISC License

Script Extension for HTML Webpack Plugin
Copyright © 2016 numical - MIT License

Style Loader
Copyright © JS Foundation and other contributors - MIT License

Stylus
Copyright © Automattic <developer.wordpress.com> - MIT License

Stylus-Loader
Copyright © 2018 Kyle Robinson Young - MIT License

SW Precache Webpack Plugin
Copyright © 2018 Will Farley - MIT License

URL-Loader
Copyright © JS Foundation and other contributors - MIT License

Vue-Jest
Copyright © 2017 Edd Yerburgh - MIT License

Vue Loader
Copyright © 2015-present Yuxi (Evan) You - MIT License

Vue-Style-Loader
Copyright © JS Foundation and other contributors - MIT License

Vue-Template-Compiler
Copyright © - MIT License

Webpack
Copyright © JS Foundation and other contributors - MIT License

Webpack-Dev-Middleware
Copyright © JS Foundation and other contributors - MIT License

Webpack Hot Middleware
Copyright © JS Foundation and other contributors - MIT License

Webpack-Merge
Copyright © 2015 Juho Vepsalainen - MIT License

Webpack node externals
Copyright © 2016 Liad Yosef - MIT License