Skip to content

omshub/website

Repository files navigation

OMSHub

license contributors count pull requests closed

A website for Online Master's of Science (OMS) course reviews at Georgia Tech.

Resources

OMSHub

OMS program home pages

Other

Development

Getting started (VSCode fast-path)

This project includes a .devcontainers configuration that can be used by VSCode to create a one-click development environment with Docker. The Docker container includes all of the dependencies you need to get started, forwards the NextJS and Storybook ports to your local machine, and mounts the repository into the container so changes persist outside of Docker.

To get started:

  1. Install the Remote - Containers VSCode extension.
  2. Open the repository with VSCode. You should see a prompt on the bottom left of the screen to open the project inside the container.

Getting started

Clone the repository and then run the following commands to build the NextJS application:

yarn install
yarn build

To start the project locally, run:

yarn start

Open http://localhost:3000 with your browser to see the result. See README.md in /__seed__ for more details regarding seeding backend data (e.g., in a cloud Firebase project).

Running the local Firebase emulator for local dev environment

Ensure that the following is defined locally in environment file website/.env:

NEXT_PUBLIC_IS_EMULATOR_MODE=true
NEXT_PUBLIC_FIRESTORE_EMULATOR_HOST=localhost:8080

To launch the local emulator, run:

yarn install
yarn fb:emu

This will create a local emulator instance of Firebase, with local UI Firebase dashboard accessible via http://localhost:4000 which provides the Firebase Emulator Suite for local services (e.g., Firestore).

Next, to start the project locally, in a separate terminal instance run:

yarn build
yarn dev

Note: A cloud-based Firebase project must still exist in order to run the emulator locally in this manner. Simply create a blank/empty Firebase project using a Google account for this purpose, and then populate file website/.env accordingly with corresponding API key and project information from Firebase (see website/example.env for additional reference, as well as website/__seed__/README.md for more information regarding seeding a cloud-based Firebase Firestore database).

Open http://localhost:3000 with your browser to see the result. The local data will be seeded from scratch. Furthermore, you can use the local auth service by simply logging in via any of the provided services (e.g., Google) with auto-generated credentials, which will simulate a logged in user account.

Yarn development scripts

  • yarn dev — Starts the application in development mode at http://localhost:3000.
  • yarn build — Creates an optimized production build of your application.
  • yarn start — Starts the application in production mode.
  • yarn lint — Runs ESLint for all files in the src directory.
  • yarn prettier — Runs Prettier for all files in the src directory.
  • yarn fmt - Run yarn prettier and yarn lint successively.
  • yarn precommit — Run commitizen on git-staged files.
  • yarn storybook - Run storybook locally at http://localhost:6006.
  • yarn fb:emu - Run the local Firebase Emulator Suite at http://localhost:4000.

Directory structure

  • .github — GitHub configuration including the CI workflow.
  • .husky — Husky configuration and hooks.
  • public — Static assets such as robots.txt, images, and favicon.
  • src — Application source code, including pages, components, styles.

Commit messages

Committing using Git CLI:

Using git commit will bring up a prompt that will fill out commit messages to the repo's commit connvention.

Committing using Git GUI:

Commit messages must conform to the Conventional Commits specification.

The commit message should be structured as follows:

<type>[optional scope]: <description>

[optional body]

[optional footer(s)]

<type> must be one of the following:

type description
build Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
chore Changes that do not affect production; e.x., updating grunt tasks, etc.
ci Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
docs Documentation only changes
feat A new feature
fix A bug fix
perf A code change that improves performance
refactor A code change that neither fixes a bug nor adds a feature
revert A commit that reverts a previous commit
style Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
test Adding missing tests or correcting existing tests

See the Conventional Commits specification for examples of valid commit messages.