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
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![Stories in Ready](https://badge.waffle.io/smashingboxes/web-boilerplate.png?label=ready&title=Ready)](https://waffle.io/smashingboxes/web-boilerplate)
# web-boilerplate
A template for new front-end projects.
A template for new front-end projects.
[Waffle.io Board](https://waffle.io/smashingboxes/web-boilerplate)

## Info
Expand All @@ -11,6 +11,26 @@ A template for new front-end projects.
## Using
*NOTE: There are some additional steps for setting up a new project that are documented [here](https://github.com/smashingboxes/development-wiki/blob/master/technobabble/setting_up_a_new_project.md). The steps documented here are just the ones needed to set up the code for the repo.*

### Initing with a script
*NOTE: this is an experimental script, run with caution
1. Clone the repo
```
git clone https://github.com/smashingboxes/web-boilerplate
```
2. Create your repo on GitHub
it should look something like https://github.com/smashingboxes/my-project
3. Go into web-boilerplate
```
cd web-boilerplate/
```
4. Run an init script
```
./init.sh
```

## or

### Manual steps
1. Clone the repo
```
git clone https://github.com/smashingboxes/web-boilerplate
Expand Down
66 changes: 66 additions & 0 deletions init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#!/bin/sh
echo "what is your PROJECT_NAME?"
read PROJECT_NAME
cd ..
mv web-boilerplate $PROJECT_NAME
cd $PROJECT_NAME
rm -rf .git
git init .

echo "# $PROJECT_NAME
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. I like the idea of building up a readme for the new project. I think a better way to do it though would be to have a README_TEMPLATE.md file, that you copy into place with rm README.md && mv README_TEMPLATE.md README.md

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dkniffin Is there an easy to interpolate values like this in markdown? I really like the idea of building the readme like this where we can set stuff like the project name

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason I kept it in the script itself was so that there's less cleanup if you didn't go with the script. I considered writing it so that if you tried to run it after changing it away from web-boilerplate that it would just delete itself.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering why anyone would actually want to do this manually, now that we have a script

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point.


## Commands

Run the server with:
\`\`\`
yarn start
\`\`\`

Run your tests with:
\`\`\`
yarn test
\`\`\`

Run a build with:
\`\`\`
yarn build
\`\`\`

## Docker Commands

### Docker is not needed to run the boilerplate

Build and start the server:
\`\`\`
docker-compose up --build
\`\`\`

Run your tests with:
\`\`\`
docker-compose exec web yarn test
\`\`\`

Run a build with:
\`\`\`
docker-compose exec web yarn build
\`\`\`

If your terminal closes run:
\`\`\`
docker-compose logs --follow
\`\`\`
" > README.md

git add .
git reset ./init.sh
git commit -m "first commit"
git remote add origin https://github.com/smashingboxes/$PROJECT_NAME.git
git push -u origin master

echo "

You're all set. Please check out your project at
https://github.com/smashingboxes/$PROJECT_NAME
"

rm ./init.sh
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:rip: