A Next.js web application for managing and displaying domain resources with active link monitoring. This project provides a dynamic link management system with real-time URL validation and status tracking.
- Link Management: Display and manage a collection of links with metadata (title, URL, description, icon)
- Active Link Monitoring: Real-time validation of link availability
- MongoDB Integration: Persistent storage using Mongoose
- API Routes: RESTful API endpoints for link operations
- Modern UI: Built with React 19 and SCSS styling
- Docker Support: Containerized deployment ready
- TypeScript: Fully typed for better development experience
- Node.js (latest version)
- MongoDB instance (local or cloud-based)
- npm, yarn, pnpm, or bun package manager
-
Clone the repository:
git clone https://github.com/enVId-tech/Domain-Resources-Web.git cd Domain-Resources-Web -
Install dependencies:
npm install
-
Set up environment variables:
Create a
stack.envfile in the root directory with your MongoDB connection string and other required variables:MONGODB_URI=your_mongodb_connection_string # Add other environment variables as needed
-
Run the development server:
npm run dev
-
Open your browser:
Navigate to http://localhost:3000 to see the application.
npm run dev- Start the development servernpm run build- Build the production applicationnpm run start- Start the production servernpm run lint- Run ESLint for code qualitynpm run ncu- Update all dependencies to their latest versions
Build and run the application using Docker:
# Build the Docker image
docker build -t domain-resources-web .
# Run the container
docker run -p 3090:3090 --env-file stack.env domain-resources-webThe application will be available at http://localhost:3090.
├── app/
│ ├── api/
│ │ └── links/ # API endpoints for link management
│ │ └── route.ts # GET endpoint for fetching links
│ ├── error/ # Error page components
│ ├── links/ # Links display page
│ ├── utils/
│ │ ├── db.ts # MongoDB connection utilities
│ │ └── validation.ts # URL validation utilities
│ ├── _app.tsx # Custom App component
│ ├── layout.tsx # Root layout
│ └── page.tsx # Home page
├── public/ # Static assets
├── styles/ # SCSS stylesheets
├── Dockerfile # Docker configuration
├── next.config.ts # Next.js configuration
├── tsconfig.json # TypeScript configuration
└── package.json # Dependencies and scripts
Fetches all links from the database with their active status.
Response:
{
"success": true,
"links": [
{
"id": 1,
"title": "Example Link",
"url": "https://example.com",
"description": "Description text",
"icon": "icon-url"
}
],
"linksActive": [
{
"link": "https://example.com",
"active": true
}
]
}Cache: 20 minutes with 10-minute stale-while-revalidate
- Framework: Next.js 16.1.1 with App Router
- Runtime: React 19.2.3
- Language: TypeScript 5
- Database: MongoDB with Mongoose 9.1.1
- Styling: SASS/SCSS 1.97.1
- Icons: React Icons 5.5.0
- Linting: ESLint 9
- Containerization: Docker
Ensure your stack.env file contains:
MONGODB_URI- MongoDB connection string- Additional environment variables as needed for your deployment
This project is licensed under the terms specified in the LICENSE file.