Skip to content
Merged

Hi #102

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 6 additions & 28 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,37 +64,15 @@ studymap/

### `data/places/`

Nine JSON files, one per place category (imported by `studymap.config.ts` at the repo root, not
One JSON file per place category (imported by `studymap.config.ts` at the repo root, not
directly by `src/lib/places.ts` - see [Data flow](#data-flow) below). Each file is a flat array of
place objects. This is the only place place data lives — nothing is duplicated elsewhere.

| File | Type key |
|------|----------|
| `airport.json` | `airport` |
| `train_station.json` | `train_station` |
| `exam_centre.json` | `exam_centre` |
| `library.json` | `library` |
| `book_shop.json` | `book_shop` |
| `stationery.json` | `stationery` |
| `internet_cafe.json` | `internet_cafe` |
| `imp_locations.json` | `imp_locations` |
| `repair_shop.json` | `repair_shop` |

Record shape (defined in `src/lib/types.ts`):

```ts
{
id: string; // kebab-case, unique across all types
name: string;
type: PlaceType;
city: string; // free-form slug, e.g. "mumbai", "navi_mumbai" - any city worldwide
lat: number;
lng: number;
address?: string;
gmaps_link: string;
added_by: string; // GitHub username
}
```
The record shape, valid type keys, and per-field rules are documented once in
[`data/CONTRIBUTING.md`](data/CONTRIBUTING.md) and enforced by
[`data/places.schema.json`](data/places.schema.json) via `npm run validate` -
that pair is the source of truth, not this file. The `PlaceType` union and
`Place` interface in `src/lib/types.ts` mirror the same schema.

### `src/app/`

Expand Down
139 changes: 116 additions & 23 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,133 @@
# Code of Conduct
# Contributor Covenant Code of Conduct

## Our Commitment
## Our Pledge

StudyMap is built by and for students. We aim to create a respectful, inclusive, and welcoming space for everyone, especially those new to open source.
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic
status, nationality, personal appearance, race, caste, color, religion, or
sexual identity and orientation.

---
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.

## Expected Behavior
## Our Standards

* Be respectful, patient, and kind
* Give constructive, helpful feedback
* Assume good intent
* Keep contributions accurate and well-sourced
Examples of behavior that contributes to a positive environment for our
community include:

---
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community

## Unacceptable Behavior
Examples of unacceptable behavior include:

* Harassment, discrimination, or personal attacks
* Hostile or dismissive communication
* False, spammy, or low-quality submissions
* Sharing private information without consent
* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

---
## Enforcement Responsibilities

## Reporting
Community leaders are responsible for clarifying and enforcing our standards
of acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.

Report issues by opening an issue or contacting the maintainer.
All reports will be handled privately and in good faith.
Community leaders have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, and will communicate reasons
for moderation decisions when appropriate.

---
## Scope

This Code of Conduct applies within all community spaces, and also applies
when an individual is officially representing the community in public
spaces. Examples of representing our community include using an official
e-mail address, posting via an official social media account, or acting as
an appointed representative at an online or offline event.

## Enforcement

Maintainers may warn, remove contributions, or restrict access if needed to keep the community safe.
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
[studentsuite0@gmail.com](mailto:studentsuite0@gmail.com).
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of
the reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in
determining the consequences for any action they deem in violation of this
Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series
of actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external
channels like social media. Violating these terms may lead to a temporary or
permanent ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public
or private interaction with the people involved, including unsolicited
interaction with those enforcing the Code of Conduct, is allowed during this
period. Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
the community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.1, available at
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].

Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].

---
For answers to common questions about this code of conduct, see the FAQ at
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available
at [https://www.contributor-covenant.org/translations][translations].

Be respectful. Build responsibly. Help students.
[homepage]: https://www.contributor-covenant.org
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
[Mozilla CoC]: https://github.com/mozilla/diversity
[FAQ]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations
28 changes: 5 additions & 23 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,29 +105,11 @@ Proof goes in the pull request, never in the committed JSON.

## The place record

Each place is one object inside `data/places/<type>.json`. Valid types: `library`, `other_places`, `airport`, `sat_centre`, `foreign_lang_exam_centre`, `gov_offices`.

```json
{
"id": "mum-library-07",
"name": "City Library, Dadar branch",
"type": "library",
"city": "mumbai",
"lat": 19.0176,
"lng": 72.8562,
"address": "Optional, short and human-readable",
"gmaps_link": "https://maps.app.goo.gl/...",
"added_by": "your-github-handle"
}
```

- `city` is a lowercase, underscore-separated slug (e.g. `mumbai`, `navi_mumbai`, `jakarta`). Any city worldwide is welcome — StudyMap is not limited to the Mumbai Metropolitan Region.
- `id` format: `<city-prefix>-<type>-<number>`, unique within the file
- Coordinates: real-world `lat`/`lng` for the place, matched to its `city`
- Do not add rating, review count, or verified date to the JSON. Those go in the PR.
- `exam` and `valid_till` are optional fields for `sat_centre` and `foreign_lang_exam_centre`:
- `exam`: the exam this centre serves, e.g. `"SAT"`, `"Goethe-Zertifikat (A1-C2)"`, `"IELTS"`
- `valid_till`: ISO date (`YYYY-MM-DD`) the entry should be reconfirmed by, e.g. the last exam administration the centre is verified for. Always reconfirm your exact centre with the exam board before relying on this field; centres change between administrations.
Each place is one object inside `data/places/<type>.json`. The record shape, valid
types, and per-field rules are documented once in
[`data/CONTRIBUTING.md`](data/CONTRIBUTING.md) and enforced by
[`data/places.schema.json`](data/places.schema.json) via `npm run validate` - see
that file for the schema itself rather than this one.

## Commit message format

Expand Down
36 changes: 6 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,41 +23,17 @@ Open http://localhost:3000. No environment variables needed; the map reads place

## Data schema

Places live in `data/places/<type>.json`, one file per category:

| File | Type key |
|------|----------|
| `airport.json` | `airport` |
| `train_station.json` | `train_station` |
| `exam_centre.json` | `exam_centre` |
| `library.json` | `library` |
| `book_shop.json` | `book_shop` |
| `stationery.json` | `stationery` |
| `internet_cafe.json` | `internet_cafe` |
| `imp_locations.json` | `imp_locations` |
| `repair_shop.json` | `repair_shop` |

Each record shape (`src/lib/types.ts`):

```ts
{
id: string; // kebab-case, unique across all types
name: string;
type: PlaceType; // one of the 9 keys above
city: string; // free-form slug, e.g. "mumbai", "navi_mumbai" - any city worldwide
lat: number;
lng: number;
address?: string;
gmaps_link: string; // must contain "maps.google.com"
added_by: string; // GitHub username of contributor
}
```
Places live in `data/places/<type>.json`, one file per category. The record shape,
valid types, and per-field rules are documented once in
[`data/CONTRIBUTING.md`](data/CONTRIBUTING.md) and enforced by
[`data/places.schema.json`](data/places.schema.json) via `npm run validate` -
that pair is the source of truth, not this README.

## How to add a place

1. Fork this repo
2. Add your place to the correct `data/places/<type>.json`
3. Verify `lat`/`lng` against Google Maps; `lat` 18–20, `lng` 72–73
3. Verify `lat`/`lng` against Google Maps
4. Set `gmaps_link` to the Google Maps link
5. Open a pull request with a description of the place and a source

Expand Down
5 changes: 5 additions & 0 deletions data/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

Places live in `data/places/<type>.json`, one file per place type, one JSON object per place.

This file is the single source of truth for the place-record schema - `README.md`,
`CONTRIBUTING.md`, and `ARCHITECTURE.md` link here instead of repeating it. The shape
below is also machine-enforced by [`places.schema.json`](places.schema.json), which
`npm run validate` checks every record against.

## Pick the right file

| File | What goes here |
Expand Down
62 changes: 62 additions & 0 deletions data/places.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://github.com/StudentSuite/StudyMap/blob/main/data/places.schema.json",
"title": "StudyMap place record",
"description": "Canonical schema for one entry in data/places/<type>.json. Mirrors the Place type in src/lib/types.ts. See data/CONTRIBUTING.md for the human-readable guide.",
"type": "object",
"additionalProperties": false,
"required": ["id", "name", "type", "city", "lat", "lng", "gmaps_link", "added_by"],
"properties": {
"id": {
"type": "string",
"minLength": 1,
"description": "<city-prefix>-<type>-<number>, unique within the file, e.g. mum-library-07"
},
"name": {
"type": "string",
"minLength": 1
},
"type": {
"type": "string",
"enum": ["library", "other_places", "airport", "sat_centre", "foreign_lang_exam_centre", "gov_offices"],
"description": "Must match the filename it lives in, e.g. data/places/library.json -> \"library\""
},
"city": {
"type": "string",
"minLength": 1,
"description": "Lowercase, underscore-separated slug, e.g. \"mumbai\", \"navi_mumbai\". Any city worldwide is welcome, not a fixed enum."
},
"lat": {
"type": "number",
"minimum": -90,
"maximum": 90
},
"lng": {
"type": "number",
"minimum": -180,
"maximum": 180
},
"address": {
"type": "string",
"description": "Optional, short, human-readable"
},
"gmaps_link": {
"type": "string",
"pattern": "^https://(maps\\.google\\.com(\\?|/)|maps\\.app\\.goo\\.gl/|www\\.google\\.com/maps/|goo\\.gl/maps/)"
},
"added_by": {
"type": "string",
"minLength": 1,
"description": "GitHub username of the contributor"
},
"exam": {
"type": "string",
"description": "Optional. Only for sat_centre / foreign_lang_exam_centre, e.g. \"SAT\", \"IELTS\", \"Goethe-Zertifikat (A1-C2)\""
},
"valid_till": {
"type": "string",
"format": "date",
"description": "Optional. Only for sat_centre / foreign_lang_exam_centre. ISO date (YYYY-MM-DD) the entry should be reconfirmed by."
}
}
}
Loading
Loading