{"id":16129758,"url":"https://github.com/matt-ramotar/trails-server","last_synced_at":"2025-07-06T20:03:52.851Z","repository":{"id":228819893,"uuid":"775005830","full_name":"matt-ramotar/trails-server","owner":"matt-ramotar","description":"Backend for the Trails sample app","archived":false,"fork":false,"pushed_at":"2024-03-20T16:53:18.000Z","size":46,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-12T19:48:46.924Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matt-ramotar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-03-20T15:38:16.000Z","updated_at":"2024-03-20T16:52:53.000Z","dependencies_parsed_at":"2024-03-20T16:56:08.666Z","dependency_job_id":"c4222517-b099-495b-9903-f64d6195abb5","html_url":"https://github.com/matt-ramotar/trails-server","commit_stats":null,"previous_names":["matt-ramotar/trails-server"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matt-ramotar%2Ftrails-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matt-ramotar%2Ftrails-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matt-ramotar%2Ftrails-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matt-ramotar%2Ftrails-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matt-ramotar","download_url":"https://codeload.github.com/matt-ramotar/trails-server/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247492466,"owners_count":20947541,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-09T22:12:22.747Z","updated_at":"2025-04-06T13:44:21.329Z","avatar_url":"https://github.com/matt-ramotar.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Trails Server\n\nThis is the backend for the [Trails](https://github.com/mobilenativefoundation/trails) sample app. Provides functionality for managing trails, user activities, bookmarks,\nand reviews. Built using Node.js, Express, TypeScript, and MongoDB with Mongoose.\n\n## Table of Contents\n\n- [Getting Started](#getting-started)\n    - [Installation](#installation)\n- [Project Structure](#project-structure)\n- [Endpoints](#endpoints)\n- [Models](#models)\n- [License](#license)\n\n## Getting Started\n\n### Installation\n\n1. Clone the repository:\n\n   ```bash\n   git clone https://github.com/matt-ramotar/trails-server.git\n   ```\n\n2. Navigate to the project directory:\n\n   ```bash\n   cd trails-server\n   ```\n\n3. Install the dependencies:\n\n   ```bash\n   npm install\n   ```\n\n4. Create a `.env` file in the project root and provide the necessary environment variables:\n\n   ```\n   PORT=5000\n   MONGODB_URI=mongodb://localhost:27017/trails\n   ```\n\n5. Start the development server:\n\n   ```bash\n   npm run dev\n   ```\n\n   The API will be accessible at `http://localhost:5000`.\n\n## Project Structure\n\n```\ntrails-server/\n├── src/\n│   ├── controllers/\n│   │   ├── ActivityController.ts\n│   │   ├── BookmarkController.ts\n│   │   ├── HikeController.ts\n│   │   ├── ReviewController.ts\n│   │   └── TrailController.ts\n│   ├── dao/\n│   │   ├── ActivityDAO.ts\n│   │   ├── BookmarkDAO.ts\n│   │   ├── HikeDAO.ts\n│   │   ├── ReviewDAO.ts\n│   │   └── TrailDAO.ts\n│   ├── models/\n│   │   ├── Activity.ts\n│   │   ├── Bookmark.ts\n│   │   ├── Hike.ts\n│   │   ├── Review.ts\n│   │   └── Trail.ts\n│   ├── routes/\n│   │   ├── activityRoutes.ts\n│   │   ├── bookmarkRoutes.ts\n│   │   ├── hikeRoutes.ts\n│   │   ├── reviewRoutes.ts\n│   │   └── trailRoutes.ts\n│   ├── services/\n│   │   ├── ActivityService.ts\n│   │   ├── BookmarkService.ts\n│   │   ├── HikeService.ts\n│   │   ├── ReviewService.ts\n│   │   └── TrailService.ts\n│   └── app.ts\n├── .env\n```\n\n- `controllers`: Contains the controller classes responsible for handling incoming requests and sending responses.\n- `dao`: Contains the data access object classes that interact with the MongoDB database using Mongoose.\n- `models`: Contains the Mongoose model definitions for the database entities.\n- `routes`: Contains the route definitions for each API endpoint.\n- `services`: Contains the service classes that encapsulate the business logic and interact with the DAOs.\n- `app.ts`: Main entry point of the application, where the Express server is configured and started.\n\n## Endpoints\n\n- **Hikes**\n    - `POST /hikes`: Create a new hike entry\n    - `GET /hikes`: Get a list of hikes\n    - `GET /hikes/:id`: Get details of a specific hike\n    - `PUT /hikes/:id`: Update a hike entry\n    - `DELETE /hikes/:id`: Delete a hike entry\n\n- **Trails**\n    - `POST /trails`: Create a new trail\n    - `GET /trails`: Get a list of trails\n    - `GET /trails/:id`: Get details of a specific trail\n    - `PUT /trails/:id`: Update a trail\n    - `DELETE /trails/:id`: Delete a trail\n\n- **Bookmarks**\n    - `POST /bookmarks`: Create a new bookmark\n    - `GET /bookmarks`: Get a list of bookmarks for a specific user\n    - `GET /bookmarks/:id`: Get details of a specific bookmark\n    - `DELETE /bookmarks/:id`: Delete a bookmark\n\n- **Reviews**\n    - `POST /reviews`: Create a new review\n    - `GET /reviews`: Get a list of reviews for a specific trail\n    - `GET /reviews/:id`: Get details of a specific review\n    - `PUT /reviews/:id`: Update a review\n    - `DELETE /reviews/:id`: Delete a review\n\n- **Activities**\n    - `POST /activities`: Create a new activity\n    - `GET /activities`: Get a list of activities for a specific user\n    - `GET /activities/recent`: Get recent activities across all users\n    - `DELETE /activities/:id`: Delete an activity\n\nRefer to the API documentation or the specific route files for more details on the request/response formats and any\nrequired parameters.\n\n## Models\n\n- **Hike**: Represents a hiking activity entry.\n- **Trail**: Represents a hiking trail.\n- **Bookmark**: Represents a bookmarked trail.\n- **Review**: Represents a user review for a trail.\n- **Activity**: Represents a user activity or popular trail.\n\n## License\n\n```text\n   Copyright 2024 Matt Ramotar\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatt-ramotar%2Ftrails-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatt-ramotar%2Ftrails-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatt-ramotar%2Ftrails-server/lists"}