This is a Next.js project bootstrapped with create-next-app. The platform provides a searchable database and information hub for political prisoners in Russia.
- Features
- Tech Stack
- Getting Started
- Project Structure
- Environment Variables
- Scripts
- Code Generation
- Testing & Linting
- Deployment
- Contributing
- License
- Search and filter political prisoners by region, age, gender, and interests
- Detailed prisoner profiles with articles, photos, and status
- Letter writing support for prisoners
- Responsive UI with custom theming
- Data fetching via GraphQL (Apollo Client)
- Storybook for UI component development
- Docker support for containerized deployment
- Next.js (App Router)
- React
- TypeScript
- Apollo Client
- MUI (Material UI)
- Storybook
- Docker
- Supabase (API backend)
- Moment.js (date formatting)
- Node.js (v18+ recommended)
- npm, yarn, or pnpm
-
Clone the repository:
git clone https://github.com/your-org/politzek-frontend.git cd politzek-frontend -
Install dependencies:
npm install # or yarn # or pnpm install
-
Set up environment variables:
- Copy
.env.exampleto.env.localand fill in the required values.
- Copy
-
Run the development server:
npm run dev # or yarn dev # or pnpm dev
-
Open http://localhost:3000 in your browser.
.
├── app/ # Next.js app directory (pages, layouts, components)
│ ├── components/ # Shared and feature components
│ ├── prisoner/ # Dynamic prisoner profile pages
│ ├── prisoners/ # Prisoners list and search
│ └── ... # Other routes and assets
├── apollo/ # Apollo GraphQL setup and generated types
├── gql/ # GraphQL queries and fragments
├── helpers/ # Utility functions (e.g., getRegions)
├── theming/ # Theme configuration for MUI
├── public/ # Static assets (images, icons)
├── .storybook/ # Storybook configuration
├── Dockerfile # Docker build instructions
├── docker-compose.yml # Docker Compose setup
├── codegen.ts # GraphQL codegen config
├── package.json
└── ...
Create a .env.local file based on .env.example. Required variables include:
NEXT_PUBLIC_API_URL– GraphQL API endpointSUPABASE_KEY– Supabase API key (server-only, not exposed to frontend)
dev– Start the development serverbuild– Build the application for productionstart– Start the production serverlint– Run ESLintstorybook– Run Storybook for UI developmentcodegen– Generate GraphQL types
GraphQL types and hooks are generated using GraphQL Code Generator:
npm run codegenConfiguration is in codegen.ts.
-
Linting:
Runnpm run lintto check code style and quality. Pre-commit hooks are set up via Husky. -
Formatting:
Uses Prettier (.prettierrc).
Deploy easily on Vercel.
Build and run with Docker:
docker build -t politzek-frontend .
docker run -p 3000:3000 --env-file .env.local politzek-frontendContributions are welcome! Please open issues or submit pull requests.
MIT © politzek.org contributors
This project sets up a GitHub Actions workflow that automates the deployment process whenever changes are merged into the development branch. The workflow is defined in the .github/workflows/deploy-on-merge.yml file.
The workflow is triggered on merges to the development branch. It performs the following steps:
- SSH into the Server: The workflow uses a secret variable to securely connect to the server.
- Pull Latest Changes: Once connected, it pulls the latest changes from the
developmentbranch to ensure the server is up to date. - Restart Docker Container: Finally, it restarts the Docker container to apply the latest changes.
To set up the workflow, you need to configure the following secrets in your GitHub repository:
SSH_PRIVATE_KEY: The private SSH key used for authenticating to your server.SERVER_USER: The username for SSH access to your server.SERVER_IP: The IP address or hostname of your server.
- Go to your GitHub repository.
- Click on
Settings. - In the left sidebar, click on
Secrets and variables, thenActions. - Click on
New repository secretto add each of the required secrets.
Once the secrets are configured, any merge into the development branch will trigger the deployment workflow automatically. You can monitor the progress of the workflow in the "Actions" tab of your GitHub repository.
This setup ensures that your application is always running the latest code with minimal manual intervention.