Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
122 commits
Select commit Hold shift + click to select a range
b7f914e
Merge pull request #97 from NawalC/dev
AltomHussain Nov 25, 2020
ae7b02a
Merge pull request #98 from NawalC/dev
Iman-feisali Dec 8, 2020
2b23dbc
Merge pull request #99 from NawalC/dev
AltomHussain Jan 18, 2021
29f39c6
Replaced all options with the map
AltomHussain Jan 24, 2021
89e53b5
Removed all logs
AltomHussain Jan 24, 2021
ca60ea8
Add initial deploy-staging circleci workflow
petemcfarlane Jan 27, 2021
3d8ec33
renamed editBox coponent to MentorEditLearningObj and cleaned some un…
SULAIMAN-100 Jan 31, 2021
fedcc96
Remaned BtnContainer to ProgressTrackingButtons
AltomHussain Feb 3, 2021
2027646
Added cookieSession Library
AltomHussain Feb 3, 2021
47c0cd0
Added cookie session in the login and register api
AltomHussain Feb 3, 2021
224ea9b
refactoring(removed user from the req and used req.session.user instead)
AltomHussain Feb 3, 2021
a2de4e7
Merge pull request #1 from CodeYourFuture/feature/deploy-staging
petemcfarlane Feb 3, 2021
61d7c25
Merge branch 'dev' into Refactor-AddForm
AltomHussain Feb 3, 2021
03b5d45
Remove all jwt tokens from some files where is not required
AltomHussain Feb 3, 2021
17b0be2
Refactored the MentorEdit component
AltomHussain Feb 3, 2021
c368d0b
Merge pull request #7 from CodeYourFuture/Refactor-mentor-edit
SULAIMAN-100 Feb 7, 2021
f06378e
Merge pull request #4 from CodeYourFuture/Refactor-AddForm
SULAIMAN-100 Feb 7, 2021
b799e3d
resolved the conflects
SULAIMAN-100 Feb 7, 2021
8b42d36
merged remove-jwt-tokens branch into dev
SULAIMAN-100 Feb 7, 2021
2511296
modified logo to be clickable used to back to the default page of the…
SULAIMAN-100 Feb 7, 2021
e4829e3
removed useState and useEffect
SULAIMAN-100 Feb 7, 2021
7126515
added the first stage of github authintication
SULAIMAN-100 Feb 9, 2021
47d713e
altered user table(added github_id)
AltomHussain Feb 11, 2021
19d4071
Added some changes in api.js(create githubAuth endpoint for login)
AltomHussain Feb 11, 2021
7cc62ab
changed the logout flow(removed the logout icon from all files and just
AltomHussain Feb 11, 2021
6fb0698
updated the mentorsView page(extracted the useQuery into reusable file
AltomHussain Feb 11, 2021
b188809
updated the logingForm.js(removed the emial and password fields from the
AltomHussain Feb 11, 2021
46e0f45
Displayed the user name in the front-end from the DB instead of the
AltomHussain Feb 13, 2021
358433f
got the username form the db instead of the localstorage
AltomHussain Feb 13, 2021
b7e7ee7
used the file for testing
AltomHussain Feb 13, 2021
e4ff670
Removed the login form and its functionality and only left a button …
AltomHussain Feb 13, 2021
b151f91
Replaced password with the gitId
AltomHussain Feb 13, 2021
0aeca0d
Removed password validation
AltomHussain Feb 13, 2021
da1ecf2
Added axios package
AltomHussain Feb 13, 2021
a3bf6fa
Replaced password with github_id and removed the login endpoint
AltomHussain Feb 13, 2021
80621c4
Removed unused code
AltomHussain Feb 13, 2021
894bd60
added and removed log
AltomHussain Feb 13, 2021
c9cfdec
Created the reuable component for uselocation
AltomHussain Feb 13, 2021
94a10a3
Styled the Btn in the login form
AltomHussain Feb 14, 2021
b342b3d
added css for the login btn
AltomHussain Feb 14, 2021
86d4b81
removed commented code
AltomHussain Feb 14, 2021
d4e4f7b
fixed logo link path
SULAIMAN-100 Feb 16, 2021
9c97f8a
added bootstrap navbar
SULAIMAN-100 Feb 17, 2021
c9f1e7e
final version of the logo
SULAIMAN-100 Feb 17, 2021
2418c13
Merge pull request #8 from CodeYourFuture/clickable-logo
AltomHussain Feb 17, 2021
41cf124
got the the user name from the verify end-point and deisplayed on the…
AltomHussain Feb 18, 2021
a46ad5d
Removed the the usage of the localstorage
AltomHussain Feb 18, 2021
414976c
Made the useState initiacl val to null so the data will be fetched co…
AltomHussain Feb 18, 2021
9273959
Removed the functionality of clearing the localStorage
AltomHussain Feb 18, 2021
2853aa2
Removed the usage of localstorage
AltomHussain Feb 18, 2021
a1fa19f
Removed the usage of the localStorage
AltomHussain Feb 18, 2021
ae4121f
Removed the usage of the localStorage
AltomHussain Feb 18, 2021
150b085
Removed the userid from the learningobjectives endpoint
AltomHussain Feb 18, 2021
541cae4
Adjusted the cdn
AltomHussain Feb 18, 2021
08ade93
added bootstrap navbar
SULAIMAN-100 Feb 18, 2021
91b558a
removed button and removed spaces
Feb 20, 2021
36d2fc8
checked bootstrap version - discussion needed
Feb 20, 2021
6728f57
Merge branch 'dev' into bootstrap-navbar
AltomHussain Feb 20, 2021
077a91a
Merge pull request #10 from CodeYourFuture/bootstrap-navbar
AltomHussain Feb 20, 2021
0a8be91
created select options for city and class in progress
Feb 20, 2021
a24b785
we changed the initial state of the user name from null to empty object
Iman-feisali Feb 21, 2021
5d08309
created city object and looped them
Feb 21, 2021
5d08269
Removed the usage of jwt from the server side
AltomHussain Feb 21, 2021
cb39be7
fixed conflects
AltomHussain Feb 21, 2021
182e021
updated based on the feedback
AltomHussain Feb 22, 2021
c3f393f
added styling to select fields
Feb 22, 2021
06ca1c4
completed if block and added all the locations
Feb 23, 2021
7c3c1bc
Merge pull request #11 from CodeYourFuture/signup-dropdown
AltomHussain Feb 23, 2021
4949aeb
setup github locally
Feb 23, 2021
04eec12
merged github-signUp to dev
Feb 23, 2021
afefaa9
got update and merged again
Feb 23, 2021
12c5211
resolved conflicts
Feb 23, 2021
1b0fb57
resolved more conflicts
Feb 23, 2021
47d51b6
Merge pull request #12 from CodeYourFuture/signup-dropdown
AltomHussain Feb 23, 2021
ef10e93
added axios to dependencies
Feb 24, 2021
4054f5b
fixing current deployment issues
Feb 24, 2021
ac00981
fixing deployment
Feb 24, 2021
9ea0b76
created a callback to fetch client id
Feb 24, 2021
0d52f66
Merge branch 'master' of https://github.com/CodeYourFuture/knowledge-…
SULAIMAN-100 Mar 1, 2021
a2c10b9
created deselect endpoint
SULAIMAN-100 Mar 1, 2021
6625e7a
added deselect function
SULAIMAN-100 Mar 1, 2021
40aab02
modified CSS
SULAIMAN-100 Mar 1, 2021
5358965
created deselect function to update ability
SULAIMAN-100 Mar 1, 2021
8715d6e
created dir for learning obj data
Mar 2, 2021
bb6807f
created db tables using node js
Mar 2, 2021
d0f41d9
created pg query using db config
Mar 2, 2021
990d1a6
added highlight student feature
SULAIMAN-100 Mar 3, 2021
e0af7f9
fixed deselect logic
SULAIMAN-100 Mar 3, 2021
ed6a8f1
fixed deselect logic2
SULAIMAN-100 Mar 3, 2021
380378f
modified css
SULAIMAN-100 Mar 3, 2021
5f3d82d
added git React-client-github-id
AltomHussain Mar 3, 2021
1f14781
Cleared all logs and sorted the security of the mentorEditLearningObj…
AltomHussain Mar 3, 2021
aa3669d
added db migration scripts to staging
Mar 6, 2021
91beb4b
added db migration scripts for production
Mar 6, 2021
0dd1fb9
Deleted the deselect endpoint and amended set ability using Pete's su…
AltomHussain Mar 6, 2021
3161888
Merge pull request #15 from CodeYourFuture/secure-learningOb-page
NawalC Mar 6, 2021
4cf8717
Merge pull request #13 from CodeYourFuture/deselect-btns
NawalC Mar 7, 2021
c67d9a3
Merge pull request #14 from CodeYourFuture/highlight-student
NawalC Mar 7, 2021
49f25cc
corrected spelling error of user_github
Mar 7, 2021
521dcfe
added column cyf_city
Mar 7, 2021
4937070
corrected spelling errors
Mar 8, 2021
3c45a63
new migration script to add a new column and rename column
Mar 8, 2021
f87fa66
fixed error msg by added a return in /gitAuth
Mar 8, 2021
e58629e
Merge pull request #16 from CodeYourFuture/db-migrate
AltomHussain Mar 8, 2021
50240b7
identified ununderstandable issue
AltomHussain Mar 8, 2021
8a5b503
edited github ud variable to fix staging link
Mar 8, 2021
5b66c16
Merge pull request #17 from CodeYourFuture/db-migrate
AltomHussain Mar 8, 2021
792b2ff
still trying to fix staging link id undefined
Mar 8, 2021
8ad0ef9
Merge pull request #18 from CodeYourFuture/db-migrate
AltomHussain Mar 8, 2021
528d275
added learning objectives from cyf syllabus
Mar 10, 2021
0b495c8
Merge branch 'dev' of https://github.com/CodeYourFuture/knowledge-che…
AltomHussain Mar 14, 2021
04b51c8
Updated the ReadME.md file
AltomHussain Mar 14, 2021
02d347e
added learning objectives inline with syllabus
Mar 14, 2021
c99b610
delete the id from
AltomHussain Mar 18, 2021
2be06c2
Merge pull request #19 from CodeYourFuture/addlearningobjective
AltomHussain Mar 18, 2021
2060098
Merge branch 'dev' of https://github.com/CodeYourFuture/knowledge-che…
AltomHussain Mar 18, 2021
f2e22bb
Modified the desect
AltomHussain Mar 18, 2021
d0e0a0e
Merge pull request #21 from CodeYourFuture/deselect-btns
AltomHussain Mar 18, 2021
7615458
Merge branch 'dev' of https://github.com/CodeYourFuture/knowledge-che…
AltomHussain Mar 18, 2021
a4eec29
Merge pull request #20 from CodeYourFuture/update-doc-md
SULAIMAN-100 Mar 18, 2021
c1423b2
Merge branch 'dev' of https://github.com/CodeYourFuture/knowledge-che…
AltomHussain Mar 18, 2021
cc5687e
Resolved conflicts
AltomHussain Mar 18, 2021
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
90 changes: 90 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
version: 2
jobs:
build:
docker:
- image: circleci/node:12.18.3
steps:
- checkout
- setup_remote_docker
- run:
name: Set env variables
command: echo 'export VERSION=$(echo $CIRCLE_SHA1 | cut -c -7)' >> $BASH_ENV
- run:
name: Docker build knowledge-checklist
command: |
docker build -t codeyourfuture/knowledge-checklist:$VERSION --build-arg version=$VERSION .
docker tag codeyourfuture/knowledge-checklist:$VERSION codeyourfuture/knowledge-checklist:latest
- run:
name: Docker login
command: echo "$DOCKER_PASS" | docker login -u $DOCKER_USER --password-stdin
- run:
name: Docker push frontend
command: docker push codeyourfuture/knowledge-checklist

db-build:
docker:
- image: circleci/node:12.18.3
steps:
- checkout
- run:
name: install packages
command: npm ci
- run:
name: deploy db
command: npm run db-migrate-production
- run:
name: load learning objectives
command: npm run db-loadfixtures-production

deploy_production:
docker:
- image: circleci/python:2.7-jessie
working_directory: ~/repo
steps:
- setup_remote_docker
- run:
name: Set env variables
command: echo 'export VERSION=$(echo $CIRCLE_SHA1 | cut -c -7)' >> $BASH_ENV
- run:
name: Install awscli
command: sudo pip install awscli
- run:
name: Install kubectl
command: |
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
chmod +x kubectl
- run:
name: Install gnupg
command: sudo apt-get -y install gnupg
- run:
name: Get kubeconfig
command: aws s3 cp s3://$SECRETS_BUCKET/kubectl/config_cyfbot.gpg ./config.gpg
- run:
name: Decrypt kubeconfig and set KUBECONFIG
command: gpg --yes --passphrase="$GPG_KEY" config.gpg
- run:
name: Update k8s deployments
command: |
KUBECONFIG=$(pwd)/config ./kubectl set image deployment/knowledge-checklist-dep knowledge-checklist=codeyourfuture/knowledge-checklist:$VERSION
workflows:
version: 2
build-deploy:
jobs:
- build:
context: build
- deploy_production:
context: deployments
requires:
- build
filters:
branches:
only:
- master
- db-build:
context: deployments
requires:
- build
filters:
branches:
only:
- master
10 changes: 8 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
jwtSecret=

db_user=
db_password=
db_port=
db_port=
cookieSessionKey=

## to get these variables you need to create github app:
github_client_id=
github_client_secret=

1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ RUN npm ci
COPY ./.babelrc .
COPY ./client /client
COPY ./server /server
RUN touch .env

RUN npm run build

Expand Down
41 changes: 29 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,41 @@

- clone repo
- npm install
- setup your local Postgres SQL database and create a database with database.sql file found in server folder
- connect the server with local db
- change config of db according to your database( please note: port in project should match your db)
- copy example from .env.example to .env file and fill in values eg: jwtSecret=password
- setup your local Postgres SQL database
-to create tables use these db-migration commands:
-create github app to login to the knowledge-checklist
-create `.env` file and use `.env.example` for reference of configuration

### Local db:

1-for tables use =>`npm run db-migrate`,
2-to add learning objectives use => `npm run db-loadfixtures`
-In order to connect the server with local db, add configuration from `.env.example` to `.env` file

## Entry points in the app to get started adding features:

- Client folder ---> src contains all the front-end code.
- Server Folder contains all the back-end code.

## Design considerations or Trade offs
# Design considerations or Trade offs

- To keep with Code Your Futures brand colours
- Frontend:-
- React Hooks - list available in package json
- Backend:-
- bcrypt : js hashing generator
- jsonwebtoken : used for authoration and verification
- cookiesesseion : used for authorisation and verification
- nodejs express : Works well with postgre sql
- Postgres SQL: open source relational database

## Features or things to add/change/remove in the future
# Features or things to add/change/remove in the future

- Replace local storage with cookies
- Add a GitHub or a different 0auth2 to register or login
- Add a registration policy for mentors (to be be clarified)
- Add a simple user profile with account settings
- Mentors view - Add a class overview of skills
- Add Mongodb and its learning objectives
- Graphical representation of modules covered for each student

## Scripts
# Scripts

Various scripts are provided in the package file, but many are helpers for other scripts; here are the ones you'll
commonly use:
Expand All @@ -41,7 +46,19 @@ commonly use:
- `lint`: runs ESLint against all the JavaScript in the project.
- `serve`: builds and starts the app in production mode locally.

### Debugging
## Scripts for db staging and production

### Heroku(staging) db:

- `heroku login`: to Login to Heroku db from any terminal
- `npm run db-migrate-staging`: to add tables
- `npm run db-loadfixtures-staging`: to add learning objectives

### Production db:

-For the production there is config file called `config.yml` this will update the db automatically once you push to master branch.

# Debugging

While running the dev mode using `npm run dev`, you can attach the Node debugger to the server process via port 9229.
If you're using VS Code, a debugging configuration is provided for this.
Expand Down
Loading