dev-launchers / strapi Goto Github PK
View Code? Open in Web Editor NEWRepo to host DevLaunchers strapi
Repo to host DevLaunchers strapi
#55 will create a Google Calendar and common room for each project. The frontend can present the calendar and meeting room to potential team members.
If you go to api/project/controllers, you'll find two functions called find and findOne. These are also known as controllers. Here's the link That explains what controllers are. You'll see that the two controllers return the member's emails in the response.
When you make a GET request to http://localhost:1337/projects, it'll call the find controller, and you'll get this response.
[
{
"id": 1,
"slug": "dummyProject",
"catchPhrase": "awdawd",
"title": "awdawdawd",
"vision": "awdawd",
"Description": null,
"commitmentLevel": "awdawd",
"signupFormUrl": "awdawdawd",
"published_at": "2021-07-14T03:33:29.251Z",
"created_by": {
"id": 1,
"firstname": "Alejandro",
"lastname": "Armas",
"username": null,
"email": "[email protected]",
"password": "$2a$10$XHAts4.oNR2K7HzjpXgJvO4rEopSVIo3ND/6SnSz3Re39geLIdx6e",
"resetPasswordToken": null,
"registrationToken": null,
"isActive": true,
"blocked": null,
"preferedLanguage": null
},
"updated_by": {
"id": 1,
"firstname": "Alejandro",
"lastname": "Armas",
"username": null,
"email": "[email protected]",
"password": "$2a$10$XHAts4.oNR2K7HzjpXgJvO4rEopSVIo3ND/6SnSz3Re39geLIdx6e",
"resetPasswordToken": null,
"registrationToken": null,
"isActive": true,
"blocked": null,
"preferedLanguage": null
},
"created_at": "2021-07-03T20:03:55.687Z",
"updated_at": "2021-07-14T03:33:29.321Z",
"description": "qwerqwertq34twergfhsrthdsfth",
"user": null,
"meetingLinkURLs": [
{
"id": 1,
"roomName": "Room 8",
"url": "https://devlaunchers.com/hangout"
}
],
"meetingTimes": [
{
"id": 1,
"title": "123",
"date": null,
"dateTime": "awdawdawd"
}
],
"keywords": [
{
"id": 1,
"keyword": "1234123123123"
},
{
"id": 2,
"keyword": "234234234234"
}
],
"projectReferenceURLs": [
{
"id": 1,
"title": "123qwerwsefwer",
"url": "234qe3rwytwretywetry"
}
],
"openPositions": [],
"team": {
"id": 1,
"leaders": [
{
"id": 89,
"name": "alearm246",
"email": "[email protected]",
"role": "Backend Developer"
}
],
"members": [
{
"id": 87,
"name": "test user",
"email": "[email protected]",
"role": "Backend Developer"
},
{
"id": 90,
"name": "new user",
"email": "[email protected]",
"role": "System Admin"
}
]
},
"Images": [
{
"id": 1,
"image": []
}
],
"heroImage": {
"id": 1,
"name": "cool-backend.jpg",
"alternativeText": "",
"caption": "",
"width": 1250,
"height": 735,
"formats": {
"large": {
"ext": ".jpg",
"url": "/uploads/large_cool_backend_ca64adb449.jpg",
"hash": "large_cool_backend_ca64adb449",
"mime": "image/jpeg",
"name": "large_cool-backend.jpg",
"path": null,
"size": 57.29,
"width": 1000,
"height": 588
},
"small": {
"ext": ".jpg",
"url": "/uploads/small_cool_backend_ca64adb449.jpg",
"hash": "small_cool_backend_ca64adb449",
"mime": "image/jpeg",
"name": "small_cool-backend.jpg",
"path": null,
"size": 17.92,
"width": 500,
"height": 294
},
"medium": {
"ext": ".jpg",
"url": "/uploads/medium_cool_backend_ca64adb449.jpg",
"hash": "medium_cool_backend_ca64adb449",
"mime": "image/jpeg",
"name": "medium_cool-backend.jpg",
"path": null,
"size": 35.15,
"width": 750,
"height": 441
},
"thumbnail": {
"ext": ".jpg",
"url": "/uploads/thumbnail_cool_backend_ca64adb449.jpg",
"hash": "thumbnail_cool_backend_ca64adb449",
"mime": "image/jpeg",
"name": "thumbnail_cool-backend.jpg",
"path": null,
"size": 5.5,
"width": 245,
"height": 144
}
},
"hash": "cool_backend_ca64adb449",
"ext": ".jpg",
"mime": "image/jpeg",
"size": 86.73,
"url": "/uploads/cool_backend_ca64adb449.jpg",
"previewUrl": null,
"provider": "local",
"provider_metadata": null,
"created_by": 1,
"updated_by": 1,
"created_at": "2021-07-14T03:29:47.066Z",
"updated_at": "2021-07-14T03:29:47.088Z"
}
}
]
If you go to the members section you'll see that it returns the member's email
{
"id": 87,
"name": "test user",
"email": "[email protected]",
"role": "Backend Developer"
},
All you'll have to do is remove the email from the member in both the find and findOne controller since we don't want to return the member's email. You'll also want to use the sanitizeEntity function to remove all private fields about a project before sending it off to the frontend.
``
https://strapi.io/documentation/developer-docs/latest/guides/error-catching.html#create-a-middleware has a guide to send errors to Sentry. Using Sentry, we can get reports on exceptions.
Project leads want a way to understand engagement from each member. Potential sponsors and contributors also want to know level of activities for the project. This can be quantified as the contributions on Github and hours spent in meetings and coworking rooms.
Create a contributor component to track the minutes a user spent in meetings and coworking rooms, and optionally include contributions on Github if the project has a Github URL. Add a relational field to project collection to track all contributors.
The application collection has a field project. When a new application is submitted, find the project lead of the project and send an email or discord message to the project lead.
It seems like discord limits the content for the embeds, with the current implementation most of the projects in the strapi exceed the limit discord webhook has for content.
You can find more details about the limit on this page!
https://discord.com/developers/docs/resources/channel#embed-limits
Having a user profile helps contributors learn other aspects of the organization, and it benefits from network effect.
Invite project contributors to create a user profile.
We want to allow users to be able to link their discord accounts to their profiles.
Whenever users click on the discord logo when they signup, it will take them to a user consent screen with this link https://discord.com/api/oauth2/authorize?client_id=815294711983112194&redirect_uri=http%3A%2F%2Flocalhost%3A1337%2Fauth%2Fdiscord%2Fcallback&response_type=code&scope=identify screen where they can allow devlaunchers to get basic discord information such as their discord id, avatar, username, and discriminator.
After clicking yes, it will redirect the user back to our servers using a redirect URL that we defined. For instance, in the link I posted above you can see that there is a redirect URL redirect_uri=https%3A%2F%2Fapi-staging.devlaunchers.com%2Fusers%2Fauth%2Fdiscord%2Fcallback. This lets discord know where to send them back. This redirect URL will then call the /auth/discord/callback endpoint which will then fire your controller.
We want to display activities about a project to get potential sponsors and contributors excited. One category of activities is github statistics
Github provides APIs to fetch statistics
https://docs.github.com/en/rest/reference/repos#statistics
For example
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/dev-launchers/platform__website/stats/code_frequency
Returns the weekly aggregate of the number of additions & deletions pushed to https://github.com/dev-launchers/platform__website.
Github also has APIs to query issues https://docs.github.com/en/rest/reference/issues#list-repository-issues
We want to build an API that queries the Github API and return the following statistics
Now that we have the one-to-one relationship between the google meets collection and the project's collection. We need to actually utilize it.
In api/google-manager/services/google-manager.js, you'll see a method called createEvent. In that method, we create the google meets entry into the google meets collection for that respective project. You're goal is pass in the id of the project to setup that relationship between the project and the google meets.
Common room at https://devlaunchers.com/hangout, lab rooms in https://devlaunchers.com/user-profile and project rooms are Google Meeting rooms. Creating a collection allows us to track the rooms and collect stats.
The current rich text editor can be annoying when selecting a bunch of text and apply a specific format, it removes the whole selected text and replace it with a markdown placeholder of that format.
there are a good alternatives over here https://github.com/strapi/awesome-strapi#community-wysiwyg-replacements
Use learnData.json as a reference to create the learnData Collection
Use createData.json as a reference to create the createData collection
Each project should have a Google Group to enable
Google Groups can be created via https://developers.google.com/admin-sdk/directory/reference/rest/v1/groups/insert API.
Google Calendars can be created via https://developers.google.com/calendar/api/v3/reference/calendars/insert?authuser=3
After a calendar is created, we can give a Google Group access to it by granting writer ACL to this group https://developers.google.com/calendar/api/v3/reference/acl/insert?authuser=3
Then we can create recurring events using https://developers.google.com/calendar/api/v3/reference/events/insert
A sample request body is
{
"end": {
"date": "2021-07-04"
},
"start": {
"date": "2021-07-04"
},
"attendees": [
{
"email": "[email protected]",
"responseStatus": "accepted"
}
],
"recurrence": [
"RRULE:FREQ=DAILY"
],
"conferenceData": {
"createRequest": {
"conferenceSolutionKey": {
"type": "hangoutsMeet"
},
"requestId": "Platform Dev Common Room"
}
},
"summary": "Platform Dev Common Room"
}
When a new project is created, the following resources are also created
If users enter a username with a space then someone tries to view their profile by typing it in the URL, it won't work because a white space will be URL encoded into %20.
Make it so whenever someone makes their username we remove all white space and replace them with underscores
You'll want to be using the beforeCreate lifecycle method for the user collection to prevent white space from being in the username and replace it with underscores.
create a file in extensions/users-permissions/models called User.js and you should be able to use the beforeCreate lifecycle method to complete this task.
If you need a reference here's one reference
We want projects to be able to have sub-projects. For example, the devlaunchers-platform project is the parent project to the site-backend project.
To achieve this you'll create a new one-to-many relationship field between parent projects and sub-projects. This will allow parent projects to have many sub-projects and sub-projects to have one parent project.
We want to encourage users to create a profile and join Saturday labs or other projects. The strapi server has a cron job to periodically fetch Google meet reports. We can parse the report and give users points for each hour spent in labs/projects.
Extend Point collection to track participation minutes of each project. Increment total points and total seasonal points for each hour spent in projects. The hour can come from minutes spent in different projects.
Right now all project calendar events are set as a daily events.
Make it so the project calendar events are instead set to the meeting time set on the projects page
You'll want to be modifying the end, start, and recurrence properties in the createEvent method in api/google-manager/services/google-manager.js
Create a new collection in strapi called interest. This collection will have a one-to-many relationship with the users collection. Right now it should only have one field called interest that should be short text.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.