Difference between revisions of "Setting up dev environment"

From Wikidocumentaries
Jump to navigation Jump to search
(Build setup: wikidocumentaries-ui)
 
(14 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
==Set up local development environment==
 
==Set up local development environment==
* Install Node.js https://nodejs.org/en/download/. You need at least node version 7.6 because the async is supported since that version (https://www.infoq.com/news/2017/02/node-76-async-await) and it is used
+
* '''Download''' Node.js and npm at https://nodejs.org/en/download/. You need at least Node version 7.6 because Wikidocumentaries uses Async, which in only supported since that version (https://www.infoq.com/news/2017/02/node-76-async-await).
* Install npm
+
* '''Clone''' the repositories from GitHub to your local hard drive
* Clone the repositories  
 
 
** https://github.com/Wikidocumentaries/wikidocumentaries-ui
 
** https://github.com/Wikidocumentaries/wikidocumentaries-ui
 
** https://github.com/Wikidocumentaries/wikidocumentaries-api
 
** https://github.com/Wikidocumentaries/wikidocumentaries-api
* Edit wikidocumentaries-ui/src/store/store.js. Change the constant const BASE_URL to the local address by commenting out the server address:
+
 
 +
==Build setup: wikidocumentaries-ui==
 +
See https://github.com/Wikidocumentaries/wikidocumentaries-ui
 
<pre>
 
<pre>
const BASE_URL = "http://localhost:3000/"
+
# install dependencies
//const BASE_URL = "https://wikidocumentaries-api.wmflabs.org/"
+
npm install
</pre>
+
 
 +
# serve with hot reload at localhost:8080
 +
npm run dev
 +
 
 +
# serve with hot reload at localhost:8080
 +
# and use a local wikidocumentaries-api instead of the production one
 +
API_URL=http://localhost:3000/ npm run dev
 +
 
 +
# build for production with minification
 +
npm run build
 +
 
 +
# build for production and view the bundle analyzer report
 +
npm run build --report
  
<span style="font-weight:bold;color:#FF3333">Note: Never upload this edit!</span>
+
# run unit tests
 +
npm run unit
  
* Go to each directory and run  
+
# run all tests
** npm install
+
npm test
** npm run dev
+
</pre>
 +
* '''Set environment variables'''. There are three environment variables to define. You can ask for them in the developer Slack or mail susanna.anas@gmail.com. In a Mac (bash) you can define them like this:
 +
<blockquote><pre>
 +
export WIKIDOCUMENTARIES_API_USER_AGENT=<email address>
 +
export FLICKR_KEY=<flickr key>
 +
export BING_MAPS_KEY=<Bing maps key>
 +
export MAPBOX_ACCESS_TOKEN=<Mapbox access token>
 +
export TROVE_API_KEY=<Trove API key>
 +
export EUROPEANA_API_KEY=<Europeana API key>
 +
export SMITHSONIAN_API_KEY=<Smithsonian API key>
 +
</pre></blockquote>
  
 
==Wikimedia and project accounts==
 
==Wikimedia and project accounts==
Line 29: Line 53:
 
* '''[https://github.com/Wikidocumentaries Wikidocumentaries Github repository]'''
 
* '''[https://github.com/Wikidocumentaries Wikidocumentaries Github repository]'''
 
* '''[https://phabricator.wikimedia.org/tag/wikidocumentaries/ Wikidocumentaries Phabricator project]'''
 
* '''[https://phabricator.wikimedia.org/tag/wikidocumentaries/ Wikidocumentaries Phabricator project]'''
 +
* '''[https://wikidocumentaries.slack.com/ Wikidocumentaries Slack channel]''' Developers in channel #technology.
  
 
{{design-nav}}
 
{{design-nav}}

Latest revision as of 08:22, 23 May 2023

Set up local development environment

Build setup: wikidocumentaries-ui

See https://github.com/Wikidocumentaries/wikidocumentaries-ui

# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# serve with hot reload at localhost:8080
# and use a local wikidocumentaries-api instead of the production one
API_URL=http://localhost:3000/ npm run dev

# build for production with minification
npm run build

# build for production and view the bundle analyzer report
npm run build --report

# run unit tests
npm run unit

# run all tests
npm test
  • Set environment variables. There are three environment variables to define. You can ask for them in the developer Slack or mail susanna.anas@gmail.com. In a Mac (bash) you can define them like this:
export WIKIDOCUMENTARIES_API_USER_AGENT=<email address>
export FLICKR_KEY=<flickr key>
export BING_MAPS_KEY=<Bing maps key>
export MAPBOX_ACCESS_TOKEN=<Mapbox access token>
export TROVE_API_KEY=<Trove API key>
export EUROPEANA_API_KEY=<Europeana API key>
export SMITHSONIAN_API_KEY=<Smithsonian API key>

Wikimedia and project accounts

  1. Get a Wikimedia account (the same account for all Wikipedias, Wikimedia Commons, Wikidata etc.) e.g. https://www.wikidata.org/wiki/Special:UserLogin
  2. Get the Wikimedia developer account > Registration instructions under "VPS and General Users". The same key and password let you access The Wikimedia Cloud Services at https://wikitech.wikimedia.org and the git repositories located at https://gerrit.wikimedia.org/. You are also creating a separate Shell account. Read also:
  3. Create an account in Wikimedia Phabricator
  4. Ask to join the codebase in GitHub
  5. Ask for an account to edit this wiki

Communication channels for developers


Navigation

About Technology Design Content modules Tool pages Projects
Status

Wikidocumentaries blog

Wikidocumentaries demo

Phabricator project

Facebook group

GitHub repository

Translation in TranslateWiki

Wikidocumentaries Slack

Setting up dev environment

Resources

Translations

Languages

Using Wikibase

Federation with Wikidata

APIs

Linking

Media metadata

Properties to content

User registration

Licensing

Page types

Landing page

Search page

Topic page

User page

Organisation page

Project page

Tool page

Tasks

Components

Main toolbar and footer

Search

Faceting

Topic page header

Content module

Dropdown

Modal

Icons

Active modules

Article

Family tree

Gallery

Historical map

Images

Image viewer

Infobox

Map

Module ideas

Audio/Video

Bibliography

Correspondence

Discussion

Graph

Name

Newspaper articles

Testimonials

Timeline

Visualizations

Wikidocumentary

3D

Visual editor

Query tool

QuickStatements

Open Refine

Creating topics

Uploading images

Geolocating tool

Metadata editor

Rectifying maps

Transcription

Annotation tool

Central Park Archives

Convent Quarter

Wikisource