Skip to content

bhra-odoo/hackathon_10201

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 

Repository files navigation

Skill Swap Platform - Backend API

Important Note: Due to network limitations and time constraints during development, we were unable to fully implement and connect the frontend interface. However, the backend API is nearly complete with all core functionality implemented and tested.

Project Status

  • Backend: 95% complete (All major features implemented)
  • ⚠️ Frontend: Basic scaffolding only (Not fully connected)
  • 🔌 API: Fully functional and ready for frontend integration

Table of Contents

  1. API Overview
  2. Key Features
  3. Authentication
  4. User Management
  5. Skill System
  6. Swap Functionality
  7. Admin Controls
  8. Data Models
  9. Error Handling
  10. Setup Instructions
  11. Future Improvements

API Overview

A RESTful API for a skill-sharing platform where users can:

  • Create profiles with their skills
  • Connect with other users
  • Initiate skill swaps
  • Rate completed exchanges
  • Manage friend networks

Base URL: http://localhost:8000/api


Key Features

Completed Backend Features

  • JWT authentication system
  • User profile management
  • Skill catalog with approval system
  • Friend request workflow
  • Swap negotiation system
  • Rating system for completed swaps
  • Admin moderation tools

Pending Frontend Integration

  • User registration flow
  • Skill browsing interface
  • Swap management dashboard
  • Real-time notifications
  • Rating submission UI

Authentication

Endpoint Method Description Parameters
/auth/signup POST Register new user name, email, password, [adminKey]
/auth/login POST Authenticate user email, password
/auth/logout GET Terminate session (Requires auth token)

Sample Login Request:

{
  "email": "user@example.com",
  "password": "securepassword123"
}

User Management

Profile Endpoints

Endpoint Method Description
/users/me GET Get current user profile
/users/me PUT Update profile information

Friend System

Endpoint Method Description
/users/friends/request/:userId POST Send friend request
/users/friends/respond/:requestId PUT Accept/reject request
/users/friends/:friendId DELETE Remove friend

Skill System

Endpoint Method Description Access Level
/skills GET List all approved skills Public
/skills/:id GET Get skill details Public
/skills POST Create new skill Admin
/skills/:id PUT Update skill Admin

Swap Functionality

Endpoint Method Description
/swaps POST Initiate new swap
/swaps/:id/respond PUT Accept/reject swap
/swaps/:id/rate PUT Submit rating
/swaps/:id/complete PUT Mark swap as complete

Admin Controls

(Admin endpoints to be documented in API SPECS.md)


Data Models

User

{
  "id": "ObjectId",
  "name": "String",
  "email": "String",
  "skillsOffered": ["SkillId"],
  "skillsWanted": ["SkillId"],
  "friends": ["UserId"],
  "friendRequests": {
    "sent": [{
      "to": "UserId",
      "status": "String"
    }],
    "received": [{
      "from": "UserId",
      "status": "String"
    }]
  }
}

Complete documentation available in API SPECS.md


Error Handling

To be covered in API SPECS.md.


Setup Instructions

  1. Clone repository

  2. Install dependencies

    npm install
  3. Configure .env file

    MONGODB_URI=your_connection_string
    JWT_SECRET=your_secret_key
    ADMIN_SECRET=your_admin_key
    
  4. Start server

    npm start

Future Improvements

  • Frontend integration
  • Real-time notifications
  • Advanced search filters
  • Skill verification system
  • Mobile app development

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages