Skip to content

Iyadh27/simple-todoList-app-with-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Here's a detailed README.md file that not only explains the project setup but also highlights your learning journey with Docker. It will serve as a good reflection of your efforts to incorporate Docker into your development process.

# Simple To-Do App with React and Node.js

This is a simple To-Do application built with a React frontend and a Node.js backend, designed to help me learn and explore Docker for containerizing full-stack applications. The project uses Docker and Docker Compose to run the frontend and backend as separate services, demonstrating a basic multi-container application.

## 📝 Features

- **Frontend**: Built with React, allowing users to add and view tasks in a clean UI.
- **Backend**: Built with Node.js and Express, handling task management with a simple REST API.
- **Dockerized**: Both the frontend and backend are containerized using Docker, making the application easy to run and manage.

## 🚀 Getting Started

### Prerequisites

- [Docker](https://www.docker.com/get-started) and [Docker Compose](https://docs.docker.com/compose/install/) installed on your machine.

### Installation and Running the Application

1. **Clone the repository:**

   ```bash
   git clone https://github.com/yourusername/simple-todo-app.git
   cd simple-todo-app
   ```
  1. Build the Docker containers:

    docker-compose build
  2. Run the application:

    docker-compose up
  3. Access the application:

🐳 Understanding the Docker Setup

Backend (/backend/Dockerfile)

The backend is a Node.js application using Express for handling REST API requests. Here's a breakdown of the Dockerfile:

  • Base Image: node:18-alpine for a lightweight Node.js environment.
  • Working Directory: Sets /app as the working directory inside the container.
  • Dependencies: Installs dependencies defined in package.json.
  • Copy Source Code: Copies the backend source code into the container.
  • Expose Port 5000: Exposes the backend to port 5000.
  • Start Command: Runs node server.js to start the server.

Frontend (/frontend/Dockerfile)

The frontend is a React application built and served using serve. Key steps in the Dockerfile include:

  • Base Image: node:18-alpine for a small Node.js environment.
  • Build Step: Builds the React application for production.
  • Serving: Uses serve to run the built files.
  • Expose Port 3000: Exposes the frontend to port 3000.

Docker Compose (docker-compose.yml)

Docker Compose is used to orchestrate both the backend and frontend containers:

  • Backend Service: Runs the Node.js server on port 5000.
  • Frontend Service: Runs the React frontend on port 3000 and depends on the backend service.

🎯 Learning Objectives

By creating this project, I'm learning to:

  • Containerize Applications: Understand the process of creating Dockerfiles for different services.
  • Use Docker Compose: Manage multi-container applications efficiently.
  • Expose and Link Services: Connect frontend and backend services within a Docker network.
  • Explore Best Practices: Follow best practices for setting up and managing Dockerized environments.

📚 What I've Learned So Far

  • Docker Basics: Understanding images, containers, and Dockerfiles.
  • Container Networking: How services communicate within Docker.
  • Efficiency: Building and running multi-container applications seamlessly with Docker Compose.

🤝 Contributions

This project is part of my learning journey, but feel free to contribute, suggest improvements, or ask questions!

📧 Contact

Feel free to reach out if you have suggestions or feedback. I'm excited to learn more and improve!


Thanks for checking out my project. Happy coding!


This `README.md` provides a clear understanding of your project while emphasizing your learning journey with Docker. Let me know if you would like to adjust anything further!

About

Ive built a simple todo-list application with a React frontend and Nodejs backend to understand how docker works

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors