drakulix / knex Goto Github PK
View Code? Open in Web Editor NEWKNowledge EXchange platform
License: MIT License
KNowledge EXchange platform
License: MIT License
Complexity: S
Complexity: S
pease review:
Wiki
When I try to send a POST
request using http://localhost:5000/api/projects/search
or a GET
http://localhost:5000/api/projects/dummyadd
. I get the following error message from the browser (chrome):
post_request.html:14 XMLHttpRequest cannot load http://localhost:5000/api/projects/dummyadd. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.
(With postman it works)
I guess it has to do with CORS which has no impact on postman but on the normal browser. For testing you could use this file.
Check for frameworks that handle session management or even full user management via flask.
Create wiki page #7 with a basic API structure.
Update wikipage:
Colour Codes:
Black: #333333
Orange: #FF5500
Image Type: PNG
Size: ~600px Width
It would be perfect if you directly upload (commit) the image into the folder web/style/img
Name: knex_logo.png
Due To: Thursday Night
Setup a docker file launching MongoDB and your python project.
Decide on which testing framework to use:
According to Flask's docs "Flask provides a way to test your application by exposing the Werkzeug test Client and handling the context locals for you. You can then use that with your favourite testing solution."
So we should be rather free in whatever framework we use.
The docs itself uses unittest as an example on how to do it.
unittest: unit test framework included in Python standard library, practical if users have experience with xUnit frameworks
Links: Introduction to unittest
Basic Example
pytest: not in standard library, more extensive test-discovery than the simple one unittest has, you need in general less code lines to write the tests, able to run unittest style tests x
Links: Introduction to pytest
A third rather popular option seemed to be nose, however that one is not further developed and from what I've read most people switched to pytest, and some to unittest.
In the end both seem to be of use, they have different advantages, though from what I've seen pytest seems to be the most popular, and it was actually recommended to me by a friend who has already worked with flask together with pytest.
If anyone else has any recommendations or has already any experience with any of these (or something else) please feel free to share
Complexity: XS ,-)
{"_index": "projects-index", "_type": "Project", "_id": "1", "_version": 112, "result": "updated", "_shards": {"total": 2, "successful": 1, "failed": 0}, "created": false}{"_index": "projects-index", "_type": "Project", "_id": "2", "_version": 112, "result": "updated", "_shards": {"total": 2, "successful": 1, "failed": 0}, "created": false}{"_index": "projects-index", "_type": "Project", "_id": "3", "_version": 112, "result": "updated", "_shards": {"total": 2, "successful": 1, "failed": 0}, "created": false}
is not valid.
Complexity: M
If you click the name of the project in the table of ProjectDiscovery, you should land on the Project Details Page with the related Project Information.
Complexity: S
We don't wanna filter by Description right now, so remove also the input field for it.
I'm gonna update the mockups.
Move app.route
functions into projects.py
in a new api folder
(see structure below)
Check that it is still working and fix if needed
Rename the flask_api.py into init.py (see structure below)
Make sure everything works again
The overall structure of the project should look like this:
Complexity M
Search Query
Complexity: M
Writeup coding conventions (one done #3), explain overall structure, etc.
Complexity: S
Right now we use some online resources. to guarantee that the application in an offline environment works as expected we have to import every dependency locally.
Complexity: S
Task One: (Priority - High)
Task Two: (Priority - Low)
For the beginning I recommend that we filter client-side.
Upload some testdata to the database automatically for test framework usage
I've looked into tools for syncing, and these were the mentioned options:
creates a pipeline from a MongoDB cluster to one or more target systems, like Elasticsearch. It synchronizes data in MongoDB to the target then tails the MongoDB oplog, keeping up with operations in MongoDB in real-time. Can be easily installed with pip and seems to be the popular option since mongodb river is deprecated (for river read further).
See also the wiki of mongo-connector: Usage with Elasticsearch
is for synchronizing data e.g. from mongoDB to elasticsearch, however, that does come as a one time export and would need to be modified to keep it in sync (feature only in beta).
Logstash is an open source data collection engine with real-time pipelining capabilities. Logstash can dynamically unify data from disparate sources and normalize the data into destinations of your choice.
Has a plugin for output to elasticsearch, but only a community-maintained non-verified plugin for mongodb input. Probably possible but doesn’t seem like the easiest option.
MongoDB river seems to have been a popular choice, as well. But that one is deprecated and won’t work with the newest MongoDB version.
In the end I’d personally stick to mongo-connector, which had been suggested at first, too. Easily set up and actually made exactly for our purpose.
Task One: (Priority - High)
So, this ticket is about getting actual data from backend and displaying them in the Discovery View.
Therefore we need an API call that returns the manifest.json. The results should be shown in the table underneath.
A table row contains information about:
Task Two: (Priority - Medium)
We also wanna include a pagination that allows a user to switch between the result pages.
The maximum amount of table entries per page should be 15.
The post method has to handle multiple projects in one manifest
Complexity: L
I guess it would be the best to split this ticket so that two people can work on it.
One should work on JSON, the other one on "Create by Template".
But this is only a suggestion.
Update: We only need "create by JSON" as "create by template" is already done.
Complexity: M
This should include fetching only 15 elements/projects per page! We can adjust the amount of projects later on.
Basic travis support:
Complexity: M
A user should be able to edit existing projects. This happens via a button on the ProjectDetail Page. After the User presses it, he should see the CreateProject by Pattern View with filled Project information. Here can he edit the Project and save the changes by a button. For clarification I'm gonna attach a mockup (but this is not really necessary, you can already start without it)
last week we've created the most important views, for the next step it's needed to transform them into accessible pages where we can actually navigate through.
Complexity: M
I have to create Mocks first and think about possible cases. I'll keep you updated.
Create some folders.
Maybe
Create some example json files (not final format) and start implementing a basic validator.
Agree on coding conventions.
Tabs: 4 Spaces
Format: UTF-8
Line breaks: Unix Style
Recommendations:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.