Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migrate to Firebase and major cleanup #4

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@
# Dependency directories (remove the comment below to include it)
# vendor/
/.idea/
/haparlament
/ui/build/
/ui/node_modules/
/go.sum
/deploy/haparlament
python_backend/src/__pycache__/main.cpython-39.pyc

# React App
node_modules
build
*debug.log

# Firebase
.firebase/
.firebaserc

18 changes: 0 additions & 18 deletions Dockerfile

This file was deleted.

33 changes: 24 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,33 @@
The applications - in this project was build based on [this article](https://observiq.com/blog/embed-react-in-golang/)

### Guidelines
- Always use the latest Go version
- Use node 16.20.0-lts
- Work in single branch
- Don't push code without ensuring it is working properly

### Deployment
Use the Deployment folder for
1. Building the client side code by running `build.client.sh`
The script generates static files into `ui/build` folder that later pushed into the Go app
<br />
### Technologies
- Firebase
- Node/Express
- React

### Repo Structure
The project is based on Firebase thus takes the repo structure from Google's Firebase best practices.

2. Building the server side code by running `build.server.sh`
This script build the app for Linux environment. If you want to build it for different OS you need to look for `env GOOS=linux GOARCH=amd64` and replace per your need. Environment variables can be found [here](https://www.digitalocean.com/community/tutorials/how-to-build-go-executables-for-multiple-platforms-on-ubuntu-16-04)
1. Backend is located under `functions` and has a seperate `package.json`. It is an Express app built on top of Firebase cloud functions.
2. Frontend is located under `src` and is a React app which is hosted via Firebase hosting service.

*Note that the folder you are executing the build should be the `deploy` folder*
### Development

1. make sure you are running on node16.20.0-lts
2. install firebase tools globally `npm install -g firebase-tools`
3. you should make sure you are added to haparlament project on firebase and receive required credentials.
4. `firebase init emulators` answer all questions with suggested values.

#### Backend

1. `npm run serve`
2. `npm run deploy`

#### Frontend
1. `npm start`
2. `firebase deploy --only hosting`
50 changes: 0 additions & 50 deletions api/api.go

This file was deleted.

11 changes: 0 additions & 11 deletions api/routes.go

This file was deleted.

15 changes: 0 additions & 15 deletions api/start.go

This file was deleted.

108 changes: 0 additions & 108 deletions api/store.go

This file was deleted.

23 changes: 0 additions & 23 deletions api/types.go

This file was deleted.

32 changes: 0 additions & 32 deletions conf/default.conf

This file was deleted.

4 changes: 0 additions & 4 deletions deploy.sh

This file was deleted.

6 changes: 0 additions & 6 deletions deploy/Dockerfile

This file was deleted.

10 changes: 0 additions & 10 deletions deploy/build.client.sh

This file was deleted.

11 changes: 0 additions & 11 deletions deploy/build.server.sh

This file was deleted.

11 changes: 0 additions & 11 deletions deploy/deploy2GCP.sh

This file was deleted.

11 changes: 0 additions & 11 deletions docker-compose.build.yaml

This file was deleted.

Loading