Code Monkey home page Code Monkey logo

portend's People

Contributors

exotech-code avatar

Watchers

 avatar

portend's Issues

Token authenticator

Make a function that authenticates the admin token required by all of the admin panel's APIs. Also it will have a token expiration function as proposed in issue #13.

Admin panel credential validation

Create an API that returns a token on successful login. All other APIs in the admin panel will require the frontend to provide this token with every call.

Return empty objects

If too many values have been requested, return empty objects in the amount that exceeds how many of them have been actualy returned from the database.

Format JSON properly

Before I didn't know that JSON lists of objects are formatted with square brackets. I will attempt to fix the output formatting for my list of dicts with Python's native JSON library. If that won't work, I will create my own solution for this problem.

Markdown compiler

This will be part of the Python-Flask API. The string inside 'content' part of the post object will be compiled from Markdown into HTML. Then the HTML string will be used by the function, that stores new post in the database.

Photo upload API

I need to create an API for uploading photos and fetching already present photos on the server. A photo will be saved to a web server and its location will be saved in images table in the database (this is POST API). If I would like to use the same photo in two places, a GET call (to the same API) will be used to fetch information about all photos currently saved on the server. Then I will be able to select the desired photo from the list in the file uploader component.

APIs for admin panel

I need to make two new HTTP APIs.

  • One will take a newly written blog post from the editor with all its metadata and pipe the Markdown content through a compiler. Then it will save the finished piece into a database.
  • Second one will respond to deletion of a post and send a list of deleted posts if requested. For this one I will have to create a table that will keep track of deleted posts.

Shared connections to database

Instead of having a function connect every time it makes a request use shared connections.
For example update function should initialize a connection and pass that connection to fetchResults() when it needs to get anything back from the database.

I could enable that functionality by editing the fetchResults() like so:

def fetchResults(connection=connectToDB(), query):

Containerization

I need to create a multistage Docker build that will combine my backend and frontend under the same proxy. This way I will be able to serve API and frontend on the same port.

Remove token after certain amount of time

Right now an user has access to admin panel for an infinite amount of time after he/she has logged in. The admin token has to be ephemeral in order to be secure. In this case I need to build a function that checks how old the token is on every token validation. If it's older than one day, the token validation function will cause the requested API to return HTTP 401 code. Frontend then will redirect user to login page, where he/she can get a new token.

Retrieve posts from database

I want Portend to be able to retrieve all posts from MySQL database. In order to do that I have to use mysql-connector-python. It is basically the same thing that I have used for C++.

API endpoint

After connecting to a db and retrieving all the data I need. Portend needs to present it as an easily ingestible JSON endpoint. For this purpose I will use Flask

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.