Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Analizzi scripts to rule them all #34

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 11 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,37 +23,23 @@ Please read the [contributing guidelines](https://github.com/CodeForPhilly/third
You will need to have a working understanding of using a Unix-like system via a terminal or shell and the instructions below use Bash commands.

In order to run this app, you will need to have the following libraries installed on your machine:
- Node: Javascript runtime
- npm: Node Package Manager
- Django: python web framework
- Python 3.9+
- Docker [Install here](https://www.docker.com/products/docker-desktop/)

Note: These installations will not be required locally once we have the project containerized, the container will hand that.
### First time setup

### Create .env file

#### Why a .env?
We will be using a `.env` file to share environment variables with each of the Docker containers and separate our environment variables from our code.

#### Make the actual file

Duplicate the `.env.sample` file and rename it to `.env`

#### Note

The `.env` file is ignored by git and so any changes will have to be communicated to the team to make sure API keys etc. stay aligned from dev to dev.
```sh
./scripts/bootstrap
./scripts/update
# This script will set up everything you need to get started.
```

### Start the servers

To run all servers (React, Django, & PostgreSQL):
```sh
# Build the containers from images
docker-compose build
# Run the servers
docker-compose up

# OR for a single command to do both
docker-compose up --build
# If you haven't updated in a while, run update script.
./scripts/update
# To run all servers (React, Django, & PostgreSQL):
./scripts/server
```

### Port Numbers
Expand Down
7 changes: 7 additions & 0 deletions scripts/bootstrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

if [ -f .env ]; then
echo ".env file already exists"
else
cp .env.sample .env
fi
8 changes: 8 additions & 0 deletions scripts/server
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh

# script/server: Launch the application and any extra required processes
# locally.

set -e

docker compose up
6 changes: 6 additions & 0 deletions scripts/update
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
set -e

# Build React app
echo "==> Building Third-Places app..."
docker-compose build --no-cache