SkillZ is an application for managing the skills and competences of Zenika's different collaborators. It aims at gathering the feedbacks in order to match the different profiles with missions or trainings that correspond the best. Actually there is 3 diferents applications all functional, and linked to each other :
- Skillz web app
- Skillz Slack bot
- Skillz analytics this version is available for DT to analyze Skillz datas
In this repository, you can access to Skillz web app and Skillz Slack bot scripts.
If you have any questions about the diferents projects, don't hesitate to open issues on this repository, or ask your questions on the channel #project-skillz in the Zenika's Slack.
A progressive web app to store your proficiency and desire to learn different skills.
- Node 16.13.1
- Npm 8.1.2
- Docker
You will need Docker installed on your machine.
Install dependencies using npm install
at the root of the project.
Create an file named .env
, then add these variables :
# If you're using Linux, your local (or distant) hasura endpoint url should looks like this :
NEXT_PUBLIC_GRAPHQL_URL=http://localhost:8080/v1/graphql
NEXT_PUBLIC_BASE_URL=http://localhost:3000
NEXT_API_BEARER_TOKEN=Bearer key
## HASURA
SKILLZ_GRAPHQL_JWT_SECRET={"type": "RS512", "key": "{your-certificate}"}
HASURA_ACHIEVEMENTS_ENDPOINT=http://172.17.0.1:3000/api/achievement
HASURA_ADMIN_SECRET=key
## AUTH0
NEXT_PUBLIC_AUTH0_CONNECTION=google-oauth2
NEXT_PUBLIC_AUTH0_DOMAIN=
NEXT_PUBLIC_AUTH0_CLIENT_ID=
NEXT_PUBLIC_AUTH0_AUDIENCE=
NEXT_PUBLIC_AUTH0_CALLBACK=/auth
Start by running docker compose up -d
to launch the postgres database and the hasura graphql-engine.
Check that engine is running by going to http://localhost:8080
(do not modify schemas through this URL).
In order to initialize / update the database run :
# npm run hasura migrate apply # Sets up the schema
# npm run hasura metadata apply # Sets up GraphQL
# npm run hasura seed apply # Optional : seeds/cleans up the database with referential data
Connect to the Hasura console by running npm run hasura console
(it should open the console in your browser with the
correct port (to keep track of schema changes in the hasura/migrations folder)).
For hasura to generate the migration files properly the hasura console must be run apart from the "in-app" hasura engine and console.
# npm install --global hasura-cli # Installs the hasura console globally
# cd ./hasura # Go into the hasura folder to reuse the config.yaml
# hasura console # Runs the "other" hasura console on a different port
Run the dev server using npm run dev
.
The application should be available at the URL specified in your .env file under NEXT_PUBLIC_BASE_URL
.
If you want to generate random seed data, you can use the hasura console to export the Skill table to JSON
Then move it to hasura/local_seeds/Skill.json
You can now run npm run seeds:generate
And npm run seeds:apply
to apply the random data to the database
Create a file named .env.test
, with the same content as the .env.
Replace the value of the variable NEXT_PUBLIC_AUTH0_CONNECTION
with Username-Password-Authentication
Create a file named cypress.env.json
at the root of the project with the following content :
{
"test_username": "",
"test_password": ""
}
In order to run all tests :
# start the webapp
npm run build:e2e
npm run start:e2e
## or
NODE_ENV=test npm run dev
# start cypress tests
npm run cypress:run
## or with ui
npm run cypress:open
Before running cypress tests, all data from the test user should be deleted.
See all rules in doc/rg.md
. You can find the part of the code corresponding to each rule in the comments of the code.
Slack bot for Skillz App - Keep updated about the new releases of the app, and your activity. The bot's scripts are
placed in the folder ./bot-slack/
.
This bot in only available in the Slack Zenika workspace.
The usage of the bot is only available on the Zenika's Slack. So, click on your channels settings in side bar, the on " Apps" such as the screenshot below :
Then, search "Skillz-bot" on the search bar. It will purpose you the bot. Just click on it to install it to your workspace.
It's done ! You can now use the bot. Go on the bot's section "About" to know how use the commands.
All the informations about this bot (configuration, etc) are in this file.
Architecture schéma is in this file.
1/ Start by running : npm i
2/ Create an file named .env
, then find variables thanks to the
documentation : https://docs.google.com/document/d/1VNHepiCHvmf6mLz2AZmaUNJzSKHFuQS4N2nUNNzKepY/edit#
3/ Launch the app : npm run dev
🚧 Tests are in progress. 🚧
The test library used is Jest. You can use tests with this command : npm run test
.
The coverage
library is installed on this project. You can check the
coverage of this project with this command : npm run coverage
.
Check the actual version of the bots thanks to /skillz-version-{ENV}. If you want to update it, change the "version" field from the package.json
This Github Actions is located in .github/workflows/update-referentials.yml
- Run every monday à 6:00am UTC
- Get all approved data from skills.zenika.com
- Update files located in hasura/seeds with new approved data
- Create a merge request
Dependabot helps us keep our dependencies up to date. It checks our dependency files for outdated requirements and opens individual PRs.
The configuration file is located in .github/dependabot.yml
- Run every first day of the month
- Create PR for skills-app and skills-bot