- Node.js 18+
- npm or yarn
- (Optional) Docker & Docker Compose
- (Optional) MongoDB
cd registry-api
npm installcp .env.example .env
# Edit .env if needed, defaults should work for developmentnpm run devServer starts on http://localhost:3000
curl http://localhost:3000/healthcurl -X POST http://localhost:3000/api/auth/signup \
-H "Content-Type: application/json" \
-d '{
"email": "test@example.com",
"username": "testuser",
"password": "password123"
}'curl -X POST http://localhost:3000/api/templates/search \
-H "Content-Type: application/json" \
-d '{"query": "counter"}'curl http://localhost:3000/api/templates/simple-counter/1.0.0curl http://localhost:3000/api/templates/simple-counter/ownership-historycurl -X POST http://localhost:3000/api/templates/simple-counter/transfer-ownership \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <token>" \
-d '{"new_username": "new_owner"}'docker-compose upThis starts:
- Registry API on port 3000
- MongoDB on port 27017
Access web UI: http://localhost:3000
View logs:
docker-compose logs -f registry-apiStop:
docker-compose downstarforge registry config --url http://localhost:3000starforge registry search counterstarforge registry loginstarforge registry publish ./my-template \
--name my-template \
--author "Your Name" \
--description "My awesome template" \
--tags "example,educational"starforge registry install my-templatestarforge registry review my-template --rating 5 --comment "Great!"starforge registry statusVisit http://localhost:3000
Features:
- Browse and search templates
- View ratings and reviews
- Login/Signup
- Template details
- One-click install commands
For MongoDB persistence:
docker run -d -p 27017:27017 mongo:6.0Update .env:
MONGODB_URI=mongodb://localhost:27017/starforge-registry
Restart API:
npm run devnpm run build
npm startWith Docker:
docker build -t starforge-registry:latest .
docker run -d -p 3000:3000 \
-e NODE_ENV=production \
-e JWT_SECRET=your-secret \
-e MONGODB_URI=your-db \
starforge-registry:latestDevelopment:
npm run dev # Start with auto-reload
npm run lint # Check code style
npm run build # Compile TypeScript
npm test # Run testsProduction:
npm run build # Compile TypeScript
npm start # Start server
npm run lint # Check code before deployPort 3000 in use:
- Change PORT in
.env - Or kill:
lsof -i :3000 | grep LISTEN | awk '{print $2}' | xargs kill
Module not found:
npm install
rm -rf node_modules && npm installTypeScript errors:
npm run build
# Fix errors before runningMongoDB errors:
- Verify MongoDB is running
- Check connection string in
.env
API errors:
- Check console output for detailed errors
- Verify JWT_SECRET is set
- Check request headers and body format
- Deploy to your server/cloud platform
- Configure DNS for registry domain
- Set up HTTPS/TLS certificate
- Update CLI default registry URL
- Promote to users for publishing templates
- Monitor usage and performance
- Plan Phase 2 features
- Full API docs: README.md
- Implementation guide: REMOTE_REGISTRY_IMPLEMENTATION.md
- CLI commands: DEVELOPER_GUIDE.md
- Architecture: ARCHITECTURE.md