This is a Flask project for the AISSMS IOIT ACM Student Chapter website.
Home page
Membership Status
Footer
- Python (v2.7.18)
pip install -r requirements.txt
- TailwindCSS (run
npm install)
npx tailwindcss -i ./app/static/css/input.css -o ./app/static/css/tailwind.css --watch
-
Teams The
app/data/teams.pyfile contains information about the members of the AISSMS IOIT ACM committee, organized by year. -
Events The
app/data/events.pyfile contains a list of events organized by name, description, and date. Here's the structure:
- Avoid f-strings: Use .format() or string concatenation for string interpolation (f-strings are Python 3.6+).
Currently, there is no Git integration in this project. However, the build.sh file located in the root directory serves as a utility to copy the necessary project files to a specified destination directory ($DEST_DIR). These files can then be zipped and uploaded to cPanel for hosting.
-
Set the Destination Directory Modify the
$DEST_DIRvariable in the script to specify the desired location where the project files will be copied. -
Make the Script Executable (Optional) To ensure that the script is executable, you can run the following command:
chmod +x build.sh
-
Run the Script After making the script executable, run it with:
./build.sh
The following routes are available in the project:
-
/: The home page of the site. -
/about: The about page. -
/membership: The membership page. -
/membership/status: A page showing membership status. -
/gallery: A page (currently under development) displaying images or events. -
/team: A page with details of the AISSMS IOIT ACM committee members. -
/events: A page displaying upcoming events. -
/events/{event.name}: Event details page.
This project manages ACM membership data by integrating with the SheetsDB API and providing a fallback mechanism using a snapshot.json file. When the monthly API quota is exceeded, the data is retrieved from the snapshot file.
The membership data is fetched from SheetsDB using the provided API endpoint and Bearer token. The data is cached for performance, and a fallback JSON file (snapshot.json) is used when:
- The API quota is exceeded.
- The API is unavailable due to network or other issues.
The snapshot.json file is a local backup of the membership data. It should be updated regularly to ensure it reflects the latest data.
To update the snapshot file:
curl -X GET https://sheetdb.io/api/v1/vn9yo1yzudzoh \
-H "Authorization: Bearer BEARER_TOKEN" > snapshot.jsonNOTE: Get the bearer token from the sheetdb console.
Python files for data are located in app/static/data.
- The
events.pyfile contains a list of events in the form of dictionaries. - Each event has the following fields:
name: The title of the event (e.g., "National Level FDP on Cyber Security").description: A brief overview of the event.date: The date(s) of the event (e.g., "October 21, 2024 - October 25, 2024").image_url: A URL to an image representing the event, which can be used for display purposes.instagram_link: The Instagram link for the event, if available.facebook_link: The Facebook link for the event, if available.topics: A list of topics covered during the event.
Example:
events = [
{
"name": "National Level FDP on Cyber Security",
"description": "A faculty development program focused on cyber security topics.",
"date": "October 21, 2024 - October 25, 2024",
"image_url": "",
"instagram_link": "",
"facebook_link": "",
"topics": [
"We discussed the fundamentals of cyber security, including key concepts such as firewalls, encryption, and authentication.",
"We explored network security techniques to prevent unauthorized access and attacks on computer networks.",
"We learned about cryptographic methods used to secure communications and protect sensitive information.",
"We talked about emerging cyber threats like ransomware and phishing, and how to mitigate them using various defense strategies.",
"We covered risk management approaches to identify vulnerabilities and create robust protection strategies.",
],
},
]- Events are dynamically rendered in Jinja2 templates via a
forloop, typically used on event listing or event detail pages. - The route for each individual event details page is dynamically created using the event’s name as a slug:
/events/{event.name}. For example, a URL for "National Level FDP on Cyber Security" would be/events/National%20Level%20FDP%20on Cyber Security.
-
Event name formatting:
- Do not use special characters in event names (e.g.,
@,#,&). - Avoid using hyphens (
-) and slashes (/) in event names, as they may conflict with route generation and URL structure. - If an event name contains spaces, consider replacing them with underscores (
_) for compatibility with the URL structure.
- Do not use special characters in event names (e.g.,
-
Image URLs:
- Only use appropriate image paths from the
staticfolder. - If no image is available for an event, leave the
image_urlfield empty.
- Only use appropriate image paths from the
- The
team_datavariable contains a dictionary with team members categorized by year (e.g., "2024", "2023", "2022"). - Each team entry includes the following fields:
name: The name of the team member.title: The role or title of the team member (e.g., "Chair", "Vice Chair").image: The file path to an image of the team member, typically located understatic/img/team/{year}/.linktree: A link to the team member's Linktree, if available.github: The team member's GitHub profile link, if available.linkedin: The team member's LinkedIn profile link, if available.instagram: The team member's Instagram profile link, if available.domain: The domain of work the team member belongs to (e.g., "core", "events", "web", "documentation").
- This file is used to render team members' information on team-related pages or sections of the website, with each member's details linked to their social media profiles (LinkedIn, GitHub, etc.).