/photo-sharing-app

A web application for sharing phots and messages with your friends.

Primary LanguageHTMLMIT LicenseMIT

photo-sharing-app

An application for sharing photos with your friends.

Bandit badge Bandit badge Bandit badge Bandit badge Bandit badge Bandit badge Bandit badge Bandit badge Bandit badge Bandit badge Bandit badge Bandit badge Bandit badge Bandit badge Bandit badge

Application Overview

This is a social application that enables an authenticated and authorized user to share images and short messages with their friends. It is a responsive single page application built with python,flask, html, javascript and css.

Application Demo

The application supports the following operations:

  1. Account creation using a username and email address.
  2. Logging in and out
  3. Updating user information including he user password.
  4. Creating, viewing, deleting and updating posts which consist of an image andsome text.
  5. Reacting to posts, including liking and commenting.
  6. Sending private messages to other users.

Local Setup

To work with the application locally, first make sure the following are present:

  1. An AWS account, with the secret key and acess key.
  2. An s3 bucket with write and read permission.
  3. Docker and docker-compose are locally installed.
  4. Optionally an email address and email provider this project uses AWS SESS.

Folow these steps to start the application:

  1. Clone the project repo:
git clone https://github.com/twyle/photo-sharing-app.git
  1. Navigate to the project directory, then create the project secrets:
cd photo-sharing-app
touch ./services/app/.env

And then paste the following:

FLASK_DEBUG=True
FLASK_ENV=development
FLASK_APP=manage.py 
SECRET_KEY=secret-key 
POSTGRES_HOST=localhost
POSTGRES_USER=lyle
POSTGRES_PASSWORD=lyle
POSTGRES_DB=lyle
POSTGRES_PORT=5432
S3_BUCKET=<s3-bucket-name>
AWS_ACCESS_KEY=<aws-access-key>
AWS_ACCESS_SECRET=<aws-secret-key>
CELERY_BROKER_URL=
CELERY_RESULT_BACKEND
LOGGER_HOST=<ip-address>
LOGGER_PORT=
  1. Start the logging service:
docker-compose up -f services/logging/docker-compose.yml --build -d

This takes a while

  1. Start the application:
docker-compose -f docker-compose-dev up --build -d
  1. Navigate to flask.localhost to see the application.

Deployment

The application is containerized and deployed to AWS EC2. It uses AWS Route53 to direct traffic to an EC2 instance with docker and docker-compose installed. It uses traefik as a everse proxy. AWS S3 is used for image storage, AWS Postgres for data storage and these resources are provided using terraform.

Author ✒️