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

Feature/contributors guide #130

Merged
merged 13 commits into from
Oct 30, 2024
Merged
10 changes: 5 additions & 5 deletions .github/workflows/deploy-vm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_KEY }}
source: "./docker-compose.dev.yml,./.env"
source: "./compose.prod.yml,./.env"
target: "~/${{ github.event.repository.name }}/"

- name: pull & start container images
Expand All @@ -46,7 +46,7 @@ jobs:
script: |
cd ~/${{ github.event.repository.name }}/
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{github.actor}} --password-stdin
docker compose -f docker-compose.dev.yml pull
docker compose -f docker-compose.dev.yml down
docker compose -f docker-compose.dev.yml up -d --wait --no-build --force-recreate
docker compose -f docker-compose.dev.yml logs -t -n 50
docker compose -f compose.prod.yml pull
docker compose -f compose.prod.yml down
docker compose -f compose.prod.yml up -d --wait --no-build --force-recreate
docker compose -f compose.prod.yml logs -t -n 50
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18.18.2
42 changes: 42 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Contributing to Vim Website

First of all, thanks for your interest in contributing to the new website. All tasks, whether they are bug fixes or new features, are tracked as issues in our GitHub repository. For each issue, we follow a feature-branch workflow.

The `development`-branch is the primary branch for ongoing work, while the `main`-branch is reserved for production deployment. When addressing an issue, please create a new feature branch from `development` with the branch name matching the issue id or title (e.g. feature/(id or title)), then submit a PR for review. Once your PR is reviewed and approved, it will be merged into development.

## Commit Messages

We follow the Conventional Commits specification. Please use the structure explained in the [quick summary](https://www.conventionalcommits.org/en/v1.0.0/#summary) of the specification. Commit messages are written in the imperative present tense, describing what the commit does, as if giving a command or instruction. Examples are listed below.

```text
feat(web): add redirect instead of console.log (due to linting)
fix(ci): avoid running deploy job on PR pushes
chore(deps-dev): bump eslint-plugin-unused-imports from 3.1.0 to 3.2.0 in /cms
```

## Development Setup

The setup for this project consists of three main parts: the website (web), the content management system (cms), and the database (db). The website is built with Next.js, while the CMS is Strapi, and MySQL 8 is used for the database. You'll need Node.js with npm for both web and cms. If you want to start the applications without docker please refer to the specific Node.js versions indicated in the `.nvmrc` file or the `engines` field in `package.json`. However, we use Docker to facilitate the development process. Both the website and CMS have their own Dockerfile. All components are managed together in a docker-compose file.

### Prerequisites

- Docker and Docker Compose
- Node.js and NPM
- MySQL 8
- Node version manager NVM
- Make

### Getting Started

```sh
git checkout development

# if you have node version manager installed otherwise ensure you have the correct node version, specified in .nvmrc
nvm use

# see makefile for available commands
make

# i.e install dependencies, setup .env files, start containers for local development and show logs
make dev logs
```
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ install npm dependencies and start the application using docker on port `3000`.
The following steps must be carried out:
1. Copy contents of `.env.example` files on `root`, `root/cms` and `root/web` into `.env` file
2. Install npm dependencies with `npm install` in the `root`, `root/cms` and `root/web` folder.
3. Startup: `docker compose -f docker-compose.local.yml up`
3. Startup: `docker compose up`

For more information about the headless CMS used in this project, visit the official documentation: https://docs.strapi.io/

Expand Down
1 change: 1 addition & 0 deletions cms/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ coverage
license.txt
exports
*.cache
.strapi
dist
build
.strapi-updater.json
2 changes: 1 addition & 1 deletion cms/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ RUN chown -R node:node /opt/app
USER node
RUN ["npm", "run", "build"]
EXPOSE 1337
CMD ["npm", "run", "develop"]
CMD ["npm", "run", "dev"]
6 changes: 3 additions & 3 deletions cms/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

Strapi comes with a full featured [Command Line Interface](https://docs.strapi.io/dev-docs/cli) (CLI) which lets you scaffold and manage your project in seconds.

### `develop`
### `dev`

Start your Strapi application with autoReload enabled. [Learn more](https://docs.strapi.io/dev-docs/cli#strapi-develop)

```
npm run develop
npm run dev
# or
yarn develop
yarn dev
```

### `start`
Expand Down
Loading