Skip to content

hadyrashwan/golang-for-node-devs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

To-do App

A to-do app built using Turso and Go. Netlify Status

Deploy to Netlify

Demo

Check out the demo of this project here.

Technologies Used

  • Frontend: React, Chakra UI, Vite
  • Backend: Turso, Go

Running Backend Tests

To run the tests for the backend you can run: go test ./...

Environment Variables

The following environment variables are required for the project to function properly:

  • BACKEND_PORT The port number on which the backend server will run.
  • DB_URL The URL of the database used by the project.
  • DB_TOKEN The token required to authenticate with the database.
  • GO_VERSION The version of Go used for building the backend.
  • IS_LOCAL A boolean value indicating whether the project is running locally or not.

Make sure to set these environment variables before running the project.

Running Locally

To run the project locally, follow these steps:

Backend

  1. Create a new file named .env in the backend/api directory based on .env.local.example.
  2. Run the following command to start the backend server:
    go run .
  3. The backend server will start and listen on the port specified by the BACKEND_PORT environment variable.

Frontend

  1. Create a new file named .env in the client directory based on .env.local.example.

  2. Install the project dependencies by running the following command in the client directory:

    npm install
  3. Start the development server by running the following command in the client directory:

    npm run dev
  4. The frontend will start and be accessible at URL mentioned in the console.

Deploying to Netlify

To deploy the project to Netlify, follow these steps:

  1. Set the environment variables found in backend/api/.env.netlify.example within your Netlify project settings.

  2. Set the environment variables from client/.env.netlify.example in your Netlify project settings, adjusting them according to your site's naming conventions.

  3. Deploy the project to Netlify.

API Documentation

For API documentation, please refer to the Postman documentation.

License

This project is licensed under the MIT License.