Live on: https://restapi-wyej.onrender.com/
A comprehensive REST API platform built with modern full-stack architecture, featuring interactive documentation, API testing capabilities, and Postman collection export functionality.
This platform provides a complete API management solution with support for users, posts, and comments. It follows RESTful conventions and includes comprehensive documentation, interactive testing, and export capabilities for popular API testing tools.
- RESTful API Design - Clean, intuitive endpoints following industry standards
- Interactive Documentation - Built-in API explorer with real-time testing
- Postman Integration - One-click export of complete API collections
- Real-time Validation - Input validation with detailed error handling
- Responsive Design - Works seamlessly across all devices
- Users - Complete user management with profiles and authentication data
- Posts - Blog-style content management with authorship tracking
- Comments - Nested discussion system with post associations
- Query Filtering - Advanced filtering options for all resources
- TypeScript Support - Full type safety across frontend and backend
- Hot Reload - Fast development with instant updates
- Error Handling - Comprehensive error responses with debugging info
- API Testing - Built-in testing interface for all endpoints
- Node.js 18+
- PostgreSQL (for production) or use included in-memory storage
-
Clone and Install
git clone <repository-url> cd rest-api-platform npm install
-
Environment Setup
# For PostgreSQL (optional) export DATABASE_URL="postgresql://username:password@localhost:5432/dbname"
-
Start Development Server
npm run dev
-
Access the Platform
- Open http://localhost:5000
- Interactive API documentation loads automatically
http://localhost:5000/api/v1
Currently uses session-based authentication. API keys and OAuth support planned for future releases.
GET /users- List all users with paginationGET /users/:id- Get specific user detailsPOST /users- Create new userPUT /users/:id- Update user informationDELETE /users/:id- Remove user
GET /posts- List all posts with filtering optionsGET /posts/:id- Get specific post detailsPOST /posts- Create new postPUT /posts/:id- Update post contentDELETE /posts/:id- Remove postGET /posts?authorId=:userId- Filter posts by author
GET /comments- List all comments with paginationGET /comments/:id- Get specific comment detailsPOST /comments- Create new commentPUT /comments/:id- Update comment contentDELETE /comments/:id- Remove commentGET /comments?postId=:postId- Filter comments by post
All list endpoints support:
page- Page number (default: 1)limit- Items per page (default: 10)sort- Sort field and direction (e.g.,createdAt:desc)
├── client/ # React frontend application
│ ├── src/
│ │ ├── components/ # Reusable UI components
│ │ ├── pages/ # Page components
│ │ ├── lib/ # Utilities and configurations
│ │ └── hooks/ # Custom React hooks
├── server/ # Express.js backend API
│ ├── index.ts # Server entry point
│ ├── routes.ts # API route definitions
│ ├── storage.ts # Data storage interface
│ └── vite.ts # Development server setup
├── shared/ # Shared types and schemas
│ └── schema.ts # Database schema and validations
└── migrations/ # Database migration files
- React 18 - Modern UI library with hooks
- TypeScript - Type-safe development
- Tailwind CSS - Utility-first styling framework
- shadcn/ui - High-quality component library
- TanStack Query - Server state management
- Wouter - Lightweight client-side routing
- Node.js - JavaScript runtime
- Express.js - Web application framework
- TypeScript - Type-safe server development
- Drizzle ORM - Type-safe database operations
- Zod - Runtime type validation
- PostgreSQL - Production database (optional)
- Vite - Fast build tool and dev server
- esbuild - JavaScript bundler for production
- tsx - TypeScript execution for development
- Navigate to the main documentation page
- Select an endpoint from the sidebar
- Choose HTTP method and configure parameters
- Click "Test API" to execute requests
- View real-time responses and status codes
- Click "Export Postman" button in the header
- Import the downloaded collection into Postman
- Set base URL variable to your server address
- Start testing all endpoints immediately
Create a User:
POST /api/v1/users
{
"name": "John Doe",
"email": "john@example.com",
"password": "securepassword"
}Create a Post:
POST /api/v1/posts
{
"title": "Sample Post",
"content": "This is sample content.",
"authorId": 1,
"published": true
}Filter Posts by Author:
GET /api/v1/posts?authorId=1&published=true
No setup required. Data resets on server restart.
- Install PostgreSQL
- Create database
- Set
DATABASE_URLenvironment variable - Run migrations:
npm run db:push
# Push schema changes to database
npm run db:push
# Generate migration files
npm run db:generate
# Apply migrations
npm run db:migratenpm run dev- Backend runs on port 5000
- Frontend served via Vite middleware
- Hot reload enabled for both frontend and backend
npm run build- Frontend builds to
dist/public - Backend builds to
dist/index.js - Ready for deployment
# Type checking
npm run type-check
# Linting (if configured)
npm run lintThe API provides consistent error responses:
{
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid input data",
"details": {
"field": "email",
"issue": "Invalid email format"
},
"resource": "users",
"request_id": "req_123456789"
},
"timestamp": "2025-06-28T16:30:00.000Z"
}Common error codes:
VALIDATION_ERROR- Input validation failedRESOURCE_NOT_FOUND- Requested resource doesn't existDUPLICATE_RESOURCE- Resource already existsINTERNAL_ERROR- Server error occurred
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
- Use TypeScript for type safety
- Follow existing naming conventions
- Add JSDoc comments for public APIs
- Ensure responsive design for UI changes
- Test all API endpoints using the built-in tester
- Verify Postman collection exports work correctly
- Check responsive design on multiple screen sizes
- Connect repository to Replit
- Set environment variables if using PostgreSQL
- Click Deploy button
- Application automatically scales and manages hosting
- Build the application:
npm run build - Set production environment variables
- Start with:
node dist/index.js - Ensure PostgreSQL connection for production data
This project is licensed under the MIT License - see the LICENSE file for details.
For questions, issues, or feature requests:
- Check the interactive documentation at the root URL
- Use the built-in API tester for debugging
- Export Postman collections for external testing
- Review error responses for debugging information
Built with ❤️ using modern web technologies