Giter Club home page Giter Club logo

42portfolio's Introduction

42Portfolio

Django CI


42 Portfolio Source Code Built with Django and React


References & Quick Links:

📖 Wiki: https://github.com/pulgamecanica/42Portfolio/wiki

🗂️ Project: https://github.com/users/pulgamecanica/projects/2

📋 Notion: https://www.notion.so/42-lisboa-porto/Skill-Portfolio-Tech-70ca05b0f1184f90a745d356710f870e

💻 Discord: https://discord.gg/afDecM2jnR

🍇 Gather: https://app.gather.town/invite?token=9TUswIOqTwSqonz0EqJn

:basecamp: DB vizual tool: https://sql.toad.cz/?keyword=default


How to install the project?

image

First clone the repo:

git clone https://github.com/pulgamecanica/42Portfolio

Create a .env file and fill the variables according to the .env.example

Then run the Docker containers for the DataBase and Django App

docker compose up

Make sure you've installed all the modules needed for the project. We recommend you run a new virtual environment for developing:

pipenv shell
pip install -r requirements.txt

If you want to work on the frontend you need to start the react app:

cd frontend
npm install
npm start

🖥️ Now you are Good to go!


Contributors:

Made with contrib.rocks.


42portfolio's People

Contributors

pulgamecanica avatar pukiediederik avatar

Stargazers

El Mehdi Kenane avatar Lukas González avatar  avatar  avatar kazuki nitta avatar

Watchers

James Cloos avatar Margarida Aguiar avatar  avatar

42portfolio's Issues

Intra img

Right now we are not updating the image when the user is created, must add this line of code on the get_or_create user.

Centralize intra API requests

We should have a central server that serves makes requests to the intra. This is so we can better keep track of how we are using the tokens. With a module we can't keep track of all the requests made and therefore we can run into "To Many Requests" issues. Having a single server which makes the requests would remedy this issue.

CronJob

Create the CronJob Table which will register on our database all the syncronizations with intra
The crontab is just for metadata an for data analysis

[Architecture] - Django Project Model

Create the Project Model according to the DB Demo Reference we agreed upon.
The DB Demo Reference is available on the home page wiki or in Notion.

Submit a PR with your Code, well commented, indicating any code which might be ambiguous or abstract.


  • It's a good idea to implement the str method already so we can access Objects from this instance and the return is not garbage, but a well understood string.

Update relations individualy

It's painful to wait for all the relations to update.

We should implement for example a way to update only the user-project relations
Or cursus-project relations.

[Architecture] Implement Abstract User

Implement the Abstract User that we discussed.

For this to work you should rollback all your migrations and drop (prune) your database.

Let's also add a field: is_admin, change the username to intra_username, and the USERNAME variable as well, let's also try to delete the username field from the migration, we don't want an unused field on the db

Verify Cascading

Check that we have correctly done the cascade deletion for our Projects, Skills, Cursus & Users

[DB] PostgreSQL Port

We must allow a different port to be exposed for the PostgreSQL container.

Currently the image will decide which port to use, by default 5432.

[Architecture] - Django Skill Model

Create the Skill Model according to the DB Demo Reference we agreed upon.
The DB Demo Reference is available on the home page wiki or in Notion.

Submit a PR with your Code, well commented, indicating any code which might be ambiguous or abstract.


  • It's a good idea to implement the str method already so we can access Objects from this instance and the return is not garbage, but a well understood string.

SVG Improve

Save the SVG with a n expiration date.
Consider Redis for session cache

Username conflict

Resolve username confilct,
the user still has a field username, I can't understand why, we should look into this.
The only username should be intra_username...

Its conflictive because it's also unique on the DB so the db will need to have different usernames foe each user, we don't even want usernames we are using intra_username for that

[FrontEnd] - SEO OG Tags

Add SEO Tags, For better link share experience

Analise the meta tags, and add all relevant tags to the application.

For instance, mobile scale, title, description, tags, og; etc.

Maybe we can also add the animate.css library as a package.

User Storage

Define what date we will ask from the user and what we will save.

Define how we erase the User Data and the limit

[42Api & Authentication] - Integrate oAuth2.0

Identify the oAuth import module which fits best with our application.
There should be a strategy available to implement for the 42Api and Django, also find about that.

Finally implement the oAuth module, for normal users.

Create the decorators to guard the endpoints which need authentication.

Solo Project

Change the solo attribute from the project to the project users
Projects itself might be solo or not, the user is the one deciding if he takes the project solo or not (when he is given the option ofcs)

[Architecture] - Django Relations

Create the Relations according to the DB Demo Reference we agreed upon.
The DB Demo Reference is available on the home page wiki or in Notion.

Indicate correctly the Relations with the Django relations module [ManyToMany, OneToMany, OneToOne, ManyToOne]

Submit a PR with your Code, well commented, indicating any code which might be ambiguous or abstract.

If you have any questions about the relations let me know


  • ProjectCursus
  • ProjectUser
  • ProjectUserCursus
  • CursusUser
  • CursusSkill
  • CursusUserSkill

  • It's a good idea to implement the str method already so we can access Objects from this instance and the return is not garbage, but a well understood string.

[FrontEnd] Axios And React

Integrate Axios with React

In order to submit the PR for this, we should have a working Singleton, and you should just be able to do:

axios.get(route) --> Returns a promise response
axios.post(route) --> Returns a promise response

[Architecture] - Django Cursus Model

Create the Cursus Model according to the DB Demo Reference we agreed upon.
The DB Demo Reference is available on the home page wiki or in Notion.

Submit a PR with your Code, well commented, indicating any code which might be ambiguous or abstract.


  • It's a good idea to implement the str method already so we can access Objects from this instance and the return is not garbage, but a well understood string.

REST API Settings

Discussion about REST API Settings, should it be 100% read only? I think so...

INTRA settings

Create the Intra Settings table

This Table will contain the encrypted intra credentials, this will be used to sync our data with intra.

For now we are using the .env and will continue to do so until this is created.

[Architecture] - Django User Model

Create the User Model according to the DB Demo Reference we agreed upon.
The DB Demo Reference is available on the home page wiki or in Notion.

Submit a PR with your Code, well commented, indicating any code which might be ambiguous or abstract.


  • It's a good idea to implement the str method already so we can access Objects from this instance and the return is not garbage, but a well understood string.

  • Also we can just use the username instead of intra_username, so it's not very redundant, it's your choice ;)

React Pages

Define React Pages:

Landing Page.

Welcome.

Legal & Privacy.

CV Generated Public page

SVG Rendered Page

Configurations Page.

[API] Base Class IntraElement

Create a Base Class to implement in our models.

Base class will help us implement the updated_at attribute.

We can also implement the was_updated_today method on this class.

Later we can implement actions to update the elements with fetch calls to intra.

REST API pagination

We want to limit our REST API responses to a max limit of 100 just like intra. Responses can't take much time and should not return so much data.
Currently the projects endpoint had loaded the intra projects with the sync command, it's around ~1500 projects
The REST API is returning all the projects in one request and this produces a buggy REST API on the frontend and it's more data than what the browser can handle so it might ask the user to close the tab because the page is not responding.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.