Map of pedagogical innovation in Catalonia, made with React, Leaflet, Material-UI and Nginx
793
https://innovacio.xtec.gencat.cat
This application deals with five types of data:
All these data are used to build an interactive map and pages with specific information about schools, programs and projects.
The main features of this application are:
This is a Progressive Web Application built with the following open source components:
Keep in mind that these components use hundreds of other open source projects to make the final application possible.
First of all, the NPM components must be loaded:
# Go to the main project directory:
$ cd path/to/mapa-innovacio-edu
# Install the required npm components:
$ npm ci
The application has different settings that can be adjusted. Many of these adjustements should be set on a file named .env, not included on the repository files. In order to generate your own .env file, just duplicate .env.example:
# Make a copy of .env.example
cp .env.example .env
You can choose between two different types of React Router:
HashRouter uses the "hash" part of URLs to identify the specific contents to be displayed on each page. In order to use this type of router set REACT_APP_HASH_TYPE to one of this values: "slash" (#/), "noslash" (#) or "hashbang" (#!/) in .env:
# File .env (or .env.production)
# hashType param passed to HashRouter
REACT_APP_HASH_TYPE="hashbang"
BrowserRouter can also use the "pathname" part of URLs. In order to use this type of router, set REACT_APP_HASH_TYPE to no-hash in .env:
# File .env (or .env.production)
# hashType param passed to HashRouter
REACT_APP_HASH_TYPE="no-hash"
Configure your web server to redirect all paths to index.html, except those that point to real files or directories.
mod_rewrite and configure your virtual host. If you have AllowOverride All set, the .htaccess file provided in /public will be used:Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.html [QSA,L]
location / {
try_files $uri $uri/ /index.html;
}
Note: If you are using Devilbox for development, take a look at the file /.devilbox/nginx.yml.
By default, the application is configured to be served at the root (/) of your HTTP server. Before deploying it on a different directory, the homepage value of package.json should be modified. This value should be "" for the root, or any absolute path starting (and not ending) with "/" for other locations. For example, this setting will make the final application run on https://myhost.mydomain.com/mymap/:
"homepage": "/mymap"
From here, the most usual operations are:
$ cd path/to/mapa-innovacio-edu
$ npm start
Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.
The page will reload if you make edits.
You will also see any lint errors in the console.
$ cd path/to/mapa-innovacio-edu
$ npm run build
Builds the app for production to the build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
See the section about deployment for more information.
For more information about this and other available scripts check the Create React App site.
You can choose to build your own image from source code, or download a pre-built image from DockerHub.
To build and launch your own docker image on port 8000:
$ cd /path/to/mapa/innovacio
$ docker build . -t mapa-innovacio
$ docker run -d -p 8000:80 --name mapa-innovacio mapa-innovacio
To use the pre-built docker image just launch:
$ docker run -d -p 8000:80 --name mapa-innovacio projectestac/mapa-innovacio
In both cases the app will be available at: http://localhost:8000/ (of course, you can choose any other port!)
"Map of pedagogical innovation in Catalonia" is an open source development made by the Department of Education of the Government of Catalonia, released under the terms of the European Union Public Licence v. 1.2.
Content type
Image
Digest
sha256:dd3cbc79e…
Size
33.2 MB
Last updated
29 days ago
docker pull projectestac/mapa-innovacio