A simple todo application built using Node.js and TypeScript. It has the following features:
- Backend server in Node.js using TypeScript; API using REST protocol
- Frontend app using React and TypeScript
- Basic Authentication (username and password)
- User registration and login
- Data Storage (MongoDB)
- CRUD operations on a entity
- Tests using Jest framework
- Containerization of the application using Docker.
To run the todo application using Docker using VS Code,
- Install Docker Desktop which will install Docker Engine.
- Install the Docker VS Code Extention.
- Right-click the
docker-compose.yml
file and click theCompose Up
command. - The React app will be accessible on
http://localhost
.
If you prefer to use the command line, then run the following command in the root of the project:
docker-compose up
The logs can be monitored using Docker Desktop.
To shut down the todo application, right-click the docker-compose.yml
file and click the Compose Down
command.
For the command line:
docker-compose down
- Node.js (v20 or greater)
- MongoDB (MongoDB Compass is optional)
- Clone the GitHub repository.
git clone git@github.com:anikeshk/todo.git
- Go to the server folder and install dependencies.
cd server
npm install
- Copy the
.env.example
file to.env
and make any necessary changes.
cp .env.example .env
- Go to the app folder and install dependencies.
cd ../app
npm install
- Copy the
.env.example
file to.env
and make any necessary changes.
cp .env.example .env
- Open two terminals and go to the root of the project. In the first terminal, go to the server folder, build and run the server.
cd server
npm run build && npm run start
The backend API is now accessible at http://localhost:5000
.
- In the second terminal, go to the app folder and run the app.
cd app
npm run dev
The frontend React app is now accessible at http://localhost:3000
.