https://github.com/noueii/gonuxt-starter
Fullstack GO + Nuxt blueprint
https://github.com/noueii/gonuxt-starter
docker gin go grpc grpc-go nuxt openapi
Last synced: 8 months ago
JSON representation
Fullstack GO + Nuxt blueprint
- Host: GitHub
- URL: https://github.com/noueii/gonuxt-starter
- Owner: noueii
- Created: 2025-03-30T21:23:03.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-06-10T08:12:57.000Z (8 months ago)
- Last Synced: 2025-06-10T09:27:40.028Z (8 months ago)
- Topics: docker, gin, go, grpc, grpc-go, nuxt, openapi
- Language: Go
- Homepage:
- Size: 10.7 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# gonuxt-starter
## Installing
### Step 1. Docker postgres image (optional)
*This step assumes you have docker already installed on your machine*
I recommend outsourcing the database and skipping to step 3.
Self hosting a database in a production environment is easier said than done, even if everything seems to be working properly :)
1. Pulling the latest postgres image for docker
```
docker pull postgres:latest
```
2. Running your image on a container
**Syntax**
```
docker run --name [CONTAINER_NAME] -p [INTERNAL PORT:EXTERNAL PORT] -e POSTGRES_USER=[DATABASE USER NAME] -e POSTGRES_PASSWORD=[DATABASE USER PASSWORD] -d postgres
```
**My defaults**
```
docker run --name gonuxt-postgres -p 5432:5432 -e POSTGRES_USER=root -e POSTGRES_PASSWORD=gonuxtsecret -d postgres
```
3. Connecting with your database
I recommend using psql, you would need to install postgres on your local machine.
**Syntax**
```
psql [DATABASE DRIVER]://[DATABASE USER]:[DATABASE PASSWORD]@[IP ADDRESS]:[PORT]
```
**My defaults**
```
psql postgres://root:gonuxtsecret@localhost:5432
```
If your terminall connects to the database shell, it means you have completed the setup correctly.
You can exit out of the shell with the command \q
4. Creating the database for our project
I created some Makefiles to make the setup a bit more intuitive.
You can find the commands ran inside the Makefiles at the root at the project.
In order to execute them, you will need gnu make
Based on your setup, you might want to modify the variables available inside Makefile.variable
After you are done modifying the variables, you can run the command
```
make createdb
```
This should create a database with the name set up inside the Makefile.variable
5. Creating migrations
I am using sqlc and goose for this project. Make sure to install them.
I created a folder called db with 3 other folders inside it.
-
db/schema- we write the migrations we want to apply here -
db/queries- we write the queries for our database here -
db/out- the output folder where sqlc generates our go code
You can find the syntax for writing migrations and queries on the official goose website.
I created some files for our small use case.