Skip to content

Latest commit

 

History

History
101 lines (69 loc) · 6.67 KB

README.md

File metadata and controls

101 lines (69 loc) · 6.67 KB

pocketbase tailwindcss nginx docker vercel aws

CitySort

A live index of the best cities to live and work in India, based on crowdsourced data.
Website · Issues

b25464c1-41fb-464d-a44e-5dd70245b70b

How It Works

Infrastructure Configuration

The foundational structure commenced with the establishment of a Docker Pocketbase server encapsulated within a container. This containerized setup operated by forwarding its port to 8080 on the host system, thereby compartmentalizing services for streamlined management and resource optimization.

ctsd

Nginx Reverse Proxy Setup: The integration of an Nginx reverse proxy served as a pivotal layer facilitating efficient routing and secure communication between the frontend and backend systems.

server {
    server_name server.rikiphukon.com;

    location / {
        proxy_pass http://127.0.0.1:8080/;
    }

    location /admin {
        proxy_pass http://127.0.0.1:8080/_/;
    }

    location ~ ^/api(/.*)$ {
        proxy_pass http://127.0.0.1:8080/api$1;
    }

    location /server {
        proxy_pass http://localhost:80;
    }
}

This Nginx configuration efficiently directed requests based on URL paths, ensuring proper handling of diverse endpoints and locations for seamless communication between components.

SSL Certification

SSL certificates were generated for the subdomain server1.rikiphukon.com.

Systemd Service Integration

A systemd service was orchestrated for the container housing the Pocketbase server. This orchestration facilitated seamless management, auto-start capabilities, and monitoring of the Pocketbase server, ensuring its persistent availability and operational efficiency.


The core objective of this project is to compile and organize crowdsourced data pertaining to various cities. This data is primarily derived from surveys, providing insights into diverse aspects of urban life. The project's database architecture comprises four key collections:

  • citysort: This collection encompasses fundamental city data, establishing a one-to-one relationship with entities within the city_json collection.

  • city_json: Housing detailed information about city attractions and weather, the city_json collection maintains a one-to-one relationship with the unique identifiers in the citysort entities.

  • city_data_buffer: Essential for managing survey data, this collection allows for multiple survey datasets associated with individual cities.

  • survey_data: A comprehensive aggregation of data sourced from the entirety of cities within the city_data_buffer.

fewwdwd


Interpreting Survey Data:

Within the survey_data collection, I devised an approach to compute and interpret 'No' values without storing them explicitly in the database. This method involves the storage of affirmative responses only, represented as 1 for each 'Yes' response to a particular survey question within a city's entry.

Storage of Affirmative Responses

Each 'Yes' response to a specific survey question within the survey_data entry for a city is logged as a numerical value of 1. These 1s are aggregated across various survey questions, forming the cumulative count of 'Yes' responses for that city.

Calculating No Responses

To derive the count of 'No' responses for a particular question within a specific city, the subtraction methodology comes into play. By subtracting the total count of 'Yes' responses from the overall number of surveys conducted for that city, the remaining count represents the implicit 'No' responses. This method allows for the determination of 'No' responses without explicitly storing them in the database.

Radar Overview Visualization:

The Radar visual representation based on the derived counts of 'Yes' and 'No' responses is generated by subtracting the 'Yes' count from the total number of surveys for a specific city, enabling a comparative analysis of affirmative and negative responses across different cities.

CitySort operates as a crowdsourced platform where users can contribute their ratings, reviews, and opinions about various cities in India. The platform is designed to be intuitive and user-friendly, allowing visitors to explore different cities, view aggregated ratings, and read detailed reviews to gain a comprehensive understanding of each location. The data may initially be limited, but it's the collective input from the community that will enhance and enrich the platform.

Background

The inception of CitySort stemmed from a viral tweet that prompted followers to rate their cities based on various parameters. Witnessing the engaging conversations in the comment section, the idea emerged to create a platform dedicated to collecting and aggregating data about Indian cities. Recognizing the power of collective knowledge, this project thrives on community contributions, valuing the diverse opinions and experiences of individuals across the country.

The primary goal of CitySort is to create a comprehensive and informative resource that offers valuable insights into different cities in India. By harnessing the collective knowledge of residents, workers, and visitors, the platform aims to assist individuals in making informed decisions about where to live, work, or visit within India.

Getting Started

To start contributing and making changes in CitySort, please ensure your commits follow the Conventional Commits specification and understand the principles of Semantic Versioning for version control. Your adherence to these guidelines will help maintain consistency and clarity throughout the project's development cycle.