Giter Club home page Giter Club logo

Comments (3)

jacob-macleod avatar jacob-macleod commented on September 26, 2024

The first stage is to test the current API methods to understand them. To do this, you can use an app called insomnia - https://insomnia.rest/download. Let me know if you need more info, but you do the following:

  • Download this code and make sure python is installed
  • Make sure backend/database/database_config.py stores type="local" to write to local files and not the actual database (for development and testing`
  • Type in pip3 install -r requirements.txt to the terminal
  • Type in python3 backend/main.py to the terminal
    This will tell you the URL the backend API server is running at

Note that if you don't use insomnia, you can go to a URL in your browser, but I don't think you can add json data to tell it userID and things like that.

Then, open insomnia:

{
  "userID":"my-id",
  "displayName": "my-name"
}

You can change the string values if you want, When you're ready, press the button to go to the route. A 200 OK message should be returned, telling you there were no errors. Open data.json, and you'll see that your new data has been added. Try this with a few more API routes to get a feel for how it works.

You'll need to do this to create an account so that when you read a user's totalXP, there will actually be a user. When you write the code to get a user's XP, and test it in insomnia, you will be passing it a json file that looks similar to this:

{
  "userID":"my-id"
}

Provided you tell it to accept that in the code. my-id will need to be the ID of an existing user stored in data.json

If you have any questions, please ask!

from dolphin-flashcard-app.

jacob-macleod avatar jacob-macleod commented on September 26, 2024

(This issue is not ready to be worked on yet)

from dolphin-flashcard-app.

jacob-macleod avatar jacob-macleod commented on September 26, 2024

This is now done

from dolphin-flashcard-app.

Related Issues (20)

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.