The purpose of this webapp is to present LeetCode patterns in a way that is minimalistic and simple. This app is designed as a small flashcard-like studying app to help LeetCode learners memorize LeetCode topics which they can then apply to LeetCode problems. The emphasis here is on the patterns instead of the LeetCode problems themselves. Relevant LeetCode problems have been listed with each pattern for those who wish to apply these patterns outside of this site. This app is a full CRUD app where users can read, create, edit, and delete LeetCode study entries.
Javascript ~ React ~ MongoDB ~ Express ~ Node ~ HTML ~ CSS ~ Material UI-
If you already have Docker installed on your machine, then this app can be simply run with the following instructions. The docker-compose.yml contains all of the Docker info needed to understand the context in which the app runs, including: builds, ports, network, volume storage, and environment variables. Note that for simplicity, the environment variables for the backend express server have been placed directly into the .yml file, but these can also be moved to a separate .env file and more can be read about how to do that here: Docker Env Vars
-
Clone all project files into a root working directory.
git clone https://github.com/UreshiiPanda/LeetStudy.git
-
From that root directory, run docker compose:
docker compose up
-
To stop the app, stop docker compose from another terminal:
docker compose down
-
Clone all project files into a root working directory.
git clone https://github.com/UreshiiPanda/LeetStudy.git
-
Setup your MongoDB database, create a new cluster, and host it or connect your local IP to it. Retrieve your MongoDB connection string from here. The connection string will look something like this, depending on your means of connecting:
mongodb+srv://<username>:<password>@cluster0.vj6fual.mongodb.net/?retryWrites=true&w=majority -
Store environment variables by creating
/backend/.envin the backend directory.
Place your environment variables into this file. Replace <username> and <password> in the MongoDB connect string with your MongoDB credentials.PORT=8000 mongo_db_uri=mongodb+srv://<username>:<password>@cluster0.vj6fual.mongodb.net/?retryWrites=true&w=majorityNOTE: The package.json on the frontend has a proxy setup by default, please adjust this according to your own connection needs. The proxy is currently setup to connect to a Docker Container, so please change the proxy to the localhost proxy shown below in order to use it without Docker. Default ports are set to 8000 for the backend, and 3000 for the frontend.
"proxy": "http://localhost:8000"
-
Run the following command in both the frontend and the backend directories to install the node modules required for both ends of the app.
npm install
-
Check that your MongoDB cluster is connected and then start the backend of the app from the backend directory:
node controller.mjs
-
Start the frontend of the app from the frontend directory:
npm start
