Skip to content

aqche/flaskeddit

Repository files navigation

flaskeddit

CircleCI

A simplified Reddit clone built with Flask.

flaskeddit.png

Features

  • 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.

Getting Started

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.

Prerequisites

To run this application you need Python, pip, and SQLite.

Local Setup

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()"

Testing

Flaskeddit is tested using pytest.

Use pytest to run the application's tests.

pytest

Deployment

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

Built With

Contributing

Feel free to submit a pull request!

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE file for more details.

Acknowledgments

About

Simple Reddit clone built with Flask

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages