Skip to content

Quick Start for Developers

This guide will help you set up your development environment and start working on the FiNAN website within minutes.

Before you begin, ensure you have the following installed on your machine:

  1. Node.js - Version 18.x or higher

    • Download from nodejs.org
    • Verify installation: node --version
  2. npm - Comes with Node.js

    • Package manager for JavaScript
    • Verify installation: npm --version
  3. Git - Version control system

    • Download from git-scm.com
    • Verify installation: git --version
  1. Clone the Repository

    Terminal window
    # Clone the repository
    git clone https://github.com/poncardasm/finan-website.git
    # Navigate to the project directory
    cd finan-website
  2. Install Dependencies

    The project uses npm for package management. Install all dependencies:

    Terminal window
    npm install

    This will install:

    • Astro 5.15.9
    • Tailwind CSS 4.1.13
    • TypeScript 5.9.2
    • Ghost CMS client
    • PhotoSwipe
    • All development tools (ESLint, Prettier, etc.)
  3. Environment Variables (Optional)

    If you need to work with the Ghost CMS integration, create a .env file in the root directory:

    .env
    GHOST_URL=https://puls.finan.eu.com
    GHOST_CONTENT_API_KEY=your_api_key_here

    Note: The Ghost CMS integration will gracefully degrade if environment variables are not set, so this is optional for most development work.

  4. Start the Development Server

    Terminal window
    npm run dev

    This will start the Astro development server at http://localhost:4321. The server supports:

    • Hot module replacement (HMR) - Changes appear instantly
    • Fast refresh - Component updates without full page reload
    • TypeScript type checking
    • Astro island hydration

    Open your browser and navigate to http://localhost:4321 to see the site.

CommandDescription
npm run devStart development server at localhost:4321
npm run buildBuild production site to ./dist/
npm run previewPreview built site locally
npm run lintRun ESLint on codebase
npm run lint:fixRun ESLint with auto-fix
npm run formatFormat code with Prettier
npm run format:checkCheck code formatting
npm run astroRun Astro CLI commands
  1. Start the dev server:

    Terminal window
    npm run dev
  2. Make your changes to components, pages, or data files

  3. Check the browser - Changes should appear automatically

  4. Before committing, run code quality checks:

    Terminal window
    npm run lint:fix && npm run format
  5. Test the production build:

    Terminal window
    npm run build
    npm run preview
  6. Commit your changes with clear, descriptive commit messages

Here’s what you’ll be working with most often:

finan-website/
├── src/
│ ├── components/ # 25 reusable Astro components
│ │ ├── Navbar.astro
│ │ ├── Footer.astro
│ │ ├── Committee.astro
│ │ └── ...
│ ├── pages/ # File-based routing
│ │ ├── index.astro # Home page
│ │ ├── about.astro
│ │ ├── representation/
│ │ │ ├── finland.astro
│ │ │ ├── sweden.astro
│ │ │ └── ...
│ │ └── ...
│ ├── data/ # Type-safe data configurations
│ │ ├── siteConfig.ts
│ │ ├── representation/
│ │ │ ├── committee/
│ │ │ ├── partnership/
│ │ │ └── publication/
│ │ └── pages/
│ ├── assets/ # Optimized images
│ │ └── images/
│ │ ├── committee/
│ │ ├── events/
│ │ └── gallery/
│ ├── layouts/ # Page layout templates
│ ├── scripts/ # Client-side JavaScript
│ └── styles/ # Global CSS
├── public/ # Static assets (served as-is)
│ ├── flags/
│ ├── icons/
│ └── images/
├── astro.config.mjs # Astro configuration
├── tailwind.config.js # Tailwind CSS configuration
├── tsconfig.json # TypeScript configuration
└── package.json # Dependencies and scripts

For a detailed breakdown, see Project Structure.

Let’s make a simple change to verify everything is working:

  1. Open src/pages/index.astro
  2. Find the hero section text
  3. Make a small change to any heading or paragraph
  4. Save the file
  5. Check your browser - the change should appear instantly
  1. Open src/components/Footer.astro
  2. Update the footer text or add a link
  3. Save the file
  4. Check your browser - all pages with the footer will update
  1. Open src/data/pages/faq/faqData.ts
  2. Add a new FAQ object to the appropriate category array:
    {
    question: 'Your new question?',
    answer: 'Your answer here.',
    }
  3. Save the file
  4. Navigate to /faq in your browser to see the new item

Astro uses “islands architecture” where:

  • Most of the site is static HTML (fast and SEO-friendly)
  • Interactive components are “hydrated” only when needed
  • JavaScript is minimal by default

All data configurations use TypeScript:

  • Interfaces ensure data structure consistency
  • Auto-completion in your IDE
  • Compile-time error checking
  • as const satisfies pattern for type safety

Example:

import type { CommitteeMember } from './types';
export const finlandCommittee = [
{
name: 'John Doe',
role: 'Country Representative',
email: 'john@example.com',
image: johnDoeImage,
},
] as const satisfies readonly CommitteeMember[];

The site is built from reusable components:

  • Each component handles a specific UI concern
  • Props are TypeScript-typed
  • Components are composable and reusable
  • Styling uses Tailwind CSS utilities

The project enforces code quality through:

  • Checks for code issues and potential bugs
  • Enforces consistent code patterns
  • Astro-specific linting rules
  • Run with: npm run lint
  • Formats code consistently
  • Sorts Tailwind CSS classes automatically
  • Astro-specific formatting
  • Run with: npm run format
  • Type checking at build time
  • Interfaces for all data structures
  • Strict type safety enabled

Always run this before committing:

Terminal window
npm run lint:fix && npm run format

This ensures:

  • ESLint rules are enforced and auto-fixed
  • Code formatting is consistent
  • Tailwind classes are sorted
  • No linting errors in commits

Astro component files with three sections:

  • --- frontmatter (TypeScript)
  • HTML-like template
  • Optional <script> and <style> tags

TypeScript configuration and data files:

  • Type definitions in types.ts files
  • Data configurations with as const satisfies
  • Utilities and helper functions

Styling with Tailwind:

  • Global styles in src/styles/
  • Utility-first approach
  • Custom CSS when needed

Now that you have your environment set up:

  1. Explore the codebase - Browse through components and pages
  2. Read the architecture guide - Architecture Overview
  3. Learn about components - Component Architecture
  4. Understand data patterns - Data Configuration
  5. Review code quality - Development Workflow

If port 4321 is already in use:

Terminal window
# Kill the process using port 4321 (macOS/Linux)
lsof -ti:4321 | xargs kill -9
# Or use a different port
npm run dev -- --port 3000

If you see TypeScript errors:

Terminal window
# Clear cache and reinstall
rm -rf node_modules package-lock.json
npm install

Check for:

  • TypeScript type errors
  • Missing imports
  • Incorrect file paths
  • Image import issues

See Troubleshooting for more help.

If you encounter issues:

  1. Check this documentation - Use the search feature
  2. Review error messages - They often point to the solution
  3. Check the troubleshooting guide - Common Issues
  4. Ask the team - Reach out via GitHub issues

Happy coding!