Developer Onboarding
Get started with Dzaleka Online Services development
Prerequisites
Required Tools
- Node.js (v18 or later)
- Git
- VS Code (recommended) or your preferred IDE
- GitHub account
Development Environment
- Install Node.js from nodejs.org
- Install Git from git-scm.com
- Install VS Code from code.visualstudio.com
Project Setup
Clone and Install
# Clone the repository
git clone https://github.com/dzaleka-online/dzaleka-online-services.git
# Navigate to project directory
cd dzaleka-online-services
# Install dependencies
npm install
# Start development server
npm run dev
git clone https://github.com/dzaleka-online/dzaleka-online-services.git
# Navigate to project directory
cd dzaleka-online-services
# Install dependencies
npm install
# Start development server
npm run dev
Environment Configuration
Create a .env
file in the root directory with the following variables:
# Site Configuration
SITE_URL=http://localhost:4321
SITE_NAME="Dzaleka Online Services"
# Content Management
CONTENT_DIR=src/content
PUBLIC_DIR=public
# Media Configuration
MEDIA_DIR=public/images
ALLOWED_IMAGE_TYPES=jpg,jpeg,png,gif,webp
# API Configuration (if needed)
PUBLIC_API_URL=your_api_url
PUBLIC_API_KEY=your_api_key
# Authentication (if needed)
AUTH_SECRET=your_auth_secret
AUTH_TRUST_HOST=true
SITE_URL=http://localhost:4321
SITE_NAME="Dzaleka Online Services"
# Content Management
CONTENT_DIR=src/content
PUBLIC_DIR=public
# Media Configuration
MEDIA_DIR=public/images
ALLOWED_IMAGE_TYPES=jpg,jpeg,png,gif,webp
# API Configuration (if needed)
PUBLIC_API_URL=your_api_url
PUBLIC_API_KEY=your_api_key
# Authentication (if needed)
AUTH_SECRET=your_auth_secret
AUTH_TRUST_HOST=true
Project Structure
Key Directories
src/pages/
- Main application pages and routessrc/components/
- Reusable UI componentssrc/layouts/
- Page layouts and templatessrc/content/
- Content collections:news/
- News articles and announcementsservices/
- Organization and service listingsevents/
- Community events and activitiesresources/
- Educational and support resourcesdocs/
- Documentation and guidesstories/
- Community stories and experiencesphotos/
- Photo gallery and visual contentjobs/
- Job listings and opportunitiesprofiles/
- Community member profilescommunity-voices/
- Community perspectivestalents/
- Showcase of community talentsgallery/
- Visual content and media
src/utils/
- Utility functions and helperssrc/data/
- Data management and storagesrc/lib/
- Shared libraries and configurationssrc/scripts/
- Build and utility scriptssrc/services/
- Service integrations and APIssrc/stores/
- State management storessrc/types/
- TypeScript type definitionspublic/
- Static assets and images
Content Management
The project uses Astro's content collections for managing different types of content. Each collection has its own schema defined in src/content/config.ts
:
- News articles with categories like business-spotlight, announcement, success-story
- Services with detailed organization information, contact details, and business hours
- Events with registration and contact information
- Resources with download links and file information
- Photos with photographer credits and location data
- Jobs with detailed requirements and application information
- Community voices and stories
Important Files
astro.config.mjs
- Astro configurationtailwind.config.cjs
- Tailwind CSS configurationtsconfig.json
- TypeScript configurationpackage.json
- Project dependencies and scripts
Development Workflow
Git Workflow
- Create a new branch for your feature:
git checkout -b feature/your-feature-name
- Make your changes and commit them:
git add .
git commit -m "feat: your feature description" - Push your branch and create a pull request:
git push origin feature/your-feature-name
Commit Message Format
Follow the conventional commits format:
feat:
for new featuresfix:
for bug fixesdocs:
for documentation changesstyle:
for formatting changesrefactor:
for code refactoring
Testing
Running Tests
# Start development server
npm run dev
# Build for production
npm run build
# Preview production build
npm run preview
npm run dev
# Build for production
npm run build
# Preview production build
npm run preview
Writing Tests
- Create test files with
.test.ts
extension - Place tests in the same directory as the code being tested
- Use descriptive test names that explain the expected behavior
- Follow Astro's testing best practices
Deployment
Build Process
# Build for production
npm run build
# Preview production build
npm run preview
npm run build
# Preview production build
npm run preview
Deployment Steps
- Ensure all tests pass
- Build the project
- Deploy to staging environment
- Run final tests on staging
- Deploy to production
Code of Conduct
As a contributor to Dzaleka Online Services, you are expected to uphold our community values:
- Respect the cultural diversity and heritage of the Dzaleka community
- Maintain confidentiality of sensitive information and personal data
- Ensure content accuracy and cultural sensitivity in all contributions
- Support community empowerment through your work
- Follow ethical guidelines for content creation and sharing
- Respect intellectual property rights and proper attribution
- Maintain professional communication in all interactions
- Contribute to a safe and inclusive environment for all community members
By participating in this project, you agree to uphold these values and contribute positively to the Dzaleka community.