{"id":15174024,"url":"https://github.com/usgmathe/plann.er-backend","last_synced_at":"2026-03-06T23:31:46.804Z","repository":{"id":247888997,"uuid":"827132806","full_name":"UsgMathe/plann.er-backend","owner":"UsgMathe","description":"Trip Planner created during the NLW Journey event by Rocketseat","archived":false,"fork":false,"pushed_at":"2024-07-11T05:16:32.000Z","size":29,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-11T10:42:10.361Z","etag":null,"topics":["dayjs","fastify","nodejs","nodemailer","prisma","rocketseat","rocketseat-nlw","typesc","zod"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/UsgMathe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"publiccode":null,"codemeta":null}},"created_at":"2024-07-11T04:42:33.000Z","updated_at":"2024-07-11T05:19:46.000Z","dependencies_parsed_at":"2024-07-11T05:52:53.659Z","dependency_job_id":"caaf98f7-f944-4d8e-8641-0241008c431b","html_url":"https://github.com/UsgMathe/plann.er-backend","commit_stats":null,"previous_names":["usgmathe/plann.er-backend"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UsgMathe%2Fplann.er-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UsgMathe%2Fplann.er-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UsgMathe%2Fplann.er-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UsgMathe%2Fplann.er-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/UsgMathe","download_url":"https://codeload.github.com/UsgMathe/plann.er-backend/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242157277,"owners_count":20081041,"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":["dayjs","fastify","nodejs","nodemailer","prisma","rocketseat","rocketseat-nlw","typesc","zod"],"created_at":"2024-09-27T11:23:01.969Z","updated_at":"2026-03-06T23:31:46.750Z","avatar_url":"https://github.com/UsgMathe.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Plann.er Backend\n\nThis is the backend for the Plann.er project, a Trip Planner created during the NLW Journey event by Rocketseat, in the Node.js track. We used Node.js with technologies like Fastify, Zod, Prisma, Dayjs, and Nodemailer, all with TypeScript.\n\n## Overview\n\nThis project allows you to create travel plans with start and end dates, add participants, and manage activities and links related to the trip.\n\n## Prerequisites\n\nMake sure you have the following software installed on your system:\n- [Node.js](https://nodejs.org/) (which includes npm)\n- [Git](https://git-scm.com/)\n\n## Setup\n\nFollow these steps to set up and run the project locally.\n\n### 1. Clone the repository\n\n```bash\ngit clone https://github.com/UsgMathe/plann.er-backend.git\ncd plann.er-backend\n```\n\n### 2. Install dependencies\n\n```bash\nnpm install\n```\n\n### 3. Configure the .env file\n\nCreate a `.env` file in the root of the project with the following content:\n\n```env\nDATABASE_URL=\"file:./dev.db\"\nAPI_BASE_URL=\"http://localhost:your_port\"\nWEB_BASE_URL=\"frontend_url\"\nPORT=desired_port\n```\n\n### 4. Run the development server\n\n```bash\nnpm run dev\n```\n\nThis will start the development server in `DATABASE_URL`.\n\n## Routes\n\n### Create Trip\n\n- **Method:** POST\n- **URL:** `{{ DATABASE_URL }}/trips`\n- **Body:**\n  ```json\n  {\n    \"destination\": \"Destination\",\n    \"starts_at\": \"2024-07-18 07:30:00\",\n    \"ends_at\": \"2024-07-27 18:00:00\",\n    \"owner_name\": \"name\",\n    \"owner_email\": \"email@email.com\",\n    \"emails_to_invite\": [\"test@hotmail.com\", \"planner@teste.com\"]\n  }\n  ```\n\n### Update Trip\n\n- **Method:** PUT\n- **URL:** `{{ DATABASE_URL }}/trips/:trip_id`\n- **Body:**\n  ```json\n  {\n    \"destination\": \"Destination\",\n    \"starts_at\": \"2024-07-18 07:30:00\",\n    \"ends_at\": \"2024-07-27 18:00:00\"\n  }\n  ```\n\n### Get Trip Details\n\n- **Method:** GET\n- **URL:** `{{ DATABASE_URL }}/trips/:trip_id`\n\n### Get Trips\n\n- **Method:** GET\n- **URL:** `{{ DATABASE_URL }}/trips`\n\n### Confirm Trip\n\n- **Method:** GET\n- **URL:** `{{ DATABASE_URL }}/trips/:trip_id/confirm`\n\n### Create Invite\n\n- **Method:** POST\n- **URL:** `{{ DATABASE_URL }}/trips/:trip_id/invites`\n- **Body:**\n  ```json\n  {\n    \"email\": \"test@outlook.com\"\n  }\n  ```\n\n### Get Participants\n\n- **Method:** GET\n- **URL:** `{{ DATABASE_URL }}/trips/:trip_id/participants`\n\n### Get Participant\n\n- **Method:** GET\n- **URL:** `{{ DATABASE_URL }}/participants/:participant_id`\n\n### Confirm Participant\n\n- **Method:** GET\n- **URL:** `{{ DATABASE_URL }}/participants/:participant_id/confirm`\n\n### Create Trip Activity\n\n- **Method:** POST\n- **URL:** `{{ DATABASE_URL }}/trips/:trip_id/activities`\n- **Body:**\n  ```json\n  {\n    \"title\": \"Coffe\",\n    \"occours_at\": \"2024-07-27 05:50\"\n  }\n  ```\n\n### Get Trip Activities\n\n- **Method:** GET\n- **URL:** `{{ DATABASE_URL }}/trips/:trip_id/activities`\n\n### Create Trip Link\n\n- **Method:** POST\n- **URL:** `{{ DATABASE_URL }}/trips/:trip_id/links`\n- **Body:**\n  ```json\n  {\n    \"title\": \"Trip Playlist\",\n    \"url\": \"https://open.spotify.com/playlist/6E833f42r1aCkmJFipyl5Q?si=74bd776d3aee4231\"\n  }\n  ```\n\n### Get Trip Links\n\n- **Method:** GET\n- **URL:** `{{ DATABASE_URL }}/trips/:trip_id/links`\n\n## Learn More\n\nTo learn more about the technologies used in this project, check out the following resources:\n\n- [Fastify](https://www.fastify.io/)\n- [Zod](https://zod.dev/)\n- [Prisma](https://www.prisma.io/)\n- [Dayjs](https://day.js.org/)\n- [Nodemailer](https://nodemailer.com/about/)\n- [TypeScript](https://www.typescriptlang.org/)\n\n---\n\nI hope this documentation is clear and helps with the setup and execution of the project!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fusgmathe%2Fplann.er-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fusgmathe%2Fplann.er-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fusgmathe%2Fplann.er-backend/lists"}