Simba is a city like Florence, Vienna, or San Francisco but built via the internet.

Overview

Simba City

Project setup

Duplicate env.example and .env.test.example and rename to .env and .env.test

Firebase Authentication

We are going to use firebase to create the credentials for us. We can use Google cloud console directly but we will need to configure extra stuff.

How to create credentials in firebase

Part 1:

  1. Go to firebase. Create a new account then click on add project.
  2. Give a name for your app then you can leave everything as default and click next.
  3. Go to the authentication tab in the sidebar. Click get started. Click on Google sign in and enable it. Now simply click on save.
  4. If you click on edit again and open the Web SDK configuration accordion. You can see the credentials we need. I am showing my credentials for the demo but you shouldn’t show your credentials.
  5. Now add the credentials to your .env file.
  • image

Part 2:

  1. Stop and start your dev server yarn dev
  2. Click on "Sign in with Google" in the app
  3. You'll get an error screen. Now copy the link at which is at the bottom of the error and paste the link into a new tab. Scroll down and you will be able to see redirect URI’s.
  • image
  1. Now click on ADD URI and add this: http://localhost:3000/api/auth/callback/google
  • image
  1. Then click on save. If you try logging in. You can now log in.

Database

run docker-compose up -d

You haven't installed docker and docker-compose on your system?

Here's an installation guide

You'll only need these commands when using docker-compose:

# start running containers
docker-compose up -d

# shut-down running containers
docker-compose down

# list running containers
docker-compose ps

Run tests

yarn test

Optionally, you can add a name pattern of the file name:

yarn test User

Check test coverage:

  1. yarn test:coverage
  2. open file ./coverage/lcov-report/index.html

Database

We're using PlanetScale for our database. It uses a MySql database, however PlanetScale doesn't support foreign key constraints and we enabled this on the Prisma level instead of having it at the DB level.

This means there's one thing we need to consider now: We now always need to add an @@index([...]) if we add a foreign key (otherwise certain queries would run slower).

Comments
  • Mission town square feature markdown input

    Mission town square feature markdown input

    I have added markdown input using react-md-editor which replaces the current basic input we have. React-md-editor uses rehype-sanitize to sanitize the input, and uses react-markdown-preview to display the markdown input.

    opened by SMLukwiya 4
  • Only related to iPhone: Better UX for creating new threads on mobile

    Only related to iPhone: Better UX for creating new threads on mobile

    Right now on mobile a user needs to tap twice on a message to start or open a thread. We want that the thread view opens on the first tap.

    What does success look like?

    The UX for creating opening a thread should be exactly like Slack does it in it's mobile app. (one tap opens thread)

    enhancement 
    opened by danieltonel 3
  • 23 refactor message component

    23 refactor message component

    Main changes:

    • refactored message component html structure and styling
    • extracted avatar component to it's separate file
    • removed messages/show endpoint since it was never used
    • Removed a bunch of ? by creating a new MessageDefaultSchema
    • fix for vertical scrolling on mobile
    opened by danieltonel 1
  • Use nextjs <Image> instead of native <img>

    Use nextjs instead of native

    There are some occurrence where we use the native tag instead of

    image

    https://nextjs.org/docs/api-reference/next/image

    What does success look like?

    We use the nextjs everywhere, never

    bug 
    opened by danieltonel 1
  • Posting a long link breaks the screen

    Posting a long link breaks the screen

    Posting a long link or URL displays beyond the defined screen area.

    What does success look like?

    Normal texts, links and urls should all fit within the defined screen area of display, long texts, links and urls should wrap around to fit within the defined area.

    bug 
    opened by SMLukwiya 1
  • Planetscale / Prisma: Add indexes for foreign keys for town square tables

    Planetscale / Prisma: Add indexes for foreign keys for town square tables

    We forgot to add indexes to our foreign keys on the town square tables. This is a guide what needs to be done:

    https://www.prisma.io/docs/guides/database/using-prisma-with-planetscale#how-to-create-indexes-on-foreign-keys

    (I recommend reading the whole post)

    enhancement 
    opened by danieltonel 1
  • Pin Input and Share button to the bottom of the screen.

    Pin Input and Share button to the bottom of the screen.

    Currently if the number of messages exceed the screen view, the input and share button are pushed below the visible section of the screen.

    What does success look like?

    One must not scroll to be able to type new messages, the input and share button must be visible at all time.

    enhancement 
    opened by SMLukwiya 1
  • Logout should redirect to home page

    Logout should redirect to home page

    Logout shows Loading... and doesn't redirect to home page.

    What does success look like?

    After clicking logout you should be redirected to the home page.

    bug 
    opened by danieltonel 1
  • Town square: Show messages in correct order

    Town square: Show messages in correct order

    Current behavior:

    Currently we show the newest message on the top, and load more messages on the bottom

    Expected behavior:

    We show the newest message on the bottom, and load more messages on the top

    Success criteria

    • Always load the 20 most recent messages first
    • Have to load more button on the top
    • Load more will add the messages on top (like discord, slack, whatsapp)
    enhancement 
    opened by danieltonel 1
  • Date formatted incorrectly

    Date formatted incorrectly

    Small issue, but will be quick to fix I guess.

    Date is formatted like this: Today at 9:2pm

    But we would like to have it formatted like this: Today at 9:02pm

    bug good first issue 
    opened by danieltonel 0
  • Mission: Build Town Square V1

    Mission: Build Town Square V1

    Figma: https://www.figma.com/file/xpxnXvfHCac5ZUqFoo4Rrf/townsquare?node-id=0%3A1

    town_square will be our communication app. We will use it instead of Discord, Slack etc.

    opened by danieltonel 0
  • Frontend: Add emoji reactions to messages

    Frontend: Add emoji reactions to messages

    What does success look like?

    We want to have a similar experience to the mobile Slack or Discord app when picking emojis. Please use these apps as a reference when implementing the UX for the emoji picker 😊

    Emoji picker component

    Use this picker component: https://github.com/missive/emoji-mart

    With these settings:

    image

    Design

    Figma: https://www.figma.com/file/xpxnXvfHCac5ZUqFoo4Rrf/townsquare-app?node-id=305%3A53&t=dWOzI3E47EIFEUs8-0

    Let's only focus on making the mobile experience great for now. Regarding interactivity check how slack/discord behaves when adding emojis on mobile.

    image

    This is how the desktop version will look like (it doesn't look great but I think we should first make the mobile experience perfect before we focus on desktop): image

    image

    Data store

    This issue is only about the frontend implementation. Which means we'll mock the database with a simple component store (this will be replaced once we're building the backend).

    The component store should look like this:

    emojis: [{symbol: 👍, userIds: [1] }, {symbol: 🤣, userIds: [1,2] }]
    
    opened by danieltonel 0
  • Mission subscriptions v1

    Mission subscriptions v1

    Subscriptions MVP setup. Features included:

    • Creation of both future and past posts
    • Displaying future and past posts
    • Searching for posts
    • Updating user settings information
    opened by SMLukwiya 1
  • PWA should feel like native app

    PWA should feel like native app

    Improve PWA experience and implement best practices: https://web.dev/progressive-web-apps/

    What does success look like?

    App should be indistinguishable from a native app on android. App should feel snappy and navigation should be intuitive.

    enhancement 
    opened by danieltonel 0
  • Advanced markdown editor for sending messages

    Advanced markdown editor for sending messages

    Replace the current input message box with react-md-editor.

    Use this package: https://github.com/uiwjs/react-md-editor

    This is how you set it up for next.js: https://github.com/uiwjs/react-md-editor#support-nextjs

    What does success look like?

    Functionality:

    • Bold
    • Italic (we might remove that)
    • Strikethrough (we might remove that)
    • Link
    • Quote
    • Code (we might remove that)
    • Codeblock
    • Ordered list (we might remove that)
    • Unordered list (we might remove that)
    • Write mode
    • Split screen mode (we might remove that)
    • Preview mode
    • Full screen mode (we might remove that)
    image

    Additonal notes

    Mobile

    Make sure everything works great on mobile.

    There should be minimal custom code outside of the provided props from the editor

    Try to use the default props and functionality from the component.

    https://uiwjs.github.io/react-md-editor/#props

    image

    Security

    We'll need to sanitize the content.

    https://uiwjs.github.io/react-md-editor/#security

    Display messages

    We'll also need to display the messages correctly. Probably we'll add custom CSS inside of the message component:

    <style>
    h1 { @apply text-2xl }
    strong { @apply text-bold }
    ...
    </style>
    
    enhancement 
    opened by danieltonel 0
Owner
Simba City
Simba is a city like Florence, Vienna, or San Francisco but built via the internet.
Simba City
The official challenges and deployment source code files used in San Diego CTF 2022.

SDCTF 2022 Here is the challenge and infrastructure files of San Diego CTF 2022. Challenge files include source code that implement the challenge idea

Association for Computing Machinery (UCSD) 23 Dec 8, 2022
DNS-Blocklists: For a better internet - keep the internet clean!

DNS Blocklists - For a better internet! Multi - Cleans the Internet and protects your privacy! An all in one blocklist based on the OISD blocklist, ba

Gerd 280 Jan 2, 2023
Open-source NFID SDK for Internet Identity, a blockchain authentication system for the Internet Computer.

NFID-SDK is an open source software development kit that contains examples and packages for developers to integrate NFID into your application

Internet Identity Labs 15 Dec 23, 2022
A file sharing service, where you can upload files and provide a download link for anyone on the internet by sharing the link 🔗 or via mail ✉️ which remains active for 24hours 🕙.

eShare | File Sharing App A file sharing service, where you can upload files and provide a download link for anyone on the internet by sharing the lin

Akhil Bhalerao 7 Nov 20, 2022
Piccloud is a full-stack (Angular & Spring Boot) online image clipboard that lets you share images over the internet by generating a unique URL. Others can access the image via this URL.

Piccloud Piccloud is a full-stack application built with Angular & Spring Boot. It is an online image clipboard that lets you share images over the in

Olayinka Atobiloye 3 Dec 15, 2022
Proxy but misspelled -- closed proxy for the internet

pyrox Proxy that runs on Cloudflare Workers. Setup Install wrangler2. npm install wrangler. Generate a public Ed25519 key, exported under SPKI mode wi

bots.gg 10 Sep 9, 2022
科技风智慧城市 Demo: http://stonerao.com/public/city/

Three.js Setup Download Node.js. Run this followed commands: # Install dependencies (only the first time) npm install # Run the local server at local

rao_yan 120 Dec 2, 2022
SafeCycle—a tool that keeps cyclists safe. Gone are days of weaving through busy city streets, SafeCycle finds all the bike routes for you to ensure a smooth ride wherever you want to go.

Inspiration Biking—an everyday form of travel for students and professionals across the globe. On-campus, back home, and with the people that we know

Ryan Hu 2 May 2, 2022
A smart city community centered application I am building for the Hackers In Residence under the Nkwashi program

A smart city community centered application I am building for the Hackers In Residence under the Nkwashi program. Implementing solutions and automation for potential future problems in the city.

Blessed Jason Mwanza 4 Apr 25, 2022
From the Linux Foundation office in New York City, welcome to The Untold Stories of Open Source

From the Linux Foundation office in New York City, welcome to The Untold Stories of Open Source. Each week we explore the people who are supporting Open Source projects, how they became involved with it, and the problems they faced along the way.

The Linux Foundation 77 Jan 5, 2023
Qwik City adapter for trpc.io

tRPC ?? Qwik City End-to-end typesafe APIs made easy with tRPC.io in Qwik City applications. Build & consume fully typesafe APIs, without schemas or c

Giorgio Boa 29 Oct 11, 2022
A work-in-progress HTML sanitizer that strives for: performance like window.Sanitizer, readiness like DOMPurify, and ability to run in a WebWorker like neither of those.

Amuchina A work-in-progress HTML sanitizer that strives for: performance like window.Sanitizer, readiness like DOMPurify, and ability to run in a WebW

Fabio Spampinato 9 Sep 17, 2022
Bookmate - Watch changes in Chrome bookmarks, and use bookmarks as an append-only key-value store via an fs-like API.

?? Bookmate An append-only key-value store built on Chrome bookmarks, plus an asychronous stream of Bookmark changes. For NodeJS Actual production exa

Cris 6 Nov 8, 2022
Like JSX, but native and fast

esx High throughput React Server Side Rendering For a simplified example of esx in action, check out esx-demo. esx is designed to be a high speed SSR

ESX 645 Jan 2, 2023
Like Obsidian Publish but for self-hosting. Plugin integrations for dataview, admonition, and more.

Obsidian Export Obsidian Publish is great but lacks support for many of the plugins we Obsidian addicts have grown accustomed to — in particular Datav

null 12 Nov 28, 2022
Enables creating databases based on files in Obsidian - like Dataview, but with editing!

Obsidian Database Plugin Do you like Dataview plugin for Obsidian? This one is taking Dataview to next level, but not only allowing you to view the da

Łukasz Tomaszkiewicz 115 Jan 4, 2023
📦 Writing Express but feel like Spring Boot

Springpress Custom top-level framework of Express.js, especially on TypeScript. Springpress provides expressjs utilities out of the box, lets you deep

Vectier 8 Oct 14, 2022