Skip to content

Latest commit

 

History

History
106 lines (71 loc) · 3.42 KB

README.md

File metadata and controls

106 lines (71 loc) · 3.42 KB

Casper Association Member Portal

The Casper Association's member portal.

This is the frontend repo of the portal. To see the frontend repo, visit https://github.com/ledgerleapllc/CasperAssociationPortalBackend

Prerequisites

  • NextJS/Vercel, and NodeJS version 14+ v16.6.2+
  • NPM 7.20.3+
  • Yarn 1.22.15+
  • Git Version 2+

You can find documentation on NextJS here https://github.com/vercel/next.js/

You can find documentation on NodeJS here https://github.com/nodejs/help

Setup

First we need a server to use. Apache/Nginx

sudo apt -y install apache2
sudo a2enmod rewrite
sudo a2enmod headers
sudo a2enmod ssl
sudo apt-get update

Setup the repo according to our VHOST path. Note, the actual VHOST path in this case should be set to /var/www/CasperAssociationPortalfrontend/out

cd /var/www/
git clone https://github.com/ledgerleapllc/CasperAssociationPortalfrontend
cd CasperAssociationPortalfrontend

You will need to add the following code to your server configuration under the VHOST path.

RewriteEngine On
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule . /index.html [L]

Install packages and setup environment. You will need to modify .env.production variables to fit the server on which you're deploying.

curl -sL https://deb.nodesource.com/setup_16.x | sudo bash -
sudo apt install nodejs -y
curl --compressed -o- -L https://yarnpkg.com/install.sh | bash
yarn install

Build command depends on environment. If you are running a custom environment, you'll need to modify env/.env.*

yarn build-dev
yarn build-staging
yarn build-prod

The above commands will build out/ on site using the variables from your .env.production file.

This is a Next.js project bootstrapped with create-next-app.

Getting Started

First, run the development server:

npm run dev
# or
yarn dev

Open http://localhost:3000 with your browser to see the result.

You can start editing the page by modifying pages/index.js. The page auto-updates as you edit the file.

API routes can be accessed on http://localhost:3000/api/hello. This endpoint can be edited in pages/api/hello.js.

The pages/api directory is mapped to /api/*. Files in this directory are treated as API routes instead of React pages.

Learn More

To learn more about Next.js, take a look at the following resources:

You can check out the Next.js GitHub repository - your feedback and contributions are welcome!

Deploy on Vercel

The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.

Check out our Next.js deployment documentation for more details.