Skip to content
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
6 changes: 6 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Copy this file to .env and edit to set project specific ENV variables
#
# See README.md for more details of some of our ENV variables

DB_NAME=replaceme
DB_PASSWORD=replaceme
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
dist/
node_modules/
.DS_Store
.env
58 changes: 31 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
# Starter Kit
# Spring action cleaning
A full stack PERN (PostgreSQL, Express, React, Node) project that aims to ease the tracking and recording of workers' hours.

## Prerequisites
- [Node] (10+)
- [PostgreSQL](https://www.postgresql.org/download/)
- Terminal access
- Web browser

## Features

[![Deploy to Heroku](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy)

Expand All @@ -14,32 +23,27 @@
- [x] [Cloud Foundry] deployment
- [x] [Docker] build

## Setup

Pick one member of the team to own the repository and pipeline. That person should do the following:

1. Create a fork of this repository for the team, and rename it something appropriate for your project.
2. Click the "Deploy to Heroku" button and create a Heroku account when prompted.
3. Fill in the name of the application, select Europe, then click "Deploy App".
4. Create a Heroku | Postgres | Hobby dev database. You have to connect the database to your existing application (Provision this add-on to an app).
5. If everything goes fine, you will have a DATABASE_URL config variable, in your project settings | config vars. You don't need to set it manually, it will be picked up when your app runs in Heroku. Since it's set only in the Heroku, the default local settings will be applied otherwise (see db.js in case you need to change it !!)
6. Once it has deployed successfully, click the "Manage app" button to view the application details.
7. Go to the "Deploy" tab, select "Connect to GitHub" and choose your repo.
8. Click "Enable automatic deploys".

Whenever you commit to master (or e.g. merge a [pull request]) it will get automatically deployed!

You should now make sure all of the project team are [collaborators] on the repository.

## Scripts

Various scripts are provided in the package file, but many are helpers for other scripts; here are the ones you'll
commonly use:

- `dev`: starts the frontend and backend in dev mode, with file watching (note that the backend runs on port 3100, and
the frontend is proxied to it).
- `lint`: runs ESLint against all the JavaScript in the project.
- `serve`: builds and starts the app in production mode locally.
## Setup to run locally
- Fork and clone this repository
- Install packages by running `npm install` in the project's root directory from your terminal.
- Create `.env` file and populate with your own values. Check `.env.example` for variables/format used.
``` bash
DB_NAME=spring # your database name
DB_PASSWORD=1234 # your database password
```
- Various scripts are provided in the package file, but many are helpers for other scripts; here are the most needed ones:
- `dev`: starts the frontend and backend in dev mode, with file watching (note that the backend runs on port 3100, and the frontend is proxied to it).
- `lint`: runs ESLint against all the JavaScript in the project.
- `serve`: builds and starts the app in production mode locally.

## Notes

- CSP (content security policy) is turned off by default.
``` javascript
helmet({
contentSecurityPolicy: false
})
```

### Debugging

Expand Down
4 changes: 2 additions & 2 deletions client/webpack/common.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ module.exports = {
{
test: /\.js$/,
exclude: /node_modules/,
loader: "babel-loader?cacheDirectory",
use: { loader: "babel-loader?cacheDirectory" },
},
{
test: /\.(png|svg|jpe?g|gif)$/,
loader: "file-loader",
use: { loader: "file-loader" },
},
{
test: /\.css$/,
Expand Down
1 change: 1 addition & 0 deletions client/webpack/dev.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const { merge } = require("webpack-merge");
const common = require("./common.config");

module.exports = merge(common, {
mode: "development",
devtool: "inline-source-map",
devServer: {
port: 3000,
Expand Down
5 changes: 3 additions & 2 deletions client/webpack/prod.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module.exports = merge(common, {
usePublicPath: false,
scripts: [
{
path: "https://unpkg.com/react@16.13.1/umd/react.production.min.js",
path: "https://unpkg.com/react@17.0.1/umd/react.production.min.js",
attributes: {
crossorigin: "",
},
Expand All @@ -38,7 +38,8 @@ module.exports = merge(common, {
},
},
{
path: "https://unpkg.com/react-dom@16.13.1/umd/react-dom.production.min.js",
path:
"https://unpkg.com/react-dom@17.0.1/umd/react-dom.production.min.js",
attributes: {
crossorigin: "",
},
Expand Down
Loading