Skip to content

Commit

Permalink
Update README and increase request size limit
Browse files Browse the repository at this point in the history
  • Loading branch information
JermyTan committed Sep 5, 2020
1 parent de93aae commit 40d8686
Show file tree
Hide file tree
Showing 10 changed files with 90 additions and 41 deletions.
25 changes: 24 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
<p align="center">
<img src="./media/portfolify.png" alt="Giffindor" width="500"/>
</p>

<p align="center">
<img src="./media/iPad.png" alt="iPad" height="350"/>
<img src="./media/iPhone.png" alt="iPhone" height="350"/>
<img src="./media/macbook.png" alt="Macbook" height="300"/>
</p>

# Portfolify

[![Build Status](https://travis-ci.com/JermyTan/portfolify.svg?branch=master)](https://travis-ci.com/JermyTan/portfolify)

Portfolio builder with gallery view
Portfolify is a web app that serves as a portfolio builder for users to create posts and upload images to showcase/share their projects.

## Features

- CRUD posts.
- Image upload.
- Image crop.
- Supports url hyperlinks in post content.
- Responsive. Supports both mobile and desktop view. ​For the full mobile
experience, try installing this webapp to the home screen. E.g. visit the site -> option -> "Add to Home Screen".

## Setup

Instructions to set up the app are located in the READMEs in the frontend and backend folder respectively.
1 change: 1 addition & 0 deletions app-reverse-proxy/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ server {
access_log stdout;
listen 80;
server_name reverse-proxy;
client_max_body_size 100m;

## this is the internal Docker DNS, cache only for 30s
resolver 127.0.0.11 valid=30s ipv6=off;
Expand Down
53 changes: 48 additions & 5 deletions backend/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,56 @@
## Setup

Execute:
Ensure you have [python 3.8](https://www.python.org/downloads/release/python-385/) installed on your local machine.

### `python3 -m venv venv`
Then execute:

### `source venv/bin/activate`
For mac, **`python3 -m venv venv`**

### `pip install -r requirements.txt`
For windows, **`py -m venv venv`**

To create a virtual environment.

Next, depending on the platform and shell used in your local machine, execute the corresponding command to activate the virtual environment.

| Platform | Shell | Command to activate venv |
|----------|-------|--------------------------|
| POSIX | bash/zsh | $ source venv/bin/activate |
| | fish | $ . venv/bin/activate.fish |
| | csh/tcsh | $ source venv/bin/activate.csh |
| | PowerShell Core | $ venv/bin/Activate.ps1 |
| Windows | cmd.exe | C:\\> venv\Scripts\activate.bat |
| | PowerShell | PS C:\\> venv\Scripts\Activate.ps1 |

For e.g. on Mac, run **`source venv/bin/activate`**

Lastly, execute:

**`pip install -r requirements.txt`**

To install all app dependencies.

## Run development server

### `python manage.py runserver`
**`python manage.py runserver`**

## Unit test environment setup

Ensure you have [PostgreSQL](https://www.postgresql.org/) installed on your local machine.

Start the PostgreSQL server running in the background.

PostgreSQL default `<port number>` is **5432**. If port 5432 is not working, try port **5433**. Otherwise, you will have to find out which port your PostgreSQL server is listening on.

Then execute:

**`psql -U postgres -p <port number> -c "CREATE USER test with PASSWORD 'test';"`**

**`psql -U postgres -p <port number> -c "ALTER USER test CREATEDB;"`**

**` psql -U postgres -p <port number> -c "CREATE DATABASE test;"`**

Note: if you are not using port 5432, you will have to open the `.env.backend.test` file and change `SQL_PORT=5432` to `SQL_PORT=<port number used>`.

## Run unit tests

**`python manage.py test`**
1 change: 1 addition & 0 deletions core-reverse-proxy/client_max_body_size.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
client_max_body_size 100m;
1 change: 1 addition & 0 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ services:
restart: always
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- ./core-reverse-proxy/client_max_body_size.conf:/etc/nginx/conf.d/client_max_body_size.conf:ro
- nginx-certs:/etc/nginx/certs
- nginx-vhost:/etc/nginx/vhost.d
- nginx-html:/usr/share/nginx/html
Expand Down
45 changes: 11 additions & 34 deletions frontend/README.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,21 @@
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
## Setup

## Available Scripts
Ensure [yarn](https://yarnpkg.com/) is installed on your local machine.

Then execute:

**`yarn install`**

To install all app dependencies.

## Run development build

In the project directory, you can run:

### `yarn start`
**`yarn start`**

Runs the app in the development mode.<br />
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.

The page will reload if you make edits.<br />
You will also see any lint errors in the console.

### `yarn test`

Launches the test runner in the interactive watch mode.<br />
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

### `yarn build`

Builds the app for production to the `build` folder.<br />
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.<br />
Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

### `yarn eject`

**Note: this is a one-way operation. Once you `eject`, you can’t go back!**

If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.

You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

## Learn More

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).

To learn React, check out the [React documentation](https://reactjs.org/).
5 changes: 4 additions & 1 deletion frontend/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"
/>
<meta name="theme-color" content="#000000" />
<meta
name="description"
Expand Down
Binary file added media/iPad.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/iPhone.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/macbook.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 40d8686

Please sign in to comment.