infinum / JS-React-Example

Infinum's way of doing React

Home Page:https://react-example.byinfinum.co

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

React Example project

Technology

Next.js plugins

Project setup

# Install dependencies
npm ci

# Start the dev server
npm run dev

Use one of the user credentials to log in to the application

# user1
    email: 'user1@example.com'
    password: 'pasword12345'

# user2
    email: 'user2@example.com'
    password: 'pasword12345'

# user3
    email: 'user3@example.com'
    password: 'pasword12345'

API

Cekila = Cedevita + Tekila

Documentation

Project repository

Deployment

Git workflow

Secrets

Installation

You need to install secrets_cli gem. Explained here

gem install secrets_cli

Configuration

Create a new token on GitHub with read:org permissions.

Add 3 new environment variables to .zshrc file:

export VAULT_ADDR=https://vault.byinfinum.co:8200
export VAULT_AUTH_METHOD=github
export VAULT_AUTH_TOKEN={your_github_token}

Don't forget to restart your exec $SHELL

Check the secrets_cli prerequisites section for more details.

Pull the secrets

Pull the secrets for the specific environment. Explained here

secrets pull -e development

Vault dashboard

Example link to Vault dashboard:

You should log in with the GitHub method and use VAULT_AUTH_TOKEN for the token.

Styleguide

This project is using the styleguide as defined in the Infinum Handbook.

Project Structure

Starting a new project from this template

If you need to start a new project from this template, you have these options:

  1. Stripped down version of the App from project-starter-template branch
npx create-next-app@latest PROJECT_NAME -e https://github.com/infinum/JS-React-Example/tree/project-starter-template --use-npm
  1. Full-blown example App from the master branch
npx create-next-app@latest PROJECT_NAME -e https://github.com/infinum/JS-React-Example --use-npm

Note: replace PROJECT_NAME with the name of your project

Once you have created your new project, you can push it to an existing repository using the following commands:

git remote add origin git@github.com:infinum/REPOSITORY_NAME
git branch -M main
git push -u origin main

Note: Replace REPOSITORY_NAME with the name of your repository. These commands will add the remote repository, rename the branch to main, and push your changes to the remote repository.

Credits

JS-React-Example is maintained by Infinum.

About

Infinum's way of doing React

https://react-example.byinfinum.co


Languages

Language:TypeScript 94.4%Language:JavaScript 5.5%Language:Shell 0.1%