Skip to content

Using nginx, Flask, and Postgres I made a CRUD website that supports new accounts, login, creating and reading tweets, and searching. These features had to function quickly even with 1million accounts and 10million tweets so I created RUM indexes to enable fast FTS. Additionally, I used best practices to protect against injection vulnerability.

Notifications You must be signed in to change notification settings

justinchiao/csci143-final

Repository files navigation

csci143-final

web-service

What this repo does

Chirper (formerly known as Y)
Basic Twitter clone to demo nginx, flask, and postgres.
1 million users world wide!
10 million chirps!

Build instructions

  1. Download all files from repository.\
  2. Create the file .env.prod file in the root. It should contain:
FLASK_APP=project/__init__.py
FLASK_DEBUG=1
DATABASE_URL=postgresql://postgres:pass@localhost:5432
SQL_HOST=postgres
SQL_PORT=5432
DATABASE=postgres
APP_FOLDER=/home/app/web
PGUSER=postgres
PGPASS=pass


3. Create the file .env.prod.db in the root. It should contain:

POSTGRES_USER=postgres
POSTGRES_PASSWORD=pass
POSTGRES_DB=postgres


4. Run:

$ docker-compose -f docker-compose.prod.yml up -d --build
$ sh load_data.sh

load_data.sh can be modified to create more fake data. It will create 10x more chirps than there are users.

About

Using nginx, Flask, and Postgres I made a CRUD website that supports new accounts, login, creating and reading tweets, and searching. These features had to function quickly even with 1million accounts and 10million tweets so I created RUM indexes to enable fast FTS. Additionally, I used best practices to protect against injection vulnerability.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published