Skip to content

project-cssi/cssi-fe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

logo-text

Front-End for the CSSI Platform

Build Status Contributors Count License: MIT Github stars Github forks Twitter

This repository contains the codebase for the CSSI front end. This project was bootstrapped with Create React App template.

Quick start

The generated project have dependencies that require node together with npm.

Make sure you have Node version >= 8.0 and (NPM >= 5 or Yarn )

# clone our repository
git clone https://github.com/project-cssi/cssi-fe.git

# change the directory
cd cssi-fe

# switch to development branch
git checkout develop

# install the dependencies with npm
npm install

# start the development server
npm start

Once the dev server is fired up, it'll automatically open up a new tab. If not, navigate to http://0.0.0.0:3000 or http://localhost:3000 manually in your browser. (Note: If a port is already taken you'll be given the option to open the app in a different port.)

Table of Contents

File Structure

cssi-fe/
 β”œβ”€β”€ docs/                          * folder to house all the documents
 β”œβ”€β”€ node_modules/                  * contains dependencies pulled from npm
 β”œβ”€β”€ public/                        * the public folder which can be accessed with a URL
 β”‚   β”œβ”€β”€ favicon/                   * contains all the favicons and device specific icons for the app
 β”‚   β”œβ”€β”€ index.html                 * this is the app template
 β”‚   └── manifest.json              * contains metadata for the app
 β”œβ”€β”€ src/                           * source folder
 β”‚   β”œβ”€β”€ aseets/                    * folder containing all the static assets, meta and styles
 β”‚   β”œβ”€β”€ components/                * contains all the reusable components
 β”‚   β”œβ”€β”€ containers/                * contains the differenrt container types used in the app
 β”‚   β”œβ”€β”€ elements/                  * houses the custom elemets such as buttons, inputs etc.
 β”‚   β”œβ”€β”€ forms/                     * contains all the forms used in the application
 β”‚   β”œβ”€β”€ redux/                     * redux folder
 β”‚   β”‚   β”œβ”€β”€ actions/               * contains all the redux action scripts
 β”‚   β”‚   β”œβ”€β”€ reduces/               * contains all the reducers
 β”‚   β”‚   β”œβ”€β”€ store.js               * redux store file
 β”‚   β”‚   └── types.js               * file containing all the redux action types
 β”‚   β”œβ”€β”€ routes/                    * contains the routes of the app
 β”‚   β”œβ”€β”€ services/                  * contains the service scripts for the app
 β”‚   β”œβ”€β”€ utils/                     * folder to hold the utility function scripts
 β”‚   β”œβ”€β”€ variables/                 * folder to house app variable scripts
 β”‚   β”œβ”€β”€ views/                     * folder containing all the views of the application
 β”‚   β”œβ”€β”€ api.js                     * contains all the api endpoints for the application
 β”‚   β”œβ”€β”€ index.js                   * js entry-point for the application
 β”‚   └── registerServiceWorker.js   * file which helps to serve assets from cache in production
 β”œβ”€β”€ .env.sample                    * sample of .env file
 β”œβ”€β”€ .eslintrc.js                   * ecmascript linting configuration file
 β”œβ”€β”€ .gitignore                     * contains files that are ignored from git
 β”œβ”€β”€ .gitlab-ci.yml                 * gitlab ci configuration file
 β”œβ”€β”€ .npmrc                         * npm config file to house project wide custom configs
 β”œβ”€β”€ .nvmrc                         * node version manager config file
 β”œβ”€β”€ .sass-lint.yml                 * sass lint config file
 β”œβ”€β”€ CHANGELOG.md                   * log of all notable changes made to the project
 β”œβ”€β”€ CONTRUBUTING.md                * project contributing guidelines
 β”œβ”€β”€ LICENSE.md                     * licensing information
 β”œβ”€β”€ package.json                   * contains all the npm scripts for building, running, deploying etc. and contains all the dependencies
 └── README.md                      * Readme file for the repository

Getting Started

Prerequisites

What you need to run this app:

  • The generated project have dependencies that require node together with npm.
  • Ensure you're running the latest stable versions Node and NPM.

Make sure you have Node and NPM installed by running simple commands on the command line to see what version of each is installed.

  • Node - Type node -v on the terminal.
  • NPM - Type npm -v on the terminal.

If you do not have them installed, click here and grab the latest stable version of node and npm will be automatically installed along with it. Or if you have brew already installed in your local machine, execute brew install node command to get node.

Setting Up

  • git clone https://github.com/project-cssi/cssi-fe.git to clone the repository
  • cd cssi-fe to change the directory
  • git checkout develop to switch to development branch
  • npm install to install the dependencies with npm

Running the app

After you have installed all dependencies you can now run the app. Run npm start to start a local server with webpack. The dev server will be opened in a new tab and usually on http://localhost:3000 and the Access URLs will be displayed on the terminal.

Configuration

Have a look in the .env.sample file for the structure of the .env file.

Styling

The stylesheets are inside the assets/sass folder and the cssi-dashboard.scss file inside the directory is the main stylesheet for the project. If you want to add your own stylesheet, we recommend that you place it under the sass/partials folder and import it in the cssi-dashboard.scss file.

For example if you want to include the styles for a slider:

  1. Create a _slider.scss partial file in the sass/partials directory.
  2. In cssi-dashboard.scss add @import 'partials/slider.scss';

Testing

The app uses Jest and Enzyme frameworks for testing and you can run the test suite by executing the following command.

npm run test

Production

Follow the steps bellow to build a production ready version of the application.

Building the app

Execute the following command to build the application with webpack in production mode.

npm run build

Releases

Please read the RELEASES.md guideline to learn about the process for releasing the project.

Deployment

AWS

If you want to deploy the application to a s3 bucket please execute the following command replacing bucket_name with the intended s3 bucket name.

The script for this command can be found in the scripts/deploy-s3.js. Feel free to change it if needed.

npm run deploy-s3 bucket_name

Linting

To run the linting on the command line, execute the following command.

npm run lint

Built With

reactΒ Β  reduxΒ Β  lodashΒ Β  webpackΒ Β  npmΒ Β  sassΒ Β  bootstrapΒ Β  jqueryΒ Β 

Changelog

Please refer CHANGELOG.md to learn about the latest improvements, breaking changes and bug fixes.

Contributing

Please read CONTRIBUTING.md for contributing guidelines and to learn about our code of conduct.

Contributors

License

FOSSA Status

About

🌈 Front-End for the CSSI Platform

Resources

License

Stars

Watchers

Forks

Packages

No packages published