A simplified Reddit clone built with Flask.
- Registration and authentication.
- Create communities.
- Create community posts.
- Reply to community posts.
- Edit or delete your communities, posts, and replies.
- Join communities.
- Get a feed of posts from your joined communities.
- Upvote or downvote posts and replies.
- Sort communities, posts, and replies by latest or most popular.
- Basic user profiles.
These instructions will get you a copy of the project up and running on your local machine for development. See deployment for notes on how to deploy the project.
To run this application you need Python, pip, and SQLite.
Clone the project.
git clone https://github.com/aqche/flaskeddit.git
Setup a venv
and use pip
to install the project dependencies.
cd flaskeddit
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
Set the FLASK_APP
environment variable, create the SQLite database, and start the app. Now you can give the application a try at http://localhost:5000!
export FLASK_APP=flaskeddit.py
flask cli create_db
flask run
You can also serve the application locally using gunicorn.
gunicorn "flaskeddit:create_app()"
Flaskeddit is tested using pytest.
Use pytest
to run the application's tests.
pytest
Flaskeddit is hosted on Heroku. To set up the required infrastructure for the project, you can use the terraform-heroku-app-postgres Terraform module.
module "terraform-heroku-app-postgres" {
source = "github.com/aqche/terraform-heroku-app-postgres.git"
name = "heroku-app-name"
sensitive_config_vars = {
SECRET_KEY = "<secret_key>"
}
}
The application is automatically deployed using CircleCI.
You can also use git
to manually deploy the application.
export HEROKU_API_KEY="<HEROKU_API_KEY>"
export HEROKU_APP_NAME="<HEROKU_APP_NAME>"
git push https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP_NAME.git master
Feel free to submit a pull request!
- aqche - Author - aqche
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE file for more details.
- reddit - The inspiration for this site.
- LogoHub - For the neat logo.
- favicon.io - For the matching favicon.