Skip to content

Latest commit

 

History

History
149 lines (104 loc) · 4.42 KB

CONTRIBUTING.md

File metadata and controls

149 lines (104 loc) · 4.42 KB

Contributing Guide

Thanks for contributing to Safis CMS!

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Code Structure

This repository is a monorepo managed using Lerna. This means there are multiple packages managed in this codebase, even though we publish them to NPM as separate packages.

Requirements

  1. The owner of the repository needs to create a GitHub personal access token and select the repo scope.

  2. Create a GitHub OAuth App. Then set your "Authorization callback URL", this should be a combination of your domain and the value set for OAUTH_CALLBACK_URL env variable. e.g. http://localhost:3000/oauth/callback. We will use this app and will need to use its Client ID and Client secret to authenticate to GitHub.

  3. Check that Node is installed with version >= 14.17. You can check this with node -v.

Developing

Setup

Fork the safis-cms repository to your GitHub Account.

Cloning your safis-cms repo

$ git clone https://github.com/<your-github-username>/safis-cms

$ cd safis-cms

Dependencies

Install dependencies for the main repo and all packages by running once:

$ npm run lerna-install

Configuration

We will use environment variables to configure our safis-cms local environment. So we will need a .env file with the following configuration:

# Required
COOKIE_SECRET=my-cookie-secret
GIT_OWNER=username-here
GIT_OWNER_SECRET=secret-value # GitHub personal access token
GIT_REPO=repo-name
GIT_OAUTH_CLIENT_ID=oauth-app-client-id
GIT_OAUTH_CLIENT_SECRET=oauth-app-client-secret

# Optional
GIT_DEFAULT_BRANCH # default: main
GIT_OAUTH_SCOPE # comma separated value. e.g. scope1,scope2. Default: repo, the scope for your OAuth App
GIT_REPO_VISIBILITY # default: public
GIT_ROOT_FOLDER=custom-root-folder
GIT_CONTENT_TYPES_FOLDER # default: contentTypes
GIT_CONTENT_FOLDER # default: content
OAUTH_LOGIN_URL # default: /oauth/login
OAUTH_CALLBACK_URL # default: /oauth/callback
ENABLE_GRAPHQL_PLAYGROUND # default: true

You can use to the .env.example file at the root level of the repo to create your .env file.

Getting your local instance of safis-cms up and running

You can start safis-cms-server and safis-cms-app (coming soon...) in development mode by running:

$ npm run dev 

Running tests

Coming soon..

Linting

Coming soon...

Coverage

Coming soon...

Submitting Pull Requests

This project follows GitHub's standard forking model. Please fork the project to submit pull requests.

Releasing

Coming soon...