Giter Site home page Giter Site logo

racerunner-web's Introduction

Race Runner Web

This is project is a online platform for co-ordinating a Race Runner event.

// TODO: add more information about Race Runner

This repository is currently maintained by Ben Yap ([email protected]).

Project set up

The root package.json file contains packages that are required by all project components. These should be installed using the command yarn in the root directory. The following project components also contain scoped package.json files, which need to be installed within their respective directories using the command yarn.

app/
functions/

Alternatively, use the command yarn install-all to install all required packages automatically.

Project structure

app         // this directory contains the source code for the frontend site
config      // this directory contains configuration and security rules for the Firebase project
functions   // this directory contains the source code for Firebase functions
test        // this directory contains tests for the security rules for Realtime database and Firestore

Project structure

.
├── app/                        # source code for the frontend site
│   ├── bin/                    # scripts for local frontend development
│   ├── public/                 # public assets
│   ├── src/                    # frontend source
│   │   ├── assets/...          # assets (must be imported in source code)
│   │   ├── modules/...         # the site is split into 'modules' (see the modules section in the Wiki for more information)
│   │   │   ├── base/...
│   │   │   ├── core/...
│   │   │   └   ...
│   │   ├── styles/...          # global styles
│   │   ├── utils/...           # shared utilities used by the frontend
│   │   └   ...
│   └   ...
├── config/                     # configuration and security rules for the Firebase project
├── functions/                  # source code for Firebase functions
├── internals/                  # scripts and configuration
├── test/                       # tests for the security rules for Firestore
├── package.json                # project level scripts and packages
├── .firebaserc                 # configure the Firebase project that this project deploys to
└── ...                         # other configuration files

Local development

To run this application locally, you must install the Firebase CLI and be logged in with an account that has access to the project.

To install Firebase CLI:

npm install -g firebase-tools

To log in with your account:

firebase login

Frontend app

Navigate to the app directory.

cd app

To build the frontend app:

yarn build

To start the development server for the frontend app:

yarn start

Firebase functions

Navigate to the functions directory.

cd functions

To build the functions:

yarn build

To run the functions locally via shell, use this command:

yarn start

File generation

The frontend site (app) has file generation to help automate the creation of standardised components for this project. For more information about the standards and conventions used, see the GitLab wiki (WIP). To use a generator, use this command:

yarn generate <generator>

The following generators are available:

component

Create a React component in app/src/modules/{module}/components.

context

Create a React context in app/src/modules/{module}/contexts.

page

Create a page in app/src/modules/{module}/pages.

Testing

There are tests for the security rules for Firestore. These are located in the test directory.

To run these tests, first make sure you have the appropriate emulators installed. Use these commands to install them:

// Install Firestore emulator
firebase setup:emulators:firestore

To run the tests, first start the appropriate emulator (and leave them running throughout while you run the tests):

// Start the Firestore emulator
yarn emulate:firestore

Then run the tests using these commands:

// Run all tests
yarn test

// Run Firestore tests
yarn test:firestore

Deployment

IMPORTANT: See CONTRIBUTING.md for the git branching work flow and merge request conventions used in this project.

Deployment to the staging environment can be triggered by running the release process. Deployment to the production environment can be manually triggered after a successful deployment to staging. See RELEASE.md for more information.

Logging during development

To make full use of the LoggerUtil class found in app/src/app/core/utils/logger.ts when using Google Chrome's dev tools, you should enable "blackboxing" so that logs to the console reference you to the source file where the call to LoggerUtil originated from, rather of showing the line inside logger.ts that makes the call to console.log.

To enable this feature, go to dev tool's Settings > Blackboxing and add the following pattern with "blackbox" behaviour:

logger\.ts$

For more information on blackboxing in Google Chrome, go to the documentation.

License

MIT License

racerunner-web's People

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.