This is a Next.js project bootstrapped with create-next-app.
cp .env.sample .env
# Populate values
source .env
You can install the dependencies with one of the following options:
npm install
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.
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.
When creating a new branch, we must use the following convention:
feat/<<semantic description>>: For new featuresfix/<<semantic description>>: For bux fixesrefact/<<semantic description>>: For code refactoringtest/<<semantic description>>: For new tests implementationsdocs/<<semantic description>>: For new documentation
When adding a new commit to our branch, we must use the following convention (similar to branch creation):
feat: implementing new feature for ...orfeat(<<context>>): implementing new feature for ...fix: fixing bug on ...orfix(<<context>>): fixing bug on ...refact: refactoring ... logicorrefactor(<<context>>): refactoring ... logictest: 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
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:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
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.