Skip to content

Commit 249afd8

Browse files
Merge pull request #35 from CodeForPhilly/develop
Release: v0.1.0
2 parents 7d1781d + 3799880 commit 249afd8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+3816
-2
lines changed

.env.sample

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
PGDATABASE=""
2+
PGUSER=""
3+
PGPASSWORD=""
4+
PGHOST=""
5+
PGPORT=""
6+
THIRDPLACES="THIRDPLACES"

.github/ISSUE_TEMPLATE/bug_report.md

+9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
---
2+
name: Bug Report
3+
about: Create a report to help us improve
4+
title: "[Bug] "
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
110
# Overview
211

312
Describe the bug

.github/ISSUE_TEMPLATE/feature_request.md

+9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: "[Feature Request] "
5+
labels: enhancement
6+
assignees: ''
7+
8+
---
9+
110
# Overview
211

312
Describe what you'd like to see added

.github/workflows/release-prepare.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: 'Release: Prepare PR'
2+
3+
on:
4+
push:
5+
branches: [ develop ]
6+
7+
permissions:
8+
contents: read
9+
pull-requests: write
10+
11+
jobs:
12+
release-prepare:
13+
14+
runs-on: ubuntu-latest
15+
steps:
16+
17+
- uses: JarvusInnovations/infra-components@channels/github-actions/release-prepare/latest
18+
with:
19+
github-token: ${{ secrets.GITHUB_TOKEN }}
20+
release-branch: main

.github/workflows/release-publish.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: 'Release: Publish PR'
2+
3+
on:
4+
pull_request:
5+
branches: [ main ]
6+
types: [ closed ]
7+
8+
jobs:
9+
release-publish:
10+
11+
runs-on: ubuntu-latest
12+
steps:
13+
14+
- uses: JarvusInnovations/infra-components@channels/github-actions/release-publish/latest
15+
with:
16+
github-token: ${{ secrets.BOT_GITHUB_TOKEN }}
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: 'Release: Validate PR'
2+
3+
on:
4+
pull_request:
5+
branches: [ main ]
6+
types: [ opened, edited, reopened, synchronize ]
7+
8+
jobs:
9+
release-validate:
10+
11+
runs-on: ubuntu-latest
12+
steps:
13+
14+
- uses: JarvusInnovations/infra-components@channels/github-actions/release-validate/latest
15+
with:
16+
github-token: ${{ secrets.GITHUB_TOKEN }}

.gitignore

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# config
2+
.env
3+
4+
# macOS
5+
.DS_Store
6+
7+
# JS
8+
node_modules/
9+
10+
# React
11+
src/app/build/
12+
13+
# Django
14+
src/django/static
15+
src/django/db.sqlite3
16+
*-310.pyc
17+
*/__pycache__/
18+
19+
# IDE/Text Editor configs
20+
.vscode
21+
.idea

CHANGELOG.md

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to release number versioning.
7+
8+
## [Unreleased]
9+
10+
### Added
11+
12+
- Set up React and Django boilerplate [#1](https://github.com/CodeForPhilly/third-places/pull/1)
13+
- Added Docker containers with docker-compose [#10](https://github.com/CodeForPhilly/third-places/pull/10)
14+
- Set up Leaflet React component and boiletplate homepage[#7](https://github.com/CodeForPhilly/third-places/issues/7)
15+
- Added initial Django models & migration [#21](https://github.com/CodeForPhilly/third-places/pull/21)
16+
17+
### Changed
18+
19+
### Deprecated
20+
21+
### Removed
22+
23+
### Fixed
24+
- Issue template [#9](https://github.com/CodeForPhilly/third-places/pull/9)
25+
26+
27+
[Unreleased]:

CONTRIBUTING.md

+15-1
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,20 @@ Once your changes are approved, you can hit the `merge` button to merge to the `
132132

133133
Please also delete the branch from Github (you'll be prompted).
134134

135+
### Update changelog
136+
137+
We keep a changelog following the [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) format. In the unreleased section add the following line to one of the sections within unreleased:
138+
139+
```md
140+
141+
### Added
142+
143+
- Add your PR title [#1](https://github.com/CodeForPhilly/third-places/pull/1)
144+
145+
```
146+
147+
You would use your PR's title, the number of your PR, and the link to that PR. There are a few sections: `Added, Changed, Deprecated, Removed, Fixed, Security`, and you should add your line to the section that best matches what your PR is contributing.
148+
135149
### Clean up
136150

137151
Once you've merged your work go back to your terminal
@@ -145,4 +159,4 @@ git pull
145159

146160
# Delete the branch from your local machine
147161
git branch -d <new-branch-name>
148-
```
162+
```

README.md

+50-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,53 @@ Please read the [contributing guidelines](https://github.com/CodeForPhilly/third
1818

1919
## Setup
2020

21-
This project's code is still being set up by the team. Visit here again in the future or join [the discussion](#joining-the-regular-meetings).
21+
### Requirements
22+
23+
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.
24+
25+
In order to run this app, you will need to have the following libraries installed on your machine:
26+
- Node: Javascript runtime
27+
- npm: Node Package Manager
28+
- Django: python web framework
29+
- Python 3.9+
30+
31+
Note: These installations will not be required locally once we have the project containerized, the container will hand that.
32+
33+
### Create .env file
34+
35+
#### Why a .env?
36+
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.
37+
38+
#### Make the actual file
39+
40+
Duplicate the `.env.sample` file and rename it to `.env`
41+
42+
#### Note
43+
44+
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.
45+
46+
### Start the servers
47+
48+
To run all servers (React, Django, & PostgreSQL):
49+
```sh
50+
# Build the containers from images
51+
docker-compose build
52+
# Run the servers
53+
docker-compose up
54+
55+
# OR for a single command to do both
56+
docker-compose up --build
57+
```
58+
59+
### Port Numbers
60+
61+
Access the following ports from localhost to access their respective services
62+
63+
| Service | Port |
64+
|---------|------|
65+
| React | 4321 |
66+
| Django | 8321 |
67+
68+
### Api Reference
69+
70+
`/api/`: Hello world!

docker-compose.yml

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
services:
3+
app:
4+
image: node:18-slim
5+
build:
6+
context: ./src/app
7+
dockerfile: Dockerfile
8+
working_dir: /usr/local/src
9+
environment:
10+
- PORT=4321
11+
volumes:
12+
- ./src/app:/usr/local/src
13+
- node-modules-volume:/usr/local/src/node_modules
14+
command: npm run dev --host
15+
ports:
16+
- 4321:4321
17+
18+
database:
19+
image: postgis/postgis:13-3.1
20+
environment:
21+
- POSTGRES_USER=$THIRDPLACES
22+
- POSTGRES_PASSWORD=$THIRDPLACES
23+
- POSTGRES_DB=$THIRDPLACES
24+
healthcheck:
25+
test: ["CMD", "pg_isready", "-U", "$THIRDPLACES", "-h", "database"]
26+
interval: 1s
27+
timeout: 30s
28+
retries: 30
29+
30+
django:
31+
image: python:3.10-slim
32+
env_file: .env
33+
environment:
34+
- PGHOST=database
35+
- PGPORT=5432
36+
- PGUSER=$THIRDPLACES
37+
- PGPASSWORD=$THIRDPLACES
38+
- PGDATABASE=$THIRDPLACES
39+
- DJANGO_ENV=Development
40+
- DJANGO_SECRET_KEY=secret
41+
- DJANGO_LOG_LEVEL=INFO
42+
- DJANGO_ALLOWED_HOSTS=localhost,django
43+
build:
44+
context: ./src/django
45+
dockerfile: Dockerfile
46+
labels:
47+
com.project.name: "third-places"
48+
volumes:
49+
- ./src/django:/usr/local/src
50+
working_dir: /usr/local/src
51+
depends_on:
52+
database:
53+
condition: service_healthy
54+
command: >
55+
bash -c
56+
"python3 manage.py migrate && python3 manage.py runserver 0.0.0.0:8321"
57+
ports:
58+
- 8321:8321
59+
60+
volumes:
61+
node-modules-volume:

src/app/.dockerignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules/*
2+
npm-debug.log

src/app/.gitignore

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

src/app/Dockerfile

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM node:18-slim
2+
ARG HOME=usr/local/src/
3+
WORKDIR $HOME
4+
5+
COPY entrypoint.sh /entrypoint.sh
6+
RUN chmod +x /entrypoint.sh
7+
8+
ADD . .
9+
ENTRYPOINT [ "/entrypoint.sh" ]
10+
CMD ["npm", "run", "dev", "--host"]
11+
EXPOSE 4321

src/app/entrypoint.sh

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
3+
npm install
4+
npm rebuild esbuild
5+
6+
exec "$@"

src/app/index.html

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Vite + React + TS</title>
8+
</head>
9+
<body>
10+
<div id="root"></div>
11+
<script type="module" src="/src/main.tsx"></script>
12+
</body>
13+
</html>

0 commit comments

Comments
 (0)