0.0.4-demo • Published 2 years ago
demo-al-core-pkg v0.0.4-demo
Introduction
- 100 Phlex Pro User Portal React
- version 1.0.0
Index
About
Next.js frontend for Phlex Pro User Portal Using MobX state management
Installation
- Commands to setup project
- Install node packages
$ npm install
Commands
- Commands to start the project.
- Start local server
$ npm run dev
- Build project
$ npm run build
- Serve project from build - make sure you run
npm run build
first
$ npm run start
Pre-Requisites
List all the pre-requisites the system needs to develop this project.
- Node v16
Development Environment
Write about setting up the working environment for your project.
- Clone the repository.
- Make sure you are using node v16+
- Install the node modules using
npm install
- Open the project using visual studio code and setup Sonarlint
Setting up SonarCloud lint configuration
- Install Sonarlint VS code extension
- Add the following entries into settings.json file
"sonarlint.pathToNodeExecutable": "<<PATH>>",
"sonarlint.connectedMode.connections.sonarcloud": [
{
"organizationKey": "<<ORG-KEY>>",
"token": "<<TOKEN>>"
},
],
"sonarlint.connectedMode.project": {
"projectKey": "<<PROJECT-KEY>>"
},
How to find Organisation key and project key
- Go to Sonar Cloud
- Sign in if required (use bitbucket authentication)
- Naviagte to on Profile > My Organisations > Atlas Labs
- Find project name and navigate into it
- Navigate to information on the left slide in navigation
- Copy Org and Project key on right side of the page.
How to generate token
- Go to Sonar Cloud
- Sign in if required (use bitbucket authentication)
- Navigate to on Profile > ORGANISATION_NAME
- Navigate to Security
- Generate Token
Checking Sonar Cloud Output
- Open VS code commands dropdown CMD + SHIFT + P
- Select SonarLint: Show SonarLint Output
File Structure
Add a file structure here with the basic details about files, below is an example.
No | File Name | Details |
---|---|---|
1 | pages/_app.tsx | Entry point |
2 | components/ | Component Souce Code |
3 | interfaces/ | Interfaces |
4 | interfaces/index.ts | Use to group exports |
5 | stores/ | State management Source Code |
6 | stores/GenericStore.ts | Generic Type Store to be extended for specific type stores |
7 | api/ | Network request Source Code |
8 | api/GenericRepository.ts | Generic type Repository to be extended for specific repositories |
Build
- Build project
$ npm run build
- Build project to run on Docker
$ docker build -t client . && docker run --name CLIENT_CONTAINER -p 0.0.0.0:3000:3000 client