Skip to content

api-platform/website

Repository files navigation

api-platform.com

This repository contains the source code and documentation powering api-platform.com.

Single Page Application built with React and powered by Next.js.

Build Status

Project Structure

The project has been created from the API Platform distribution folder. All next.js application code is located in the "pwa" folder. The project is made with the Next.js new app router.

🤝 Contributors Features

You need to use a valid github token to retrieve the list of contributors.

  1. Go to your GitHub developer settings
  2. Select scopes public_repo, read:org and read:user, generate the token and copy it.
  3. If you use "pnpm dev" on the folder pwa to launch the project, add a new .env.local file on the root of pwa folder, and set your token as an environment variable named GITHUB_KEY.

If you use docker, create a file "secret_github_key" at the root of the project with your token inside:

# Create the secret_github_key file
echo "YOUR_GITHUB_TOKEN" > secret_github_key

❗Core team badges restriction: You need to be a member of API Platform organization to retrieve API Platform teams. You can still locally launch the project, but the badges of the core team members will not appear.

Installation and Usage

With Docker

# Checkout project
git clone https://github.com/api-platform/website.git

# Change directory
cd website

# Create the github_key file
echo YOUR_GITHUB_TOKEN > secret_github_key

# Install and run the project locally
docker compose up -d
> Go to http://localhost

Without Docker

# Checkout project
git clone https://github.com/api-platform/website.git

# Change directory
cd pwa

phive install --trust-gpg-keys 62D05354C61458CB8378FD323F82299C64F51AD2 --copy https://github.com/php-documentation-generator/php-documentation-generator/releases/download/v0.0.0-beta.1/pdg.phar
bash tools/get-docs.sh
bash tools/get-core-docs.sh
bash tools/build-playground.sh
curl https://soyuka.me/contributors.json  -o ./data/contributors.json (commented in the playground)

# Install dependencies
pnpm install

# Launch prebuild script (necessary to create some images variants like wallpapers or logos, and to generate the contributors ranking)
pnpm prebuild

# Run project locally (for development)
pnpm dev
> Go to http://localhost:3000/

Build the Project Locally

# Build the project (for production) from the pwa folder
pnpm build

# Test the built project locally
pnpm start
> Go to http://localhost:3000

Publishing Docs For New Versions

  1. Create a branch for the new version in the api-platform/docs repository.
  2. Update the DEFAULT_BRANCH environement variable for super-linter in the docs .github/workflows/ci.yml
  3. Update consts.ts
  4. Update Algolia crawler configuration