Git Product home page Git Product logo

caprover-frontend's Introduction

Frontend App for CapRover

This project was bootstrapped with Create React App.

Development

Run CapRover backend service in debug mode. Change .env.development to match your backend. Then run yarn start

Note: To create a simple backend API in debug mode, you can use Play with Docker. Just simply run the following commands and you'll be set:

apk update && apk add nodejs npm python3
git clone https://github.com/caprover/caprover.git
cd caprover
npm i
npm run clean
echo "done"

Then click on Open Port button and get the URL for port 3000, it should be something like this (make sure to remove trailing slash): http://ip172-18-0-76-abcdef123456-3000.direct.labs.play-with-docker.com

We strive to keep CapRover code base consistent. This will ensure a high level of consistency and lower maintenance load.

Available Scripts

In the project directory, you can run:

yarn start

Runs the app in the development mode.

Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits.

You will also see any lint errors in the console.

yarn run build

Builds the app for production to the build folder.

It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.

Your app is ready to be deployed!

Theming

CapRover's fronted supports dark and light modes. It is based on antd colour schemes. Therefore, all used antd components within the project support both modes by default. However if we implement a custom component or want to change some global colors some steps needs to be considered.

Implement Dark Mode in custom component

To ensure your elements work with both dark and light modes, following points needs to be considered:

  • Don't use JSX inline styles for colors, use classNames instead and create rules within the styles/style.less or the according theme
  • Use antd variables as @layout-body-background, @body-background, @skeleton-color for the colors.
    • Use @layout-body-background for page backgrounds [#f0f2f5, #000]
    • Use @background-color-light for log views or input areas [#fafafa, rgba(255, 255, 255, 0.04)]
    • Use @body-background for elements within a card [#fff, #000]
    • Use @skeleton-color for all border colors. [#f2f2f2, #303030]
  • Use the class .inner-card for nested cards, like the network stats.
  • If you need additional colors, that are present within an antd component, grab the according variable located in ~antd/lib/style/themes/default.less

Dev Mode & Hot Reload

It can happen that modifying the app.less during yarn run dev leads to FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory less. To overcome this, we need to set max-old-space-size.

export NODE_OPTIONS="--max-old-space-size=8192"

Global Variables

To add global less variables place them in styles/vars.less.

Override Antd specific Variables

To override antd specific colors modify the according constant in config-overrides.js -> [lightVars, darkVars].

Contribution

Thanks for contributing to the frontend code! Since contributors list for CapRover automatically picks up the contributors from the main backend repo, please make a minor update the frontend commit in the dockerfile, so your name will get displayed on the main page as a contributor.

https://github.com/caprover/caprover/blob/master/dockerfile-captain.release#L18

Learn More

For more details and documentation, please visit https://CapRover.com

Tests

e2e

e2e testing are nocking the network callback. However, you need to run the project before running the e2e testing to allow the headless browser to navigate through your pages. To run end to end testing you just have to run yarn start then yarn test:e2e or yarn test:e2e--open if you want to display the result.

Backers

Thank you to all our backers! ๐Ÿ™

Contributors

Donate

caprover-frontend's People

Contributors

githubsaturn avatar ngoyal16 avatar vitalragaz avatar mexaar avatar sidharthv96 avatar etienne-dldc avatar drmrbrewer avatar juanfrnz avatar liquiditguy avatar thgh avatar solomon23 avatar edwardch avatar gnuns avatar izzlenizzle avatar devnixs avatar visualfanatic avatar emrysmyrddin avatar sztheory avatar jonaskuske avatar mathiasm74 avatar matt-oakes avatar pedro-santiago avatar iamrommel avatar thibstars avatar tbroadley avatar bratishques avatar parcelcat avatar c43721 avatar ilijanl avatar polotto 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.