Comments (3)
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
storestype="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:
- Choose an API route to test. I would test
/api/create-account
from https://github.com/jacob-macleod/Flashcard-App/blob/main/backend/routes/api/authentication.py - Enter the URL from flask to Insomnia, adding
/api/create-account
. Select thePOST
method because in the code for that route it saysmethods=["POST"]
- Select the button to enter
json
in the text area of insomnia. Enter the following:
{
"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.
(This issue is not ready to be worked on yet)
from dolphin-flashcard-app.
This is now done
from dolphin-flashcard-app.
Related Issues (20)
- Add mobile support for flashcard overview page
- Implement card operations menu for flashcard overview page HOT 5
- Add the ability to create a folder HOT 4
- Add the ability to create a flashcard HOT 2
- Add the ability to search for flashcards
- Design and implement switch to firestore HOT 1
- Convert Documentation to Mintlify HOT 18
- Develop Edit Flashcards Page HOT 2
- Add the ability to delete cards
- Implement the Study Flashcards Page HOT 1
- Develop Sign In/Landing Page HOT 2
- Develop Dashboard Page HOT 1
- Fix pipeline error and improve code base accessibility HOT 3
- Improve issues
- IMPORTANT: Add API Testing HOT 13
- KeyError on create-account endpoint (local database config) HOT 2
- TypeError on create_flashcard endpoint (regex) HOT 2
- get-flashcard endpoint is returning None, regardless of given data HOT 3
- Unhandled exception on calculate_streak endpoint HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dolphin-flashcard-app.