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

Some repo fixes! #4

Merged
merged 13 commits into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
9 changes: 2 additions & 7 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,11 @@

[Link to Ticket](insert the link to your ticket inside the parenthesis here)

Please include a summary of the changes and the related issue. Please also
include relevant motivation, context, and images! If its a frontend ticket,
screenshots are important, if its a backend ticket, please add pictures of
relevant postman screenshots or console printouts.
Please include a summary of the changes and the related issue. Please also include relevant motivation, context, and images! If its a frontend ticket, screenshots are important, if its a backend ticket, please add pictures of relevant postman screenshots or console printouts.

# How Has This Been Tested?

Please describe the tests that you ran to verify your changes. If they are unit
tests, provide the file name the tests are in. If they are not unit tests,
describe how you tested the change.
Please describe the tests that you ran to verify your changes. If they are unit tests, provide the file name the tests are in. If they are not unit tests, describe how you tested the change.

# Checklist

Expand Down
10 changes: 2 additions & 8 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:

services:
postgres:
image: postgres:latest
image: postgres:14.1-alpine
env:
POSTGRES_PASSWORD: pwd
POSTGRES_USER: user
Expand Down Expand Up @@ -77,15 +77,9 @@ jobs:
with:
go-version: ${{ matrix.go-version }}

- name: Install Task
uses: arduino/setup-task@v1
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Run Go tests
run: |
task test-all
make backend-tests
build:
name: Build
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.env
19 changes: 19 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
include .env
export

# Installing frontend dependencies
.PHONY: frontend-dep
frontend-dep:
Expand Down Expand Up @@ -33,7 +36,23 @@ backend-lint:
backend-format:
cd backend && go fmt

# Build the docker db
.PHONY: backend-docker
backend-docker:
docker-compose up

# Run backend
.PHONY: backend-run
backend-run:
cd backend && go run main.go

# convert the backend link to an ngrok link
.PHONY: backend-ngrok
backend-ngrok:
@echo ${EXPO_PUBLIC_API_DOMAIN}
cd backend && ngrok http --domain=${EXPO_PUBLIC_API_DOMAIN} 8080

# Test the backend
.PHONY: backend-test
backend-test:
cd backend
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ The installation process can vary, so follow the instructions for each item belo
- Afterwards, install all go dependencies using `make backend-dep`.
- [yarn](https://classic.yarnpkg.com/en/docs/install#mac-stable) - our package manager in the frontend
- Afterwards, install all yarn dependencies using `make frontend-dep`.
- [expo-go](https://docs.expo.dev/get-started/expo-go/) - Expo allows mobile
devices to scan a QR code and view the code running on a mobile device
- [ngrok](https://ngrok.com/docs/getting-started/) - Allows us to easily connect

If everything was successful, you can now compile and run the project!

Expand All @@ -33,6 +36,8 @@ We will be using some tools to make development a bit easier.

- [Swagger](https://github.com/swaggo/swag) - Will allow us to visualize the API and query requests from the database.
- [Makefile](https://opensource.com/article/18/8/what-how-makefile) - Will allow us to easily run scripts by consolidating them into Makefile commands. Make sure to read up about each command and ask questions. You should know what you are running!
- [xcode](https://docs.expo.dev/workflow/ios-simulator/) - A simulator to view the code on an iphone from a laptop
- [android studio](https://docs.expo.dev/workflow/android-studio-emulator/ An emulator to view the code on an android device from a laptop

### Third party integrations
For this project, we will be using some third-party APIs.
Expand Down
14 changes: 8 additions & 6 deletions backend/src/db/migrations/init.sql
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
DROP TABLE IF EXISTS users;

CREATE TABLE IF NOT EXISTS users (
user_idid SERIAL PRIMARY KEY,
first_name varchar NOT NULL,
last_name varchar NOT NULL,
user_id SERIAL PRIMARY KEY,
first_name VARCHAR NOT NULL,
last_name VARCHAR NOT NULL,
pass_word VARCHAR NOT NULL,
email VARCHAR NOT NULL
);

-- Insert sample data into "users" table
INSERT INTO users (first_name, last_name)
INSERT INTO users (first_name, last_name, pass_word, email)
VALUES
('Ania', 'Misiorek'),
('Leroy', 'Shaigorodsky'),
('Ania', 'Misiorek', 'password', '[email protected]'),
('Leroy', 'Shaigorodsky', 'password', '[email protected]');
2 changes: 1 addition & 1 deletion backend/src/models/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ type User struct {
types.Model
FirstName string `gorm:"type:varchar(255);unique" json:"first_name" validate:"required"`
LastName string `gorm:"type:varchar(255);unique" json:"last_name" validate:"required"`
Password string `gorm:"type:text" json:"password" validate:"required"`
Password string `gorm:"type:text" json:"pass_word" validate:"required"`
Email string `gorm:"type:varchar(255);unique" json:"email" validate:"required,email"`
}
1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"@react-navigation/native": "^6.1.9",
"autoprefixer": "^10.4.16",
"axios": "^1.6.4",
"dotenv": "^16.3.1",
"eslint-plugin-typescript": "^0.14.0",
"expo": "~49.0.15",
"expo-status-bar": "~1.6.0",
Expand Down
2 changes: 1 addition & 1 deletion frontend/services/CommonURLS.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const API_LINK = "http://localhost:8080"
export const API_LINK = `https://${process.env.EXPO_PUBLIC_API_DOMAIN}`;
5 changes: 4 additions & 1 deletion frontend/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"extends": "@tsconfig/react-native/tsconfig.json"
"extends": "@tsconfig/react-native/tsconfig.json",
"compilerOptions": {
"types": ["node"]
}
}
5 changes: 5 additions & 0 deletions frontend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3489,6 +3489,11 @@ dotenv-expand@~10.0.0:
resolved "https://registry.yarnpkg.com/dotenv-expand/-/dotenv-expand-10.0.0.tgz#12605d00fb0af6d0a592e6558585784032e4ef37"
integrity sha512-GopVGCpVS1UKH75VKHGuQFqS1Gusej0z4FyQkPdwjil2gNIv+LNsqBlboOzpJFZKVT95GkCyWJbBSdFEFUWI2A==

dotenv@^16.3.1:
version "16.3.1"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.3.1.tgz#369034de7d7e5b120972693352a3bf112172cc3e"
integrity sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==

dotenv@~16.0.3:
version "16.0.3"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.0.3.tgz#115aec42bac5053db3c456db30cc243a5a836a07"
Expand Down
Loading