Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
e9dba82
Merge pull request #1 from DavDeDev/fix/gitignore
tqmsh Sep 14, 2024
c6c864d
Merge pull request #3 from DavDeDev/ci/adds-linting
tqmsh Sep 14, 2024
005d3e3
feat: completes Convex integration
DavDeDev Sep 14, 2024
157461c
feat: replaces Defang template with Convex
DavDeDev Sep 14, 2024
b6a431b
ci: adds timeout
DavDeDev Sep 14, 2024
0db7807
fix: ci runs twice
DavDeDev Sep 14, 2024
2671c02
docs: adds .env template
DavDeDev Sep 14, 2024
2f59d1a
Merge pull request #2 from DavDeDev/feature/init-convex
saike148 Sep 14, 2024
ab8ebaa
ci: increase timeout limit
DavDeDev Sep 14, 2024
8b8a630
fix: ci runs twice
DavDeDev Sep 14, 2024
1051a20
Merge pull request #4 from DavDeDev/feature/init-convex
DavDeDev Sep 14, 2024
6ad526e
fix(ci): adds envs
DavDeDev Sep 14, 2024
6901ead
Merge pull request #5 from DavDeDev/fix/deployment
DavDeDev Sep 14, 2024
042ece6
fix(ci): adds envs
DavDeDev Sep 14, 2024
da4aaa4
Merge pull request #6 from DavDeDev/fix/deployment
DavDeDev Sep 14, 2024
1a2f82c
Read me update
tqmsh Sep 14, 2024
6ec7a08
feat: change wordings
DavDeDev Sep 14, 2024
e59bfc8
feat: adds HTN colors
DavDeDev Sep 14, 2024
9a9e7e7
Merge pull request #8 from DavDeDev/feat/landing-page
DavDeDev Sep 14, 2024
74e0784
Feature/read me
tqmsh Sep 14, 2024
6b825d8
Merge pull request #7 from DavDeDev/Feature/ReadMeUpdate
DavDeDev Sep 14, 2024
576e594
feat: adds survery
DavDeDev Sep 14, 2024
bf3c518
test: defang
DavDeDev Sep 14, 2024
890654b
Merge pull request #10 from DavDeDev/test/defang
DavDeDev Sep 14, 2024
acdd507
fix: read me
tqmsh Sep 14, 2024
f300a35
Merge pull request #11 from DavDeDev/feature/read-me-edits
tqmsh Sep 14, 2024
9eb14c2
Update README.md
tqmsh Sep 14, 2024
3f43c0f
Added the AI aspect for team formation
Sep 14, 2024
eafd961
feat: adds survey form
DavDeDev Sep 14, 2024
309db54
feat: make multistep form
DavDeDev Sep 15, 2024
5fb10dd
feat: complete forms
DavDeDev Sep 15, 2024
16cde8f
feat: improves style form
DavDeDev Sep 15, 2024
046dc6d
fix: profile form
tqmsh Sep 15, 2024
8322657
Merge pull request #12 from DavDeDev/feature/hacker-route
DavDeDev Sep 15, 2024
2f6a38e
I got lazy
tqmsh Sep 15, 2024
a8d66e6
Merge pull request #13 from DavDeDev/feature/matching-&-fixes-for-form
DavDeDev Sep 15, 2024
ce05552
fix: removes useless files
DavDeDev Sep 15, 2024
d9ce141
feat: save response to db
DavDeDev Sep 15, 2024
b18dcd0
Merge pull request #14 from DavDeDev/feature/matching-page
DavDeDev Sep 15, 2024
ccec6e8
Fixed home page words
hamzakhamissa Sep 15, 2024
7dced6c
Merge pull request #15 from DavDeDev/mlghammit-patch-1
tqmsh Sep 15, 2024
0e8c4bb
Update README.md
hamzakhamissa Sep 15, 2024
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
3 changes: 0 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ name: CI Pipeline

# Controls when the workflow will run
on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
jobs:
deploy:
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
id-token: write
Expand All @@ -17,4 +18,9 @@ jobs:
uses: actions/checkout@v4

- name: Deploy
uses: DefangLabs/defang-github-action@v1.1.0
uses: DefangLabs/defang-github-action@v1.1.0
with:
config-env-vars: "NEXT_PUBLIC_CONVEX_URL"

env:
NEXT_PUBLIC_CONVEX_URL: ${{ secrets.NEXT_PUBLIC_CONVEX_URL }}
69 changes: 58 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,69 @@
# Next.js & GitHub Actions

# Hackd

Get the best person for your, HACKATHON, JOB or any issue you might have with HACKD

Developed during Hack The North 2024

For more information about this project contact the owner

[![1-click-deploy](https://defang.io/deploy-with-defang.png)](https://portal.defang.dev/redirect?url=https%3A%2F%2Fgithub.com%2Fnew%3Ftemplate_name%3Dsample-nextjs-github-actions-template%26template_owner%3DDefangSamples)

A basic Next.js app with a Dockerfile and docker-compose ready to deploy to AWS with [Defang](https://defang.io) with GitHub Actions configured for CI/CD.

## Steps
## Steps to Set Up

1. **Install Defang**
Run the following command to install Defang:
```
brew install DefangLabs/defang/defang
```

2. **Authenticate with Defang**
After installation, authenticate by running:
```
defang login
```

Follow the on-screen instructions and open the provided URL to complete authentication.

3. **Optional: Authenticate with AWS**
To authenticate with AWS, follow [this guide](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html).

4. **Set Up Environment Variables**
Copy the `.env.local.template` file and rename it to `.env.local`. Then fill the environment variables with the required values.

5. **Set up Authentication**
To setup Convex authentication, follow the steps in [this tutorial](https://labs.convex.dev/auth/config/oauth)
From this, you would get the necessary variables to fill up what is needed as indicated in the .env template.

1. [Install Defang](https://docs.defang.io/docs/getting-started/installing)
2. [Authenticate with Defang](https://docs.defang.io/docs/getting-started/authenticating)
3. (optional) [Authenticate with AWS](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html)
4. Run `defang compose up` in the root of this project
5. **Navigate to the Web Directory**
To ensure you're in the right project directory where the Next.js app is located, move to the `web` folder by running the command:
```
cd web
```
This step is important as it ensures you're in the correct location to install project dependencies in the next step.

---

Title: Next.js & GitHub Actions
6. **Install Dependencies**
Install all required dependencies by running:
```
npm install
npm install @radix-ui/react-label
```

Short Description: A basic Next.js app with a Dockerfile and docker-compose ready to deploy to AWS with Defang, with GitHub Actions configured for CI/CD.
7. **Run the Application**
Before doing npm run dev, you show make sure that the email your github is associated with, has been added as an Admin in the convex Member tab.
Start the application by navigating to the project root and running:
```
npm run dev
```
Select choose an existing project, pick the right team, pick yes when it comes to the right project, and you are good.

Tags: Next.js, React, Docker, GitHub Actions, Node.js, TypeScript, JavaScript
If there are issues with missing configurations, ensure the `.env.local` file is set correctly and run `defang config` to manage sensitive configs.

Languages: nodejs
8. **Defang Docker Compose Up**
Run the following command to start the Docker container:
```
defang compose up
```
2,291 changes: 2,291 additions & 0 deletions ai/recommendations.csv

Large diffs are not rendered by default.

237 changes: 237 additions & 0 deletions ai/sentiment_analysis.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,237 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"import cohere\n",
"df = pd.read_csv('/Users/saikrishna/Downloads/GetGitData/datab.csv')"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
"language_columns = [col for col in df.columns if '%' in col]\n",
"df['Skills'] = df.apply(lambda row: {lang.replace('%', ''): row[lang] for lang in language_columns if row[lang] > 0}, axis=1)"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
"def generate_summary(row):\n",
" skills = row['Skills']\n",
" sorted_skills = sorted(skills.items(), key=lambda x: x[1], reverse=True)\n",
" skill_descriptions = [f\"{skill} ({percentage}%)\" for skill, percentage in sorted_skills]\n",
" return f\"User {row['Username']} is proficient in {', '.join(skill_descriptions)}.\"\n",
"df['SkillSummary'] = df.apply(generate_summary, axis=1)\n"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" Username CreatedAt \\\n",
"0 savolai 2011-06-11T18:04:13Z \n",
"1 jantatje 2014-04-21T09:39:45Z \n",
"2 dharnnie 2016-11-29T10:15:26Z \n",
"3 zengsn 2011-02-20T05:48:40Z \n",
"4 shriroopjoshi 2013-08-11T11:06:26Z \n",
".. ... ... \n",
"642 sonicning 2013-12-19T05:00:12Z \n",
"643 shubhamsingh5 2016-09-19T21:11:32Z \n",
"644 GramGibson 2010-06-29T20:22:11Z \n",
"645 minecrawler 2011-10-15T23:34:28Z \n",
"646 elementalvoid 2009-11-20T23:03:24Z \n",
"\n",
" AvatarUrl Id Contributions \\\n",
"0 https://avatars.githubusercontent.com/u/844183... 1 90 \n",
"1 https://avatars.githubusercontent.com/u/736027... 1 8 \n",
"2 https://avatars.githubusercontent.com/u/242459... 2 0 \n",
"3 https://avatars.githubusercontent.com/u/627946... 1 659 \n",
"4 https://avatars.githubusercontent.com/u/520712... 1 1 \n",
".. ... .. ... \n",
"642 https://avatars.githubusercontent.com/u/622012... 2 0 \n",
"643 https://avatars.githubusercontent.com/u/223063... 1 0 \n",
"644 https://avatars.githubusercontent.com/u/317921... 1 307 \n",
"645 https://avatars.githubusercontent.com/u/113070... 2 137 \n",
"646 https://avatars.githubusercontent.com/u/156165... 2 774 \n",
"\n",
" JavaScript %JavaScript Python %Python Java ... Pascal %Pascal \\\n",
"0 62447 10.79 0 0.00 0 ... 0 0.0 \n",
"1 158 0.00 0 0.00 0 ... 0 0.0 \n",
"2 32780 3.25 0 0.00 24560 ... 0 0.0 \n",
"3 0 0.00 6140 2.96 0 ... 0 0.0 \n",
"4 11940 5.09 0 0.00 208960 ... 0 0.0 \n",
".. ... ... ... ... ... ... ... ... \n",
"642 0 0.00 0 0.00 384928 ... 0 0.0 \n",
"643 39170 2.69 0 0.00 82388 ... 0 0.0 \n",
"644 0 0.00 0 0.00 0 ... 0 0.0 \n",
"645 5844 2.45 0 0.00 0 ... 0 0.0 \n",
"646 0 0.00 2396 1.13 0 ... 0 0.0 \n",
"\n",
" Racket %Racket Zig %Zig Other %Other \\\n",
"0 0 0.0 0 0.0 386449 66.74 \n",
"1 0 0.0 0 0.0 72613 0.77 \n",
"2 0 0.0 0 0.0 0 0.00 \n",
"3 0 0.0 0 0.0 1159 0.56 \n",
"4 0 0.0 0 0.0 274 0.12 \n",
".. ... ... ... ... ... ... \n",
"642 0 0.0 0 0.0 0 0.00 \n",
"643 0 0.0 0 0.0 269360 18.51 \n",
"644 0 0.0 0 0.0 0 0.00 \n",
"645 0 0.0 0 0.0 10881 4.56 \n",
"646 0 0.0 0 0.0 55088 26.04 \n",
"\n",
" Skills \\\n",
"0 {'JavaScript': 10.79, 'PHP': 0.19, 'C++': 17.5... \n",
"1 {'PHP': 0.07, 'C': 4.1, 'Shell': 95.05, 'HTML'... \n",
"2 {'JavaScript': 3.25, 'Java': 2.44, 'Go': 6.99,... \n",
"3 {'Python': 2.96, 'C': 2.52, 'Objective-C': 1.0... \n",
"4 {'JavaScript': 5.09, 'Java': 89.05, 'Shell': 0... \n",
".. ... \n",
"642 {'Java': 100.0} \n",
"643 {'JavaScript': 2.69, 'Java': 5.66, 'C++': 4.28... \n",
"644 {'C#': 100.0} \n",
"645 {'JavaScript': 2.45, 'TypeScript': 91.7, 'Rust... \n",
"646 {'Python': 1.13, 'Ruby': 0.61, 'Go': 5.07, 'Sh... \n",
"\n",
" SkillSummary \n",
"0 User savolai is proficient in Other (66.74%), ... \n",
"1 User jantatje is proficient in Shell (95.05%),... \n",
"2 User dharnnie is proficient in HTML (55.04%), ... \n",
"3 User zengsn is proficient in MATLAB (92.9%), P... \n",
"4 User shriroopjoshi is proficient in Java (89.0... \n",
".. ... \n",
"642 User sonicning is proficient in Java (100.0%). \n",
"643 User shubhamsingh5 is proficient in C (62.53%)... \n",
"644 User GramGibson is proficient in C# (100.0%). \n",
"645 User minecrawler is proficient in TypeScript (... \n",
"646 User elementalvoid is proficient in Shell (67.... \n",
"\n",
"[647 rows x 63 columns]\n"
]
}
],
"source": [
"print(df)"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [],
"source": [
"import cohere\n",
"co = cohere.Client('eEnhJhgFPTaGPmZiFzIwWVmZSHADwdPDlLECeZDe')\n"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [],
"source": [
"def identify_weakness(summary):\n",
" prompt = f\"{summary}\\n\\nIdentify the user's weaknesses and areas for improvement.\"\n",
" response = co.generate(model='command', prompt=prompt, max_tokens=50)\n",
" return response.generations[0].text.strip()\n",
"df['Weaknesses'] = df['SkillSummary'].apply(identify_weakness)"
]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {},
"outputs": [],
"source": [
"embeddings = co.embed(texts=df['SkillSummary'].tolist(), model='large').embeddings\n",
"df['Embeddings'] = embeddings"
]
},
{
"cell_type": "code",
"execution_count": 23,
"metadata": {},
"outputs": [],
"source": [
"from sklearn.metrics.pairwise import cosine_similarity\n",
"import numpy as np\n",
"\n",
"similarity_matrix = cosine_similarity(embeddings)\n"
]
},
{
"cell_type": "code",
"execution_count": 24,
"metadata": {},
"outputs": [],
"source": [
"def find_complementary_users(user_index):\n",
" user_similarities = similarity_matrix[user_index]\n",
" complementary_indices = np.argsort(user_similarities)\n",
" # Exclude the user themselves\n",
" complementary_indices = complementary_indices[complementary_indices != user_index]\n",
" return df.iloc[complementary_indices[:5]]['Username'].tolist()\n",
"df['ComplementaryUsers'] = df.index.map(find_complementary_users)"
]
},
{
"cell_type": "code",
"execution_count": 25,
"metadata": {},
"outputs": [],
"source": [
"def generate_recommendation(row):\n",
" recommendation = f\"User {row['Username']} could improve in {row['Weaknesses']}.\\n\"\n",
" recommendation += f\"Potential teammates to complement their skills: {', '.join(row['ComplementaryUsers'])}.\"\n",
" return recommendation\n",
"df['Recommendation'] = df.apply(generate_recommendation, axis=1)\n"
]
},
{
"cell_type": "code",
"execution_count": 26,
"metadata": {},
"outputs": [],
"source": [
"df[['Username', 'Recommendation']].to_csv('recommendations.csv', index=False)\n"
]
}
],
"metadata": {
"kernelspec": {
"display_name": ".venv",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.6"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
4 changes: 4 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ services:
build:
context: ./web
dockerfile: Dockerfile
args:
NEXT_PUBLIC_CONVEX_URL: https://rare-perch-160.convex.cloud
ports:
- target: 3000
mode: ingress
environment:
NEXT_PUBLIC_CONVEX_URL:
deploy:
resources:
reservations:
Expand Down
2 changes: 1 addition & 1 deletion web/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
node_modules
node_modules
.next
6 changes: 6 additions & 0 deletions web/.env.local.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Deployment used by `npx convex dev`
CONVEX_DEPLOYMENT=dev:0 # team: david-b3929, project: hackd

NEXT_PUBLIC_CONVEX_URL=https://

SETUP_SCRIPT_RAN=1
4 changes: 4 additions & 0 deletions web/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# dependencies
/node_modules
/.pnp
/.pnpm-store
.pnp.js
.yarn/install-state.gz

Expand Down Expand Up @@ -34,3 +35,6 @@ yarn-error.log*
# typescript
*.tsbuildinfo
next-env.d.ts

# Ignored for the template, you probably want to remove it:
package-lock.json
1 change: 1 addition & 0 deletions web/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
Loading