- Add comprehensive database migrations (001-024) for schema evolution - Enhance API schema with expanded type definitions and resolvers - Add new middleware: audit logging, rate limiting, MFA enforcement, security, tenant auth - Implement new services: AI optimization, billing, blockchain, compliance, marketplace - Add adapter layer for cloud integrations (Cloudflare, Kubernetes, Proxmox, storage) - Update Crossplane provider with enhanced VM management capabilities - Add comprehensive test suite for API endpoints and services - Update frontend components with improved GraphQL subscriptions and real-time updates - Enhance security configurations and headers (CSP, CORS, etc.) - Update documentation and configuration files - Add new CI/CD workflows and validation scripts - Implement design system improvements and UI enhancements
2.7 KiB
2.7 KiB
Development Guide
This guide will help you set up your development environment for Sankofa Phoenix.
Prerequisites
- Node.js 18+ and pnpm (or npm/yarn)
- PostgreSQL 14+ (for API)
- Go 1.21+ (for Crossplane provider)
- Docker (optional, for local services)
Initial Setup
1. Clone the Repository
git clone https://github.com/sankofa/Sankofa.git
cd Sankofa
2. Install Dependencies
# Main application
pnpm install
# Portal
cd portal
npm install
cd ..
# API
cd api
npm install
cd ..
# Crossplane Provider
cd crossplane-provider-proxmox
go mod download
cd ..
3. Set Up Environment Variables
Create .env.local files:
# Root .env.local
cp .env.example .env.local
# Portal .env.local
cd portal
cp .env.example .env.local
cd ..
# API .env.local
cd api
cp .env.example .env.local
cd ..
4. Set Up Database
# Create database
createdb sankofa
# Run migrations
cd api
npm run db:migrate
Running the Application
Development Mode
# Main app (port 3000)
pnpm dev
# Portal (port 3001)
cd portal
npm run dev
# API (port 4000)
cd api
npm run dev
Running Tests
# Main app tests
pnpm test
# Portal tests
cd portal
npm test
# Crossplane provider tests
cd crossplane-provider-proxmox
go test ./...
Project Structure
Sankofa/
├── src/ # Main Next.js app
├── portal/ # Portal application
├── api/ # GraphQL API server
├── crossplane-provider-proxmox/ # Crossplane provider
├── gitops/ # GitOps configurations
├── cloudflare/ # Cloudflare configs
└── docs/ # Documentation
Common Tasks
Adding a New Component
- Create component in
src/components/ - Add tests in
src/components/**/*.test.tsx - Export from appropriate index file
- Update Storybook (if applicable)
Adding a New API Endpoint
- Add GraphQL type definition in
api/src/schema/typeDefs.ts - Add resolver in
api/src/schema/resolvers.ts - Add service logic in
api/src/services/ - Add tests
Database Migrations
cd api
# Create migration
npm run db:migrate:create migration-name
# Run migrations
npm run db:migrate
Debugging
Frontend
- Use React DevTools
- Check browser console
- Use Next.js debug mode:
NODE_OPTIONS='--inspect' pnpm dev
Backend
- Use VS Code debugger
- Check API logs
- Use GraphQL Playground at
http://localhost:4000/graphql
Code Quality
Linting
pnpm lint
Type Checking
pnpm type-check
Formatting
pnpm format
Troubleshooting
See TROUBLESHOOTING.md for common issues and solutions.