Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/duarteocarmo/flask_hackernews
🐍 A Hackernews clone in flask + python + sqlalchemy
https://github.com/duarteocarmo/flask_hackernews
flask hackernews hackernews-clone sqlalchemy
Last synced: about 1 month ago
JSON representation
🐍 A Hackernews clone in flask + python + sqlalchemy
- Host: GitHub
- URL: https://github.com/duarteocarmo/flask_hackernews
- Owner: duarteocarmo
- License: mit
- Created: 2018-11-06T11:34:31.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-05-01T20:27:22.000Z (over 1 year ago)
- Last Synced: 2024-08-14T07:08:31.849Z (5 months ago)
- Topics: flask, hackernews, hackernews-clone, sqlalchemy
- Language: Python
- Homepage: https://hackernews.duarteocarmo.com/
- Size: 8.63 MB
- Stars: 36
- Watchers: 1
- Forks: 6
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - duarteocarmo/flask_hackernews - 🐍 A Hackernews clone in flask + python + sqlalchemy (Python)
README
[**flask_hackernews**](https://hackernews.duarteocarmo.com/) is a minimalistic hackernews clone.
Built so that beginners who want a hackernews-like application can quickly get to work.
Greatly inspired by the awesome [flask megatutorial](https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world), one of the best ressources to learn more about flask.
It uses:
- `flask` as a web framework.
- `flask-sqlalchemy` as an ORM.
- `SQLite` as a database.
- `heroku` for a simple deployment.
- Other less known libraries listed in`requirements.txt`### Contents
- [Features](#Features)
- [Set up](#set-up-instructions)
- [Deployment](#Deployment)
- [About](#About)### Features
- user authentication
- upvoting on comments and posts
- karma
- user profiles
- post ranking algorithms based on the ['official'](https://news.ycombinator.com/item?id=1781417) one
- comment replies, threading and more!### Set up Instructions
*Follow these instructions if you wish to run this project locally*
- clone this repo
```bash
$ git clone https://github.com/duarteocarmo/flask_hackernews
```- create a virtual environment with the latest python version
- install requirements```bash
(venv) $ pip install -r requirements.txt
```- create a `.env` file in the home directory with the following structure
```python
FLASK_APP=flasknews.py
SECRET_KEY = "yoursecretkey"
MAIL_ADMIN_ADDRESS =
MAIL_SERVER =
MAIL_PORT =
MAIL_USE_TLS = 1
MAIL_USERNAME =
MAIL_PASSWORD =
```- initiate your database
```bash
(venv) $ flask db init
(venv) $ flask db upgrade
```- 🎉Run!!🎉
```bash
(venv) $ flask run
```- visit [`http://localhost:5000`](http://localhost:5000) to check it out.
### Deployment
*Follow these instructions to deploy your to the 🌎*
- Heroku: follow [this guide](https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-xviii-deployment-on-heroku).
- Docker: follow [this guide](https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-xix-deployment-on-docker-containers).
- Linux: follow [this guide](https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-xvii-deployment-on-linux).### About
This project was built by duarteocarmo. If you have any questions, [contact me](https://duarteocarmo.com)!