Skip to content

mahsahakimi/express_back_end

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

API Documentation

Overview

This document provides a comprehensive guide to the API built using Express.js. The API allows users to manage problems, teachers, and students effectively.

Endpoints

Get all problems

app.get('/problems', async (req, res) => {
    // Logic to retrieve all problems
});

Get all problems by author

app.get('/problems/:author', async (req, res) => {
    // Logic to retrieve problems by a specific author
});

Get a problem by name

app.get('/problems/:title', async (req, res) => {
    // Logic to retrieve a specific problem by its title
});

Check problem answer

app.post('/problems/checkproblem/:username', async (req, res) => {
    // Logic to check the answer for a problem
});

Get all teachers

app.get('/teachers', async (req, res) => {
    // Logic to retrieve all teachers
});

Get a teacher by username

app.get('/teachers/:username', async (req, res) => {
    // Logic to retrieve a specific teacher by username
});

Get all students

app.get('/students', async (req, res) => {
    // Logic to retrieve all students
});

Get a student by username

app.get('/students/:username', async (req, res) => {
    // Logic to retrieve a specific student by username
});

Get a student's solved problems by username

app.get('/students/:username/solved', async (req, res) => {
    // Logic to retrieve solved problems for a specific student
});

Add a solved question for a student

app.put("/addsolved", async (req, res) => {
    // Logic to add a solved question for a student
});

Add a new user

app.post('/signup', async (req, res) => {
    // Logic to add a new user
});

Login check

app.post('/login', async (req, res) => {
    // Logic to check user login credentials
});

Add a new problem

app.post('/saveproblem', async (req, res) => {
    // Logic to add a new problem
});

Update a problem

app.put("/updateproblem/:title", async (req, res) => {
    // Logic to update a problem
});

Running the Server

To start the server, use the following code in the root directory:

node server.js

Ensure that you have all necessary dependencies installed and run the server using Node.js. Access the API at http://localhost:8081.

About

This project is a backend program developed using Express.js in JavaScript. It serves as an API that connects to its front-end React web application in this repository (https://github.com/mahsahakimi/react_front_end), facilitating seamless communication between the front-end and back-end.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors