All projects

NizhneudinskMap

★ 0 stars↓ 0 downloads
Open on GitHub ↗

README.md

Map of Places in Nizhneudinsk

A web application for displaying locations on a map of Nizhneudinsk with cards, categories, and secure addition of new points.

What's Been Implemented

  • Home page: the map and a list of places are displayed first.
  • Map powered by Leaflet using OpenStreetMap.
  • Hovering over a marker displays a mini-card (name + category), without an address.
  • The dialog for adding a location opens only after clicking on the map.
  • To add a point, you must enable edit mode and enter the password once.
  • Categories and pin colors:
    • select an existing category;
    • create a new category with a color;
    • the category color determines the pin color;
    • Categories are saved in data/categories.json.
  • Photo: upload a file up to 1 MB or a link.
  • The address is filled in automatically based on the coordinates.

Quick Start

  1. Set up dependencies:
npm install
  1. Start the server:
npm start
  1. Open the website:
http://localhost:3000

Edit mode password

Default password: nizhneudinsk

Set your password via an environment variable:

ADD_PLACE_PASSWORD="ваш_сложный_пароль" npm start

Data storage

  • Points: data/places.geojson.
  • Categories: data/categories.json.
  • Uploaded images: uploads/.

API

  • GET /api/places — a list of places.
  • GET /api/places/:id — a single location.
  • GET /api/categories — list of categories.
  • POST /api/auth/login — Enter edit mode (password verification).
  • POST /api/places — Create a location.

Preparing for Deployment (Nginx + HTTPS)

Ready-to-use materials:

  • Example Nginx configuration: deploy/nginx-example.conf
  • Step-by-step instructions: deploy/DEPLOY.md
  • Example environment variables: .env.example

In short:

  1. Deploy the application on the server and run it on PORT=3000.
  2. In deploy/nginx-example.conf Replace the domain in server_name.
  3. Configure Nginx and restart it.
  4. Issue the certificate:
sudo certbot --nginx -d map.example.ru -d www.map.example.ru

Specify server_name is where your domain is specified.

Releases

No releases yet.

Open issues

No open issues 🎉

This page was machine-translated from Russian

RU