NestJS API for protest coordination platform with organization verification and event management.
# Clone and install
git clone https://github.com/MoojaLabs/mooja-server.git
cd mooja-server
npm install
# Setup environment
cp .env.example .env
# Database setup
npx prisma generate
npx prisma migrate dev
npm run prisma:seed
# Start dev server
npm run start:devInside your .env file in the root folder (if u don't have it simply create one) add the following variables, check the .env.example for a guide on how to get each variable.
# Required
DATABASE_URL="postgresql://..."
DIRECT_URL="postgresql://..."
JWT_SECRET="your-secret-min-32-chars"
SUPABASE_URL="https://[project].supabase.co"
SUPABASE_SERVICE_ROLE_KEY="eyJhbGciOiJIUzI1NiIs..."
# Optional
PORT=3000
NODE_ENV=development
RATE_LIMIT_WINDOW_MS=900000
RATE_LIMIT_MAX_REQUESTS=100POST /api/auth/org/login- Organization loginPOST /api/auth/refresh- Refresh tokenGET /api/auth/org/profile- Get profile (auth required)
POST /api/orgs/verify-code- Verify invite codeGET /api/orgs- Get orgs by countryGET /api/orgs/applications/:id/status- Check status
GET /api/protests- Public feed (paginated)POST /api/protests- Create protest (auth required)DELETE /api/protests/:id- Delete protest (auth required)
POST /api/upload/image- Upload imageGET /api/health- Health checkGET /api/docs- API docs (dev only)
npx prisma studio # View data
npx prisma migrate dev # Create migration
npx prisma migrate reset # Reset DBnpm run start:dev # Development
npm run build # Production build
npm run test # Run tests
npm run prisma:seed # Seed database- NestJS + TypeScript
- PostgreSQL (Supabase)
- Prisma ORM
- JWT Auth
- Supabase Storage
- Railway deployment
- Keep your SUPABASE_SERVICE_ROLE_KEY secret - it has admin privileges
- Use a strong JWT_SECRET (minimum 32 characters)
- Never commit .env files to version control
This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0).