Learn how to run this project locally and avoid pitfalls with development
Let's set up the documentation project in a local development environment and learn how to get it up and running.
Since this is private project on GitHub, it is currently only available for Safepay team members. Contact your team admin to grant you access.
1
Open up the project on GitHub, click on the green Code button. From the dropdown, select the SSH tab and copy the URL. Navigate to terminal and change directories to where you keep all relevant Safepay projects. Then, clone the project.
# Clone the safepay-docs repo
-
git clone git@github.com:getsafepay/safepay-docs.git
# Navigate to the project directory
-
cd safepay-docs
2
Once the project has been cloned and you're inside the directory, the next step is to install all the dependencies. Since this project was bootstrapped with npm
we recommend you use npm
as well instead of yarn
to avoid conflicting lock
files.
# Install the dependencies
-
npm i
3
This project uses Next JS as a framework which offers server side rendering of React Components. Read the Next JS docs to learn more.
To run this project, it first has to be built. After its built successfully, you can run the project and view it on your browser. By default, the project will run on port 3000. To change this, edit the npm start
command and pass in a port of your choosing with the --p
flag.
# Assuming you are in the project directory
# Build the project
-
npm run build
# Start the project
-
npm start
Assuming the project was built without any errors and you were able to successfully start it, navigate to your localhost:3000 (or whatever port you decided to run this on). Once loaded, you should see the project Home page.