Giter Club home page Giter Club logo

3rstore's Introduction

An application for storing and managing links online.

Status

This application is currently available here

Running it locally

Ooh boy here we go.

First of all you need Python 3.x Then, go ahead and install PIP. Instructions for its installation are available here

To make sure all the depedencies are installed run:

pip install -r requirements.txt

Next, you must have a PostgreSQL database created. For that you can use PG Admin.

You will then have to create a config.json file which has the following structure:

{
    "DB":{
        "USER": <DB_USER>,
        "PWD": <DB_PASSWORD>,
        "HOST": <DB_HOST>,
        "DATABASE": <DB_NAME>,
        "PORT": <DB_PORT>
    },
    "SECRET_KEY": <your_scecret_key>,
    "MAIL_SERVER":"smtp.gmail.com",
    "MAIL_PORT":465,
    "MAIL_USE_TLS":false,
    "MAIL_USE_SSL":true,
    "MAIL_USERNAME": <EM_USER>,
    "MAIL_PASSWORD": <EM_PASSWORD>,
    "MAIL_DEFAULT_SENDER": <EM_USER>
}
  • The MAIL settings/fields are necessary for the password recovery process, if you don't plant on using the feature you can remove them.

  • The specified MAIL_SERVER and MAIL_PORT are for use with a GMAIL address.

  • The MAIL_DEFAULT_SENDER property can be removed but then you will have to specify the sender when building a Message


Since the project's file structure has changed, a simple

python __init__.py

will not suffice.

Running the app with docker-compose

It's heavily encouraged to run the project locally using docker-compose. Simply running docker-compose up should suffice. Afterwards, you should be able to access the site on localhost:5000.

Running the app with flask

First you need to set the environment variable for the application.

One way to do this is :

From /3RStore

On linux:

export FLASK_APP=_3RStore/__init__.py

On windows:

set FLASK_APP=_3RStore/__init__.py

Then (from this directory) simply run :

flask run

to launch the server. A prompt indicating sucessfull launch should appear in the console.

If you want to set Flask's debug mode on you can use:

export FLASK_DEBUG=true

And

set FLASK_DEBUG=true

For Linux and Windows respectively.

Finally, you can open your browser and go to

http://127.0.0.1:5000/

If you get an error regarding the build environment, set/export the FLAK_ENV variable to whatever you please


Running the app with waitress

First run

python server.py

Then go to

http://127.0.0.1:8080/

Ta-da!

3rstore's People

Contributors

iamaldi avatar tsimpdim avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

3rstore's Issues

Automatic tags when importing

Since you can organize your bookmarks into folders, it would be great if the names of the folders were represented as tags.

Decode URLs from UTF-8 when adding/editing/importing a resource

Better handling of resource deletion

Right now one can easily delete a resource by accident and there's no way he can recover it.

A confirmation of sorts must definitely be put in place and a way to recover deleted resources would be a great addition

Persistent sessions

When a user first logins we can create a unique session_id and store that in the db with his username and as a cookie.

Then we can use this decorator to check if the user has logged in before from this device (by checking if a cookie with a session_id exists and grabbing his info from the db).

Remove tag entirely

Perhaps it would be useful for a user to remove a tag from every resource.

Although removing values from pg arrays might seem problematic/difficult, since we are using pg 10+ we could use this

When editing a resource no messages appear

If for example you don't enter a title, what should happen is a little message appears saying that you need to fill the field. But nothing appears, instead you are redirected to /resources

An export button

Since we can import, it'd be nice to be able to export too...just in case.

UTF8 decoding on import

Fix UTF-8 decoding when importing resources. Currently UTF-8 decoding exists only when adding resources manually.

To decode we use parse.unquote(<link>)

Forgot password process

Perhaps it is far fetched / useless for such a small scale app but it would be nice to learn how to implement such a process

Add ability to remove unwanted tags from search.

If for example I have some resources with the tags books, books read and others with the tag books right now if I search for books I will get both. But what if I only want the ones without the books read tag?

Error 500 when exporting resources

File "/app/_3RStore/views.py", line 628, in export_to_html
root_folder_exists = soup.find('H3', string=tag_array[i-1][0])
IndexError: tuple index out of range

Allow for a more compact view

Either in the options or in the resources page there should be icons/buttons to change the view to either be compact or normal

A delete all button

Title. This could be expanded to be a "Delete all resources with tag x" button.

Error 500 when editing a resource without a note

`File "C:\Users\Home\Desktop\Misc\Dim\3RStore_3RStore\views.py", line 347, in edit_res

form.note.data = data[0]['note'].replace('</br>','\n') # Else the
tags will display as text `

AttributeError: 'NoneType' object has no attribute 'replace'

Minor changes

  • Change the header color on mobile browsers (right now it is a shade of blue)

  • Remove the focus borders from the buttons (namely the header buttons and the burger menu)

  • Fix/Improve the two 'delete resources' options being too close to one another in small screens

  • Add a small bottom margin in the resource container when using the compact view

Database insertions - sanitization of text

Although psycopg2 is supposed to handle sanitization via the query format specified in the docs, adding a resource with title: '--' or ' "" ' will turn the link to '--' or ' "" 'as well, although the note will be left as is.

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.