A RESTful API service built with Node.js, Express, and MongoDB for managing tasks. This service is containerized using Podman/Docker.
- RESTful API endpoints for CRUD operations
- Swagger/OpenAPI documentation
- Containerized deployment (Podman/Docker)
- Logging system (Winston)
- Environment-based configuration
- MongoDB database integration
- Node.js (v14 or higher)
- Podman/Docker
- Podman Compose/Docker Compose
- MongoDB (containerized or local instance)
- Backend: Node.js, Express.js
- Database: MongoDB
- Documentation: Swagger/OpenAPI
- Logging: Winston
- Containerization: Podman/Docker
- API Testing: Postman, Jest
-
Clone the repository
git clone https://github.com/brianchooou/IBM_Project.git cd api-demo -
Environment Setup
# Copy example environment file cp .env.example .env # Edit .env file with your configurations # Required variables: # - PORT=3000 # - MONGODB_URI=mongodb://admin:password@mongodb:27017/taskdb?authSource=admin # - NODE_ENV=development
-
Using Podman/Docker Compose
# Start the services podman-compose up -d # Check service status podman-compose ps
Once the service is running, access the Swagger documentation at:
http://localhost:3000/api-docs
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/tasks | Get all tasks |
| GET | /api/tasks/:id | Get a specific task |
| POST | /api/tasks | Create a new task |
| PUT | /api/tasks/:id | Update a task |
| DELETE | /api/tasks/:id | Delete a task |
- Logging
- Error logs:
logs/error.log - Combined logs:
logs/combined.log - Console output in development mode
- Error logs:
# Run tests
npm test
# Run tests with coverage
npm run test:coverage- CORS protection enabled
- Environment variable management
- Container network isolation
- Error handling middleware
- Set environment variables for production
- Build and push Docker images
- Deploy using container orchestration
- Monitor logs and performance
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Brian Chou - Initial work
- Node.js community
- Express.js framework
- MongoDB team
- Docker/Podman community