Skip to content

lucasbarbosadias/nlw-journey-nodejs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Plann.er

Project developed during the NLW Journey by Rocketseat, following the NodeJs track. The entire back-end of a travel planner was developed from scratch.

Available APIs:

Trips

  • Get Trip Details:

    curl --location 'http://localhost:3333/trips/:tripId'
  • Create Trip:

    curl --location 'http://localhost:3333/trips' \
    --header 'Content-Type: application/json' \
    --data-raw '{
        "destination": "Destination name",
        "starts_at": "2025-01-01",
        "ends_at": "2025-01-10",
        "owner_name": "John Doe",
        "owner_email": "[email protected]",
        "emails_to_invite": [
            "[email protected]",
            "[email protected]",
        ]
    }'
  • Update Trip:

      curl --location --request PUT 'http://localhost:3333/trips/:tripId' \
    --header 'Content-Type: application/json' \
    --data '{
        "destination": "Destination name",
        "starts_at": "2025-01-01",
        "ends_at": "2025-01-10"
    }'
  • Confirm Trip:

    curl --location 'http://localhost:3333/trips/:tripId/confirm'
  • Confirm Participant:

    curl --location 'http://localhost:3333/participants/:participantId/confirm'

Participants

  • Get Participant:
    curl --location 'http://localhost:3333/participants/:participantId'
  • Get Participants:
    curl --location 'http://localhost:3333/trips/:tripId/participants'
  • Create Invite:
      curl --location 'http://localhost:3333/trips/:tripId/invites' \
    --header 'Content-Type: application/json' \
    --data-raw '{
        "email":"[email protected]"
    }'

Activities

  • Get Activities:
    curl --location 'http://localhost:3333/trips/:tripId/activities'
  • Create Activity:
      curl --location 'http://localhost:3333/trips/:tripId/activities' \
    --header 'Content-Type: application/json' \
    --data '{
        "title": "Activity name",
        "occurs_at": "2025-01-01"
    }'

Links

  • Get Link:
    curl --location 'http://localhost:3333/trips/:tripId/links'
  • Create Link:
      curl --location 'http://localhost:3333/trips/:tripId/links' \
    --header 'Content-Type: application/json' \
    --data '{
        "title": "Airbnb reservation",
        "url": "https://airbnb.com/reservation"
    }'

Useful commands to run the project locally

Install project dependencies:

npm i

Run the project locally:

npm run dev

Open the dashboard with the database in Prisma:

npx prisma studio

Create a new migration, which contains an SQL file with all the changes made to the database:

npx prisma migrate dev

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published