- Go
- HTMX
- Tailwind
- Mongodb
To run this Todo application on your local machine, follow these steps:
-
Prerequisites:
- Go (version 1.16 or later)
- MongoDB Atlas account (or a local MongoDB installation)
- Git
-
Clone the repository:
git clone https://github.com/noahdurbin/todo-go.git cd todo-app
-
Set up environment variables: Create a
.env
file in the root directory of the project and add the following:MONGODB_URI=your_mongodb_connection_string PORT=8080
Replace
your_mongodb_connection_string
with your actual MongoDB Atlas connection string or local MongoDB URI. -
Install dependencies:
go mod tidy
-
Create the HTML template: Create a file named
index.html
in the root directory and add your HTML template for the Todo app. -
Create a static folder: Create a folder named
static
in the root directory for any static assets (CSS, JavaScript, images). -
Run the application:
go run main.go
-
Access the application: Open your web browser and navigate to
http://localhost:8080
(or whatever port you specified in the .env file).
- Ensure that your MongoDB Atlas cluster (or local MongoDB instance) is running and accessible.
- If you're using MongoDB Atlas, make sure to whitelist your IP address in the Atlas dashboard.
- The application will create a database named
tododb
and a collection namedtodos
automatically.
If you encounter any issues, ensure all dependencies are correctly installed and that your MongoDB connection string is correct.