Code Monkey home page Code Monkey logo

wanderlist's Introduction

Wanderlist

Wanderlist is a responsive, single-page travel web application built on the Django framework with a Reactjs frontend. Users can create a custom map of all the countries they have traveled to, as well as write Trip Reports about their travels.

Now available on Google Play

Development

Create backend/local_settings.py and frontend/.env files for development from their respective .dist files and fill them out with the appropriate environment variables.

Build the docker containers and install dependencies:

make build

Set up the database:

make init

Start the servers:

make up

The Django dev server is now available at localhost:8000, and the React dev server is available at localhost:3000.

Unit Test:

make test

Stop and remove the docker containers:

make clean

REST API

The API endpoints are available at /api/v1/. The token refers to the token returned from authentication.

  • GET countries/
    Response: 200 OK

    [
      {
          "id": 1,
          "currencies": [
              {
                  "code": "AFN",
                  "name": "Afghan afghani",
                  "symbol": "Afs"
              }
          ],
          "languages": [
              {
                  "iso639_1": "ps",
                  "name": "Pashto",
                  "native_name": "پښتو"
              },
              {
                  "iso639_1": "tk",
                  "name": "Turkmen",
                  "native_name": "Türkmen, Түркмен"
              },
              {
                  "iso639_1": "uz",
                  "name": "Uzbek",
                  "native_name": "zbek, Ўзбек, أۇزبېك‎"
              }
          ],
          "regional_blocs": [
              {
                  "acronym": "SAARC",
                  "name": "South Asian Association for Regional Cooperation",
                  "other_acronyms": null,
                  "other_names": null
              }
          ],
          "name": "Afghanistan",
          "top_level_domain": [
              ".af"
          ],
          "alpha2code": "AF",
          "alpha3code": "AFG",
          "calling_codes": [
              "93"
          ],
          "capital": "Kabul",
          "alt_spellings": [
              "AF",
              "Afġānistān"
          ],
          "region": "Asia",
          "subregion": "Southern Asia",
          "population": 27657145,
          "latlng": [
              33.0,
              65.0
          ],
          "demonym": "Afghan",
          "area": 652230.0,
          "gini": 27.8,
          "timezones": [
              "UTC+04:30"
          ],
          "borders": [
              "IRN",
              "PAK",
              "TKM",
              "UZB",
              "TJK",
              "CHN"
          ],
          "native_name": "افغانستان",
          "numeric_code": "004",
          "flag": "https://raw.githubusercontent.com/peterzernia/flags/master/af.png",
          "cioc": "AFG"
      },...
    ]
    
  • GET reports/
    Response: 200 OK

    {
      "count": 12,
      "next": "http://www.wanderlist.dev/api/v1/reports/?page=2",
      "previous": null,
      "results": [
        ...
      ]
    }
    
  • POST reports/
    Request:

    headers: {
      "Authorization": `Token ${token}`
    }
    
    body: {
      title: "Trip Report",
      content: "Example Trip Report",
      author: 1,
      countries: 2,
    }
    

    Response: 201 Created

    {
      "id": 39,
      "author": {
        "pk": 1,
        "username": "peterzernia",
        "email": "[email protected]",
        "countries": [
          ...
        ],
        "home": {
          ...
        },
        "biography": "Test"
      },
      "countries": [
        ...
      ],
      "favoriters": [
    
      ],
      "title": "Trip Report",
      "content": "Example Trip Report",
      "date_posted": "2019-08-30T13:02:46.333552Z",
      "slug": "wxLtMRirkBtS"
    }
    
  • PATCH reports/:id
    Request:

    headers: {
      "Authorization": `Token ${token}`
    }
    
    body: {
      "title": "Trip Report Updated",
    }
    

    Response: 200 OK

    {
      "id": 39,
      "author": {
        "pk": 1,
        "username": "peterzernia",
        "email": "[email protected]",
        "countries": [
          ...
        ]
      }
      "title": "Trip Report Updated",
      ...
    }
    
  • GET reports/:id/favorite/
    Request:

    headers: {
      "Authorization": `Token ${token}`
    }
    

    Response: 200 OK

    {
      author: {
        pk: 1,
        username: "peterzernia",
        email: "[email protected]"
        ...
      },
      content: "Trip Report Example",
      countries: [{…}],
      date_posted: "2019-08-23T08:40:39Z",
      favoriters: [1],
    }
    
  • GET users/?search=peterzernia
    Response: 200 OK

    [
      {
          "pk": 1,
          "username": "peterzernia",
          ...
      }
    ]
    
  • Authentication follows the Django Rest Auth endpoints

Built With

Author

wanderlist's People

Contributors

peterzernia avatar imgbotapp avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.