Skip to content

Plateforme citoyenne pour la démocratie, la transparence et l'accès à l'information publique au Sénégal

License

Notifications You must be signed in to change notification settings

Code-for-Senegal/vie-publique.sn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

375 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Vie Publique Sénégal

Overview

Vie Publique Sénégal is a platform dedicated to providing transparent access to public information in Senegal. This project aims to make government data and public information easily accessible to citizens.

Features

  • News Section: Access to the latest news and updates
  • Official Documents: Browse through official documents, laws, and decrees
  • National Assembly: Information about the National Assembly
  • Council of Ministers: Access to council of ministers' communiqués
  • Budget: Information about Senegal's budget
  • Directory: Access to various public institutions and resources
  • Elections: Information about elections

Social Networks

Follow us on our social networks to stay updated:

Technical Stack

  • Frontend: Nuxt 4
  • UI Framework: Nuxt UI
  • State Management: Pinia
  • Styling: Tailwind CSS
  • API: Directus

Getting Started

Prerequisites

  • Node.js (v18 or higher)
  • npm or yarn
  • Docker (for local development)

Installation

  1. Clone the repository:
git clone https://github.com/your-username/vie-publique-senegal.git
cd vie-publique-senegal
  1. Install dependencies:
npm install
# or
yarn install
  1. Create a .env file based on .env.example and fill in the required environment variables.

  2. Start the development server:

For Linux/macOS:

npm run dev
# or
yarn dev

For Windows PowerShell:

npm run dev-win
# or
yarn dev-win

Development

Available Scripts

  • npm run dev - Start development server (Linux/macOS)
  • npm run dev-win - Start development server (Windows PowerShell)
  • npm run build - Build for production
  • npm run generate - Generate static project
  • npm run preview - Preview production build
  • npm run lint - Run ESLint
  • npm run lint:fix - Fix ESLint issues
  • npm run format - Format code with Prettier
  • npm run test - Run tests with Vitest
  • npm run test:ui - Run tests with UI
  • npm run test:coverage - Generate test coverage report

Cross-Platform Development

The project includes separate scripts for different operating systems to handle PDF worker file copying:

  • Linux/macOS: Uses Unix commands (mkdir -p, cp)
  • Windows: Uses PowerShell commands (if not exist, mkdir, copy)

Code Style & Formatting

This project uses a strict code style to ensure consistency across the team.

VSCode Setup (Recommended)

When you open the project in VSCode, you'll be prompted to install recommended extensions. Click "Install All" or install them manually:

  • ESLint - JavaScript/TypeScript linting
  • Prettier - Code formatting
  • Volar - Vue 3 support
  • Tailwind CSS IntelliSense - Tailwind autocompletion
  • EditorConfig - Universal editor configuration

Auto-formatting

Once extensions are installed, your code will be automatically formatted on save (Ctrl+S / Cmd+S).

Code Conventions

  • Quotes: Single quotes ' (not double quotes ")
  • Semicolons: None (disabled)
  • Indentation: 2 spaces
  • Trailing commas: Always
  • Line endings: Auto (LF on Unix, CRLF on Windows)

Before Committing

Always run before creating a commit to ensure code quality:

npm run format && npm run lint:fix

Configuration Files

  • .prettierrc - Prettier formatting rules
  • .editorconfig - Universal editor settings
  • .vscode/settings.json - VSCode-specific settings
  • eslint.config.mjs - ESLint rules

For more details on VSCode setup, see .vscode/README.md

Testing

This project uses Vitest for unit testing with Vue Test Utils.

Running Tests

# Run tests in watch mode
npm run test

# Run tests with UI
npm run test:ui

# Run tests with coverage
npm run test:coverage

Writing Tests

Tests are organized following Nuxt.js testing best practices in a centralized test/ directory:

test/
├── unit/              # Unit tests for composables, utils, stores
│   └── composables/
│       └── usePromesseStatus.test.ts
├── e2e/               # End-to-end tests (future)
└── nuxt/              # Nuxt runtime tests (future)

Example test:

// test/unit/composables/usePromesseStatus.test.ts
import { describe, it, expect } from 'vitest';
import { getStatusIcon } from '~/composables/usePromesseStatus';

describe('usePromesseStatus', () => {
  it('should return correct icon', () => {
    expect(getStatusIcon('tenue')).toBe('i-heroicons-check-circle');
  });
});

Coverage Reports

Coverage reports are generated in the coverage/ directory and are excluded from version control. The project is configured to send coverage data to SonarCloud for continuous code quality analysis.

Code Quality

Quality Gate Status

This project uses SonarCloud for continuous code quality and security analysis. Code quality metrics are automatically analyzed on every push and pull request.

Contributing

We welcome contributions! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Plateforme citoyenne pour la démocratie, la transparence et l'accès à l'information publique au Sénégal

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 8