Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tompston/fullstack-boilerplate
full-stack project using go, any frontend, nginx, postgres and docker
https://github.com/tompston/fullstack-boilerplate
docker docker-compose golang nginx postgresql ssl-certificates
Last synced: about 1 month ago
JSON representation
full-stack project using go, any frontend, nginx, postgres and docker
- Host: GitHub
- URL: https://github.com/tompston/fullstack-boilerplate
- Owner: tompston
- License: mit
- Created: 2021-09-24T22:41:31.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-10-01T16:29:13.000Z (over 3 years ago)
- Last Synced: 2024-10-02T09:14:18.274Z (4 months ago)
- Topics: docker, docker-compose, golang, nginx, postgresql, ssl-certificates
- Language: Go
- Homepage:
- Size: 24.4 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Full Stack Project Template
backend -> go, fiber ( can switch framework )
frontend -> framework agnostinc
database -> postgres
## the .env file
So there are two .env files.
- ./env
- used by docker-compose.yml (during production) and docker-compose.local.yml during local testing with nginx
- ./fiber_server/.env
- used during local development., without docker## ./nginx folder
Holds an example of a nginx.conf file with reverse-proxy that connects the frontend and backend. Links to tutorials which explain what you need to do to add a domain and generate new ssl certs automatically
## How to run things
The current setup has 3 possible ways of running.
- using docker-compose.yml for production
# will create a postgres database with the variables that are mentioned in the .env file,
# build the frontend and serve with nginx
# build the backend and serve as a single binarydocker-compose up -d
# to add domain name and ssl certs, check out the instructions in the ./nginx folder
- using docker-compose.local.yml to test the production version. Nginx image connects the frontend and backend, so you can make api calls in the frontend from the same url (localhost).
# will create a postgres database with the variables that are mentioned in the .env file + ovveride the PAGE_URL and BASE_URL variables,
# build the frontend and serve with nginx
# build the backend and serve as a single binarydocker-compose -f docker-compose.local.yml up -d
- Running everything locally.
Run the go server and frontend separately.
Delete everything except the Dockerfile and nginx.conf file in the ./frontend folder and create a new project### Disclaimer
*Code and setup takes heavy inspiration from this [repo](https://github.com/karlkeefer/pngr)*