fullstack-app

module
v0.0.0-...-855d15e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 3, 2025 License: MIT

README

Fullstack App

This repository contains a full-stack application, built with Go for the API layer and React for Client layer.

Table of Contents

Project Overview

This repository contains a full-stack application, built with Go for the API layer and React for Client layer. This makes deployment and maintenance straightforward. This repository also follows the best practices for Go and React applications. Apart from that this follows the Golang standards for project layout. Treat this as a starting point and further extend it to suit your needs.

Features & Highlights
  • Go API:

    • Fiber - Web framework.
    • Air - Live reload for Go apps.
    • Swagger - API documentation.
    • Make - Build automation.
  • React Client:

  • Fullstack

    • Concurrent Development - Run both the API and the React app concurrently.
    • Production Build - Build a single executable for the API and the React app.

Installation

Ensure you have Go and Node.js installed on your machine. If you don't have them, you can follow the installation guides for Go Installation and Node.js Installation.

  1. Clone the repository:

    git clone <repository-url>
    cd <project-directory>
    
  2. Install Go & Node dependencies:

    make deps
    

Running the Application

Development Mode

In development mode, the backend API and the frontend React app runs concurrently. The React app will be served on a development server, and the Go backend will handle API requests and serve the built React app.

  1. Start the development environment:

    make dev
    

    This will:

    • Build the Go API and generate Swagger documentation.
    • Keep watching the react app for changes and keep building it in realtime.
    • Start the Go backend with hot reloading using air.
Production Build

In production, a single executable is built, containing both the backend and the bundled React client.

  1. Build for all platforms:

    make build
    
  2. Run the generated binary:

    make run
    

This will start the API and serve the React app.

Commands

Install Dependencies

Install Go and Node dependencies:

make deps
Build the Application

Build the Go API and the React client:

make build
Run the Application

Run the Go API and serve the React client:

make run
Test the Application

Run tests for the Go API and the React client:

make test
Swagger Documentation

Generate Swagger documentation:

make swagger

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is open-sourced software licensed under the MIT license.

Directories

Path Synopsis
api
openapi
Package openapi Code generated by swaggo/swag.
Package openapi Code generated by swaggo/swag.
cmd
app
db
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL