Repository navigation
Feat/security order clean #238
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,31 +2,65 @@ | |
|
|
||
|  | ||
|
|
||
| ## How to build | ||
| RNCP Planner is a helper tool for 42 students. At 42, progression is project-based: each validated project grants XP, and XP increases your level. This project lets you simulate planned project validations to estimate your future level and track your RNCP progression. | ||
|
|
||
| ### Development | ||
| ## Running RNCP Planner locally | ||
|
|
||
| 1. Edit `flask/.env` and set `CLIENT_ID`, `CLIENT_SECRET`, `SECOND_CLIENT_SECRET`, and `REDIRECT_URI` | ||
| 2. Replace the redirect url in the environment.ts | ||
| 3. Execute: | ||
| <!-- <details> --> | ||
| <summary>Click to expand local setup instructions</summary> | ||
|
|
||
| ### Prerequisites | ||
|
|
||
| Before you begin, ensure you have the following installed on your system: | ||
|
|
||
| - [Docker](https://www.docker.com/) | ||
|
|
||
| ### 1. Create a 42 API key | ||
|
|
||
| To use 42 OAuth and retrieve user projects, you must create an API key from the 42 intra. | ||
|
|
||
| 1. Visit the 42 API [OAuth page](https://profile.intra.42.fr/oauth/applications). | ||
| 2. Create a new application and use the following callback URL: | ||
|
|
||
| ```text | ||
| http://localhost:3000/auth/callback/42 | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The callback URL should point to |
||
| ``` | ||
|
|
||
| ### 2. Configure environment variables | ||
|
|
||
| Create or edit `flask/.env` and fill it with the variables used by this project. | ||
|
|
||
| #### Example `flask/.env` file | ||
|
|
||
| ```env | ||
| # UID of your 42 OAuth application | ||
| CLIENT_ID="u-s4t2ud..." | ||
|
|
||
| # Secret of your 42 OAuth application | ||
| CLIENT_SECRET="s-s4t2ud..." | ||
|
|
||
| # next secret | ||
| SECOND_CLIENT_SECRET="s-s4t2ud..." | ||
|
|
||
| # Must match your 42 OAuth application callback URL | ||
| REDIRECT_URI="http://localhost:3000/auth/callback/42" | ||
| ``` | ||
|
|
||
| > [!TIP] | ||
| > For local deployment, `CLIENT_ID`, `CLIENT_SECRET`, `SECOND_CLIENT_SECRET` and `REDIRECT_URI` are required. | ||
|
|
||
| ### 3. Run RNCP Planner | ||
|
|
||
| With everything set up, run: | ||
|
|
||
| ```bash | ||
| docker compose run angular npm install | ||
| docker compose up -d | ||
| ``` | ||
|
|
||
| ### Production | ||
| Access the app at http://localhost:3000. | ||
|
|
||
| 0. Edit flask/.env | ||
| 1. Exec: | ||
| ```bash | ||
| docker compose run angular sh -c "rm -rf node_modules && npm install && ng build" | ||
| ``` | ||
| > [!NOTE] | ||
| > If recent JSON/config changes do not appear immediately, force a browser hard refresh (`Ctrl+Shift+R`). | ||
|
|
||
| 2. Uncomment the prod server on nginx.conf | ||
| 2.1 Set SSL certificates | ||
| 3. Replace redirect url in the environment.ts | ||
| 4. Exec: | ||
| ```bash | ||
| docker compose up -d nginx flask | ||
| ``` | ||
| <!-- </details> --> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,4 +28,8 @@ export const routes: Routes = [ | |
| path: 'auth/callback', | ||
| component: LoginComponent, | ||
| }, | ||
| { | ||
| path: 'auth/callback/:campusId', | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding |
||
| component: LoginComponent, | ||
| }, | ||
| ]; | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The opening
<details>tag is commented out on line 9, leaving<summary>orphaned and breaking the expandable accordion rendering in Markdown. Either uncomment<details>and</details>(line 66), or remove<summary>.