-
The Savannah Global Health Institute web-app runs on React and Next.js version v10.0.8, and react version v17.0.1, To check the Next.js version installed in your machine run
npx next --version
, or runnpm view react version
to check the react version installed on your machine. -
You’ll need Node.js version 10.13 or later.
-
To check the details of the other dependencies in this project, check the
package.json
file in the root of the project.
Looks like we are done with the prerequisites :-)
-
Use
git clone [email protected]:optimalhealth/sil-web/sghi-web.git
to clone this project. -
Navigate into the root project directory.
-
Run
npm install
to install all packages in thepackage.json
file -
Finally run
npm run dev
on your terminal to start the development server. -
Open your favourite browser at http://localhost:3000 to view your project
-
Ensure all test dependencies are installed from the above process
-
Run
npm run test -- --coverage --watchAll=false
-
To view your coverage information you can check on terminal output or run
google-chrome coverage/lcov-report/index.html
from the root of the project. (Replace google-chrome with your favourite browser)
.next/
components/
|- head.js
|- navbar.js
docs/
node_modules/
pages/
|- api/
|- hello.js
|- _app.js
|- index.js
public/
|- favicons
|- site.webmanifest
styles/
|- modules/
|- navbar.module.css/
|- global.css
|- Home.module.css
tests/
|- index.test.js
.babelrc
.eslintrc.js
eslintrc.json
.gitignore
.gitlab-ci.yml
.prettierignore
.prettierrc
package-lock.json
package.json
README.md
setupTests.js
Our convention for a good commit message consists of a header, a body and a footer.
The message header is a single line that contains short and clear description of the change.
The following are message header examples that describe the kind of change that a commit is providing.
- feat (feature)
- fix (bug fix)
- docs (documentation)
- style (formatting, missing semi colons, …)
- refactor
- test (when adding missing tests)
- chore (maintain)
This is a very short description of the change.
- use imperative, present tense: “change” not “changed” nor “changes”
- don't capitalize first letter
- no dot (.) at the end
docs: healthcloud commit message convention
Separated with the Message Header by a line break, the message body contains paragraphs of changes. Follow below conventions.
- use imperative, present tense: “change” not “changed” nor “changes”
- includes motivation for the change and contrasts with previous behavior
- don't capitalize first letter
- no dot (.) at the end
The footer should contain any information about Breaking Changes which should start with the word BREAKING CHANGE: with a space or two newlines. The rest of the commit message is then the description of the change, justification and migration notes. It is also the place to reference GitLab issues that this commit Closes.
BREAKING CHANGE: isolate scope bindings definition has changed and
the inject option for the directive controller injection was removed.
Closes #392
docs: add healthcloud convention to readme
Couple of typos fixed:
- indentation
- syntax highlighting
- start periodic checking
- missing brace
Closes #03
- The commit message header can be used in solitary with a clear subject on issues with elementary changes.
- To close an issue automatically include the footer with a reference to the GitLab issue as demonstrated above.
Packages imported in every javascript file follow this order;
1 . Next.js imports
2 . Third-party package imports
2 . Lib imports ('lib/*')
3 . Pages imports ('pages/*')
4 . Component imports ('components/*')
5 . Constants imports ('components/constants/*')
6 . Global Style imports ('styles/*')
7 . Styled Modules imports ('styles/modules/*')
8 . Relative files ('../../')
Here are a few examples
// Next.js imports imports
import Head from 'next/head';
import Link from 'next/link';
import Image from 'next/image';
// Third party package imports
import GhostContentAPI from '@tryghost/content-api';
// lib imports
import { getPosts } from 'lib/posts';
// pages imports
import Team from 'pages/team';