Skip to content

Repository files navigation

This is a Next.js project bootstrapped with create-next-app.

Getting Started

Configure your .env

cp .env.sample .env
# Populate values
source .env

Install the dependencies

You can install the dependencies with one of the following options:

npm install

Run the development server

You can run the development server manually with Makefile commands:

  • make run-dev: Runs the development environment using npm.
  • make run-prod: Builds the project and starts the production server using npm.
  • docker-build-dev: Builds the development environment Docker image with specified configurations.
  • make docker-run-dev: Runs the development environment using Docker, mapping the container port to 3000 and mounting necessary volumes.
  • make docker-build-prod: Builds the production environment Docker image with specified build arguments.
  • make docker-run-prod: Runs the production environment Docker container with specified configurations.
  • make docker-run-beta: Runs the beta environment Docker container with specified configurations.

Open http://localhost:3000 with your browser to see the result.

Structure

Croqui

The sketch-map generator lives in src/croqui/ and is served at the /croqui route. It's a self-contained, entirely client-side module: the map (MapLibre), the vector statistics (area, perimeter, intersection with municipalities and thematic layers, CAR lookup) and the PDF export all run in the browser, with no backend of its own.

It lives in the (croqui) route group, which has its own <html>/<body> and does not load the rest of the site's GlobalStyles (styled-components) — the site-wide reset is incompatible with croqui's CSS, in particular the details { display: none } rule, which would hide StatsPanel's collapsible sections. The remaining routes live in the (site) group. Neither group changes any URL.

The logo in the croqui header points to /oca_logan.svg and is wrapped in a link back to the site's home page.

The layers' GeoJSONs live in public/data/ and are fetched at runtime. The optional export-registration config and the Carto basemaps API key (NEXT_PUBLIC_CROQUI_CARTO_API_KEY; without it Carto tiles show an "API KEY REQUIRED" watermark) are in .env.sample, under the NEXT_PUBLIC_CROQUI_ variables. These are NEXT_PUBLIC_*, so they only exist at build time; in production/beta they aren't read from .env but passed in as build-args by the deploy workflows (.github/workflows/deploy-beta.yml and deploy-oca.yml).

Code origin: the croqui (observatorio-croqui) repository, kept as history. The old deployment stays up as a fallback until this version is validated in production.

Conventions

Branches

When creating a new branch, we must use the following convention:

  • feat/<<semantic description>>: For new features
  • fix/<<semantic description>>: For bux fixes
  • refact/<<semantic description>>: For code refactoring
  • test/<<semantic description>>: For new tests implementations
  • docs/<<semantic description>>: For new documentation

Commits

When adding a new commit to our branch, we must use the following convention (similar to branch creation):

  • feat: implementing new feature for ... or feat(<<context>>): implementing new feature for ...
  • fix: fixing bug on ... or fix(<<context>>): fixing bug on ...
  • refact: refactoring ... logic or refactor(<<context>>): refactoring ... logic
  • test: implementing new tests for ...
  • docs: "new method or new function" documentation

Credit Card IIN Ranges & Spacing Patterns information from: https://baymard.com/checkout-usability/credit-card-patterns

Learn More

This project uses next/font to automatically optimize and load Inter, a custom Google Font.

To learn more about Next.js, take a look at the following resources:

You can check out the Next.js GitHub repository - your feedback and contributions are welcome!

Deploy on Vercel

The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.

Check out our Next.js deployment documentation for more details.

About

Front-end do Observatório da Caatinga e desertificação

Resources

Stars

2 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages