Skip to content

YutaUtah/LeetCodeAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Leetcode Record RESTful API

The project builds upon my personal leetcode problems practice history, and reflect it in simple html page.

Introduction:

This project is initiated because I want to learn more about RESTful API and programming language Go. At the same time, I want to keep track of my leetcode change record by rendering data in simple html file and visualize my progress :)

Overview:

The data is stored in JSON format. Below is the example:

record = {
            "ID": 47,
            "number": 122,
            "title": "String Manupulation",
            "difficulty": "easy",
            "date": "2022-01-10",
            "comment": "It was so easy!"
        }
  • ID: This is an unique identifier that represents the problem
  • number: This is a problem number that you can see in leetcode website
  • title: This is a problem title that you can see in leetcode website
  • difficulty: This represents problem level. (Easy, Medium, Hard)
  • date: This is a date of my problem completion
  • comment: Any comments on this problem

Request Information:

GET Request all problems:

curl -i http://localhost:9000/api/v1/problems/

GET Request problem by ID:

curl --header "Content-Type: application/json"    --request GET   http://localhost:9000/api/v1/problems/{id}

POST Request problem by ID:

curl --header "Content-Type: application/json"    --request POST   http://localhost:9000/api/v1/problems/

DELETE Request problem by ID:

curl --header "Content-Type: application/json"    --request DEKETE   http://localhost:9000/api/v1/problems/{id}

Visualizer:

http://localhost:9000/api/v1/about will take you to the table with the history of leetcode problems you solved.

about page

Database:

  • MySQL, all my config is stored in config directory - app.go

Local Setup for Development:

clone the repo locally

git clone https://github.com/YutaUtah/LeetCodeAPI.git

Download the required Go modules

go mod download

Run the server

cd cmd
go run main.go

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published