This project is a full-stack application built with Go (backend) and React (frontend). It uses MongoDB as the database and Tailwind CSS for styling.
Deployed Link -> https://react-golang-todo-production.up.railway.app/
- Prerequisites
- Installation
- Running the Project
- Project Structure
- Environment Variables
- Available Scripts
Before you begin, ensure you have the following installed on your machine:
-
Clone the repository:
git clone https://github.com/rishyym0927/golang-react-1.git cd golang-react-1
-
Install backend dependencies:
go mod tidy
-
Install frontend dependencies:
cd client npm install
-
Set up environment variables:
Create a
.env
file in the root directory and add the following:PORT=3000 MONGO_URI=your_mongodb_uri ENV=development
-
Run the backend server:
go run main.go
-
Navigate to the client directory:
cd client
-
Start the frontend development server:
npm run dev
-
Open your browser and navigate to:
http://localhost:5173
golang-react-1/
├── .env
├── .gitignore
├── .gitignore-1
├── air.toml
├── go.mod
├── go.sum
├── main.go
├── client/
│ ├── index.html
│ ├── src/
│ │ ├── App.jsx
│ │ ├── index.css
│ │ ├── main.jsx
│ │ └── TodoManager.jsx
│ ├── tailwind.config.js
│ └── .env
The project uses the following environment variables:
PORT
: The port on which the backend server will run.MONGO_URI
: The URI for connecting to MongoDB.ENV
: The environment in which the application is running (e.g., development, production).
go run main.go
: Runs the backend server.
npm run dev
: Starts the frontend development server.npm run build
: Builds the frontend for production.npm run serve
: Serves the built frontend.
- Ensure MongoDB is running and accessible via the
MONGO_URI
specified in the.env
file. - The backend server runs on
http://localhost:3000
by default. - The frontend development server runs on
http://localhost:5173
by default.
Feel free to contribute to this project by submitting issues or pull requests. Enjoy coding!