Skip to content

Grins-sah/coursify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Coursify

Your task is to create a course-selling website where admin can publish/create courses and user can purchase courses.

Frontend

There are two Client folders

  • if you are not familiar with React, pick client-easy.
  • if you are familiar with React, pick client.

Tips: you can try cloning the UI of app.100xdevs.com.

Backend

Admin Routes Structure

POST /admin/signup

Description: Creates a new admin account.
Input:

{ 
  "username": "admin", 
  "password": "pass" 
}

Output:

{ 
  "message": "Admin created successfully", 
  "token": "jwt_token_here" 
}

POST /admin/login

Description: Authenticates an admin. It requires the admin to send username and password in the headers.
Input:
Headers:

{ 
  "username": "admin", 
  "password": "pass" 
}

Output:

{ 
  "message": "Logged in successfully", 
  "token": "jwt_token_here" 
}

POST /admin/courses

Description: Creates a new course.
Input:
Headers:

{ 
  "Authorization": "Bearer jwt_token_here" 
}

Body:

{ 
  "title": "course title", 
  "description": "course description", 
  "price": 100, 
  "imageLink": "https://linktoimage.com", 
  "published": true 
}

Output:

{ 
  "message": "Course created successfully", 
  "courseId": 1 
}

PUT /admin/courses/:courseId

Description: Edits an existing course. courseId in the URL path should be replaced with the ID of the course to be edited.
Input:
Headers:

{ 
  "Authorization": "Bearer jwt_token_here" 
}

Body:

{ 
  "title": "updated course title", 
  "description": "updated course description", 
  "price": 100, 
  "imageLink": "https://updatedlinktoimage.com", 
  "published": false 
}

Output:

{ 
  "message": "Course updated successfully" 
}

GET /admin/courses

Description: Returns all the courses.
Input:
Headers:

{ 
  "Authorization": "Bearer jwt_token_here" 
}

Output:

{ 
  "courses": [ 
    { 
      "id": 1, 
      "title": "course title", 
      "description": "course description", 
      "price": 100, 
      "imageLink": "https://linktoimage.com", 
      "published": true 
    }, 
    ... 
  ] 
}

User Routes Structure


POST /users/signup

Description: Creates a new user account.
Input:

{ 
  "username": "user", 
  "password": "pass" 
}

Output:

{ 
  "message": "User created successfully", 
  "token": "jwt_token_here" 
}

POST /users/login

Description: Authenticates a user. It requires the user to send username and password in the headers.
Input:
Headers:

{ 
  "username": "user", 
  "password": "pass" 
}

Output:

{ 
  "message": "Logged in successfully", 
  "token": "jwt_token_here" 
}

GET /users/courses

Description: Lists all the courses.
Input:
Headers:

{ 
  "Authorization": "Bearer jwt_token_here" 
}

Output:

{ 
  "courses": [ 
    { 
      "id": 1, 
      "title": "course title", 
      "description": "course description", 
      "price": 100, 
      "imageLink": "https://linktoimage.com", 
      "published": true 
    }, 
    ... 
  ] 
}

POST /users/courses/:courseId

Description: Purchases a course. courseId in the URL path should be replaced with the ID of the course to be purchased.
Input:
Headers:

{ 
  "Authorization": "Bearer jwt_token_here" 
}

Output:

{ 
  "message": "Course purchased successfully" 
}

GET /users/purchasedCourses

Description: Lists all the courses purchased by the user.
Input:
Headers:

{ 
  "Authorization": "Bearer jwt_token_here" 
}

Output:

{ 
  "purchasedCourses": [ 
    { 
      "id": 1, 
      "title": "course title", 
      "description": "course description", 
      "price": 100, 
      "imageLink": "https://linktoimage.com", 
      "published": true 
    }, 
    ... 
  ] 
}
```"# coursify" 

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors