DashPoint is a Point of Sale (POS) application featuring a robust Go backend and a modern Next.js frontend.
This guide will help you set up and run the DashPoint application locally on your machine.
Before you begin, ensure you have the following installed on your system:
- Git: For cloning the repository.
- Docker & Docker Compose: Required to easily run the PostgreSQL database (and optionally the backend API).
- Node.js (v20+ recommended) & npm: Required for running the Next.js frontend.
- Go (v1.21+): Only required if you wish to run the backend natively outside of Docker.
Follow these step-by-step instructions to get the application running on your local machine.
First, clone the repository to your local machine and navigate into the project directory:
git clone https://github.com/your-username/dashpoint.git
cd dashpoint(Replace your-username with the actual GitHub username where the repository is hosted).
The backend relies on environment variables for configuration. A template file is provided.
Copy the .env.example file to create your own .env file:
cp .env.example .envThe default values in .env are already configured for local development and will work seamlessly with the provided Docker Compose setup.
The easiest way to run the backend and its PostgreSQL database is using Docker Compose. The docker-compose.yml file is configured to spin up both the db (Postgres) and the backend (Go API) services, automatically running database migrations on startup.
Run the following command in the root of the project:
docker-compose up -dNote: The -d flag runs the containers in the background (detached mode). To view the logs, you can run docker-compose logs -f.
The backend API will now be accessible at http://localhost:8080.
(Alternatively, to run the Go backend natively: Start only the database with docker-compose up -d db. Then, open a new terminal, navigate to the backend directory, run go mod download, and start the server with go run cmd/server/main.go).
With the backend and database running, you can now start the frontend web application.
Open a new terminal window, navigate to the frontend directory, install the dependencies, and start the development server:
cd frontend
npm install
npm run devThe Next.js development server will start, typically on port 3000.
Open your favorite web browser and navigate to:
You should now see the DashPoint frontend, successfully communicating with your local backend and database!
- Database Connection Issues: Ensure Docker is running. If the backend fails to connect to the database, verify that the
dbcontainer is fully initialized and healthy. - Port Conflicts: If ports
8080(Backend),5432(Postgres), or3000(Frontend) are already in use by other applications, you will need to stop those applications or modify the respective configurations (docker-compose.yml,.env, or frontend start scripts).