This is a simple Todo app built with Deno, Hono, and MongoDB. The app allows you to create, update, toggle, and delete todos. It uses Docker Compose to run the application and MongoDB in separate containers.
Make sure you have the following installed on your system:
Follow these steps to run the app:
git clone https://github.com/youdaman/deno_todo_app.git
cd deno_todo_app
Run the following command to start the app using Docker Compose:
docker-compose up --build
This will:
- Build the
deno-app
container - Start the
deno-app
container and themongo
container
Once the containers are running, you can access the app in your browser at:
http://localhost:3000
To stop the app, press Ctrl+C
in the terminal where Docker Compose is running,
or run:
docker-compose down
This will stop and remove the containers.
main.ts
: The main application file that defines the API routes and connects to MongoDBindex.html
: The frontend of the Todo appdocker-compose.yml
: The Docker Compose configuration filereadme.md
: This file
The app uses the following environment variables:
DENO_ENV
: Set todevelopment
by default indocker-compose.yml
You can modify these variables in the docker-compose.yml
file if needed.
-
MongoDB Connection Error:
- Ensure the
mongo
container is running - Check the logs of the
mongo
container:docker-compose logs mongo
- Ensure the
-
Port Already in Use:
- Make sure port
3000
(for the app) and27017
(for MongoDB) are not being used by other processes
- Make sure port
-
Rebuilding the Containers:
- If you make changes to the code, rebuild the containers:
docker-compose up --build
- If you make changes to the code, rebuild the containers: