Skip to content

Commit

Permalink
Merge branch 'main' into feat/218/add-project-endpoints
Browse files Browse the repository at this point in the history
Signed-off-by: AmirAgassi <[email protected]>
  • Loading branch information
AmirAgassi authored Dec 27, 2024
2 parents 0e26ca6 + f4623d1 commit 94060b0
Show file tree
Hide file tree
Showing 14 changed files with 1,194 additions and 89 deletions.
135 changes: 135 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
<h1 align="center">
<a href="https://onboard.spuric.com/">
<picture>
<source height="175" media="(prefers-color-scheme: dark)" srcset="https://github.com/KonferCA/Konfer/blob/main/src/assets/partners/spur-brand.svg">
<img height="175" alt="SPUR" src="https://github.com/KonferCA/Konfer/blob/main/src/assets/partners/spur-brand.svg">
</picture>
</a>
<br>

![Website](https://img.shields.io/website?url=https%3A%2F%2Fonboard.spuric.com%2F&style=flat-square) ![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/KonferCA/SPUR?filename=%2Fbackend%2Fgo.mod&style=flat-square) ![GitHub Issues or Pull Requests](https://img.shields.io/github/issues/KonferCA/SPUR?style=flat-square) ![GitHub Issues or Pull Requests](https://img.shields.io/github/issues-pr/KonferCA/SPUR?style=flat-square)
</h1>
<p align="center">
<em> <b>SPUR</b> needs a streamlined digital platform to manage startup on-boarding, review, and funding processes. The current system relies on fragmented communication channels, creating inefficiencies for both SPUR administrators and startup applicants. </em>
</p>

---

## ⚡ Quickstart
>[!NOTE]
> This is the monorepo containing the backend and frontend code for the webapp, as well as code related to the Web3 infrastructure
> Clone the repo
```console
git clone https://github.com/KonferCA/SPUR.git
```

> From your terminal, navigate to the root path of your clone
```console
cd path/to/your/clone
```

## ⚙️ Installation [Backend]

SPUR backend requires **Go version `1.23` or higher** for best compatibility. If you need to install or upgrade Go, visit the [official Go download page](https://go.dev/dl/).

### Getting Started

> From your terminal, navigate to the backend path of your clone
```console
cd path/to/your/clone/backend
```

#### 🔨 Install prerequisite tools

> Air (auto-reload backend)
```console
go install github.com/air-verse/[email protected]
```

> SQLc (generate type-safe code from SQL queries)
```console
go install github.com/sqlc-dev/sqlc/cmd/[email protected]
```

> Goose (SQL migration management tool)
```console
go install github.com/pressly/goose/v3/cmd/[email protected]
```

#### 🍺 Homebrew quick start
> Make
```console
brew install make
```

> Docker
```console
brew install docker
```

> [!IMPORTANT]
> Make commands only work on unix like systems.
#### 🏗️ Setup development environment

> Create a new PostgreSQL instance using Docker
```console
make init-dev-db
```

> Start PostgreSQL for development
```console
make start-dev-db
```
> Check health of DB
```console
make health-dev-db
```

> Run migrations when ready
```console
make up
```

> Start development server
```console
make dev
```

> [!NOTE]
> Use `make query "SELECT ... FROM ..."` for quick query on the terminal.
> You should also checkout the other available commands in the Makefile.
---

## ⚙️ Installation [Frontend]

SPUR frontend requires **Node version `22.9.0` or higher** for best compatibility. If you need to install or upgrade Node, visit the [official Node download page](https://nodejs.org/en/download/).

### Getting Started

> From your terminal, navigate to the backend path of your clone
```console
cd path/to/your/clone/frontend
```

#### 🔨 Install prerequisite tools

> Install pnpm using npm
```console
npm install -g pnpm
```

#### 🏗️ Setup development environment

> Install dependencies
```console
pnpm i
```

> Run local server
```console
pnpm dev
```
2 changes: 2 additions & 0 deletions backend/.sqlc/queries/company.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- name: GetCompany :one
SELECT * FROM companies WHERE id = $1 LIMIT 1;
34 changes: 34 additions & 0 deletions backend/.sqlc/queries/team_members.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
-- name: CreateTeamMember :one
INSERT INTO team_members (
company_id, first_name, last_name,
title, bio, linkedin_url, is_account_owner
) VALUES (
$1, $2, $3, $4, $5, $6, $7
)
RETURNING *;

-- name: ListTeamMembers :many
SELECT * FROM team_members
WHERE company_id = $1
ORDER BY created_at DESC;

-- name: GetTeamMember :one
SELECT * FROM team_members
WHERE id = $1 AND company_id = $2
LIMIT 1;

-- name: UpdateTeamMember :one
UPDATE team_members
SET
first_name = COALESCE(NULLIF(@first_name::text, ''), first_name),
last_name = COALESCE(NULLIF(@last_name::text, ''), last_name),
title = COALESCE(NULLIF(@title::text, ''), title),
bio = COALESCE(NULLIF(@bio::text, ''), bio),
linkedin_url = COALESCE(NULLIF(@linkedin_url::text, ''), linkedin_url),
updated_at = extract(epoch from now())
WHERE id = @id AND company_id = @company_id
RETURNING *;

-- name: DeleteTeamMember :exec
DELETE FROM team_members
WHERE id = $1 AND company_id = $2;
29 changes: 0 additions & 29 deletions backend/README.md

This file was deleted.

29 changes: 29 additions & 0 deletions backend/db/company.sql.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 94060b0

Please sign in to comment.