A developer collaboration platform API built with TypeScript, Express, and MongoDB. DevLink enables developers to create projects, apply to join projects, send messages, and manage their professional profiles.
src/
├── app.ts # Express app setup and routing
├── server.ts # Server bootstrap and database connection
├── middleware/
│ ├── auth.middleware.ts # JWT authentication middleware
│ └── error.middleware.ts # Centralized error handling
├── modules/
│ ├── auth/ # Authentication module
│ │ ├── auth.controller.ts
│ │ ├── auth.service.ts
│ │ ├── auth.routes.ts
│ │ ├── auth.dto.ts
│ │ └── auth.types.ts
│ ├── users/ # User management module
│ │ ├── users.controller.ts
│ │ ├── users.service.ts
│ │ ├── users.routes.ts
│ │ ├── users.model.ts
│ │ ├── users.dto.ts
│ │ └── users.types.ts
│ ├── projects/ # Project management module
│ │ ├── projects.controller.ts
│ │ ├── projects.service.ts
│ │ ├── projects.routes.ts
│ │ ├── projects.model.ts
│ │ ├── projects.dto.ts
│ │ └── projects.types.ts
│ ├── applications/ # Project applications module
│ │ ├── applications.controller.ts
│ │ ├── applications.service.ts
│ │ ├── applications.routes.ts
│ │ ├── applications.model.ts
│ │ ├── applications.dto.ts
│ │ └── applications.types.ts
│ └── messages/ # Messaging module
│ ├── messages.controller.ts
│ ├── messages.service.ts
│ ├── messages.routes.ts
│ ├── messages.model.ts
│ ├── messages.dto.ts
│ └── messages.types.ts
├── config/ # Configuration files
└── structure.md # Project structure documentation
DevLink follows a modular layered architecture where each feature is organized into its own module. Each module contains:
POST /api/auth/register - Create new user accountPOST /api/auth/login - Authenticate and get JWT tokenGET /api/users - Get current user profilePATCH /api/users/:id - Update user profilePOST /api/projects - Create a new projectGET /api/projects - List all projectsGET /api/projects/:id - Get single project detailsPATCH /api/projects/:id - Update project (owner only)DELETE /api/projects/:id - Delete project (owner only)POST /api/applications - Apply to a projectGET /api/applications - Get applications for owned projectsPATCH /api/applications/:id - Update application status (accept/reject)POST /api/messages - Send a messageGET /api/messages - Get conversation messagesGET /api/health-check - API status checkgit clone <repository-url>
cd devlink
npm install
.env file in the root directory:MONGODB_URI=mongodb://localhost:27017/devlink
PORT=3000
JWT_SECRET_KEY=your-super-secret-jwt-key
npm run dev
The API will be available at http://localhost:3000
npm run dev - Start development server with hot-reloadnpm run build - Compile TypeScript to JavaScriptnpm start - Run the compiled applicationAll endpoints except authentication routes require a JWT token. Include the token in the Authorization header:
Authorization: Bearer <your-jwt-token>
Tokens expire after 3 days.
{
username: string;
email: string;
password: string; // hashed
bio?: string;
skills?: string[];
githubLink?: string;
createdAt: Date;
updatedAt: Date;
}
{
title: string;
description: string;
techStack: string[];
owner: ObjectId; // User reference
createdAt: Date;
updatedAt: Date;
}
{
applicant: ObjectId; // User reference
project: ObjectId; // Project reference
status: "pending" | "accepted" | "rejected";
createdAt: Date;
updatedAt: Date;
}
{
sender: ObjectId; // User reference
recipient: ObjectId; // User reference
content: string;
createdAt: Date;
}
This project is licensed under the MIT License.