native-land-digital / next-nld

A NextJS rebuild of Native-Land.ca.
https://native-land.ca
1 stars 0 forks source link

Native Land 2.0

Welcome to Native Land 2.0! This is a NextJS and PostGIS rebuild of Native-Land.ca. If you want to help out with the site on a technical or design level, you're very welcome here!

This Repo

Technologies at use include:

We would love to have you involved if you have any fixes or additions you'd like to see on the site.

Dev Environment

To get set up for basic work:

(If you are a staff member of Native Land or working directly with the developers of Native Land Digital, ask for env values to get set up with our inner access to AWS, Mapbox, and TinyMCE. Otherwise, to get a fully working repo, there are a few hoops you need to jump through. See the second below ("Independent Local Setup") for instructions.)

(The repo has a compose.yml file that will create and install a PostgreSQL database with PostGIS installed on your Docker. The references to this are already in the .env file. However, if you'd prefer to set this up with your own psql instance, just replace the DATABASE_URL and DIRECT_URL in the .env to get things working.)

This gets you towards the most basic functional application, but to do further testing you may need to do elements of the next section, depending on what you're working on.

Independent Local Setup

If you're trying to make a 1:1 copy, it's complicated! You will need to populate the .env with your own values.

Mapbox

Text editor

AWS uploads

AWS Lambdas

User verification and creation

Please let us know if you have trouble doing all this. It's not easy!

Tech Notes

Database

All polygons are stored in the PostGIS database as MultiPolygons. They can be flattened when retrieved, but this is to keep a single geography type while still allowing researchers to draw more complex shapes when necessary.

Internationalization

We have built a rather complicated redirection and rewrite system to handle internationalization without middleware and without needing to generate thousands of extra pages. It works like this:

All this is set as redirects and rewrites inside next.config.mjs. As a result, anytime a new language is added or a new directory from the root is added, you must add the language code in src/i18n/config.js.

Deployment

Deployment will run from the dev branch to a Preview in Vercel. In the Preview, comments and notes can be made. From there, changes will be reviewed and the resulting PR assigned to main.

Notes:

Exceptions

Logs and Analytics

History

Native Land was created as a hobby project by Victor Temprano (http://victortemprano.com) in 2015, as a way to help learn more Indigenous territories and the history of colonialism. Since then, it has grown substantially, becoming a non-profit (Native Land Digital) a few years later as the site grew in popularity. Now, it has a small team and a board of directors, which you can read about more on the website itself, and we are always trying to add more and bring knowledge of Indigenous ways of being with the land to more people.

On the tech side, the site has gone through a number of iterations:

With this latest build, we are moving away from Wordpress into a leaner, more directly developed tech stack customized for Native Land's needs.

Native Land API

The Native Land API is in the process (as of September 2024) of moving over to an API key model instead of being completely open. This is to help manage excessive requests and to keep better track of how people are using the data that we curate from Indigenous communities.

You can find more about how to use the Native Land API at our documentation at https://api-docs.native-land.ca/.