-
Make sure
node
andnpm
are installed and up to date. Runningnode -v
should return something newer thanv10.0.0
. Runningnpm -v
should return something newer than6.0.0
. If that is not the case, follow the instructions here to installnode
andnpm
. -
Make sure you have
dat
andpm2
installed globally:
npm install -g dat pm2
- Clone this repository, by running:
git clone https://github.com/CezarMocan/projections.git
- Make sure you are in the project directory (
cd projections
) and then install the dependencies by running:
npm install
- You should now be able to start a local instance of the server on port 3000 by running:
npm run start
- In the project directory, make sure the source code is up to date and all dependencies installed:
git pull
npm install
- Create a new build and deploy it to
dat
by running:
npm run deploy
This will build the source code and update the contens of the dat
archive with the new static site. This command will not return, since it ends with dat sync
. Once the contents of the archive are done processing, you can quit the dat sync
shell (Ctrl+C
).
If you wish to make changes to the source code, you can start a local development server on port 3000 by running:
npm run dev
This command starts the static file server, and enables the features useful for development (e.g. live reload.) If you navigate to http://localhost:3000
, you should be able to access the sotware.
The repository uses React
as its main javascript framework, and handles build and deployment using Next.js
.
/components
: UI individual components (e.g. a slider, a list item, etc.)
/dat
: This is the site that gets served over dat
. The folder contains a static build of this repository, as well as the configuration files for the dat
archive. Every time the site is re-deployed, the contents of this folder change to the new build (but the dat
configuration stays the same, since we're keeping the same archive and URL.)
/modules
: Various utility files. For example:
-
DownloadHelper.js
contains functions needed to download thepng
,svg
and configuration files to the disk. -
LayerData.js
contains the configuration file for the default information layers that get displayed in the software. (raster image, Gedymin heads, etc.) -
ProjectionsMetadata.js
contains the creation year, author gender and country of origin for the projections we are using. -
RenderHelper.js
contains utility functions for projecting and displaying raster and vector images.
/pages
: These are the components that get transformed into the website's HTML pages. We currently only have one—index. pages/index.js
is where the bulk of the project is implemented.
/static
: This is where the site's static assets are: images, stylesheets, geojson files, etc.
next.config.js
: The configuration file for the Next.js
framework.
package.json
: The configuration file for this as a Javascript npm
based project. Contains npm
dependencies and scripts.