An on-demand peer tutoring platform by students, for students.

Overview

OURFinals

An on-demand peer tutoring platform by students, for students.

Database

The prisma/ folder contains:

  • migrations/: Past database migrations (all these files are generated).
  • schema.prisma: The database schema. Install the Prisma vscode extension before editing, and run Format Document (or option-shift-F) to format it
  • seed.js: Seed/initial data for local development. Currently only contains two example users.

PostgreSQL setup guide

(Some of these steps are specific to MacOS)

  1. Install the PostgressApp and psql CLI from postgresapp.com.

  2. Create a database. First enter Postgres by typing psql in the terminal, then run CREATE DATABASE ourfinals;

  3. Verify that the database has been created via PostgressApp.

  4. (I have already done this, but I'm keeping it here for reference)

    Create the file prisma/seed.js and add some seed data. (Seed DB docs)

    Add this section to package.json:

    {
       ...,
       "prisma": {
           "seed": "node prisma/seed.js"
       },
    }
  5. Make a migration.

    This only needs to be done when the schema is changed. I have already made the first migration (first_migration).

    To make a migration, run

    npx prisma migrate dev --name migrationname

    (Can use npm run db:migrate, and it'll prompt you for a migration name)

    There is no need put the data in the migration name as it's already included in the resulting migration folder name.

    Additionally, if the local database hasn't been created, this command should create it.

    This will also run the seeding script (made in the previous step).

  6. To reset the database, run npm db:reset. This will drop the DB (or perform a soft reset), create the DB again, apply all migrations, then run the seed script (Reset command docs).

Comments
  • Add spacing between buttons

    Add spacing between buttons

    opened by ninest 2
  • Add schema

    Add schema

    I tried to copy what was already there on the airtable table.

    See the schema: https://github.com/ninest/ourfinals/blob/schema/prisma/schema.prisma

    • What do you think is the best way to store the time slot? It seems we have to store time but not datetime. Perhaps an enum?
    • Do any fields have initial values?

    Relevant documentation:

    • Prisma schema: https://www.prisma.io/docs/concepts/components/prisma-schema
    • Data model: https://www.prisma.io/docs/concepts/components/prisma-schema/data-model
    • Relations: https://www.prisma.io/docs/concepts/components/prisma-schema/relations
    opened by ninest 1
  • Use env file for database url

    Use env file for database url

    Create a .env with the following

    DATABASE_URL=postgres://.../ourfinals...
    

    I think your URL was postgres://adi:Ranfoil@9@localHost:5432/ourfinals_local

    opened by ninest 0
  • Add authentication

    Add authentication

    The conditional auth stack rendering is done.

     useEffect(() => {
        const unsubscribe = auth.onAuthStateChanged(onAuthStateChanged);
        return () => unsubscribe();
      }, []);
    
    ...
    
    const isAuthenticated = !!currentUser;
    

    The variable isAuthed is false when the current user is empty.

    Along with this, I created a new file Router.js that has the logic

    export const Router = () => {
      const { isAuthenticated } = useAuth();
    
      return (
        <NavigationContainer>
          {isAuthenticated ? <SignedInTabs /> : <SignedOutStack />}
        </NavigationContainer>
      );
    };
    

    I also added the logout button on the settings page

    opened by ninest 0
  • Install dependencies and add form schemas

    Install dependencies and add form schemas

    Created a component for FormField, which is a simple input. It can be expanded to make it a text area too if required.

    All form validation is handled by React Hook Form which should be easy to work with and learn.

    The FormField component will also automatically display form errors ("Password required", "NUS email required")

    I've also put some styles in the component although we can perhaps move them outside once be figure that out

    opened by ninest 0
  • Install and set up prisma

    Install and set up prisma

    I added some instructions in the README for setting up the database. We should still read up more on migrations so we're all familiar with the commands.

    The current schema only has a User model, but after discussing we can add more fields and models.

    opened by ninest 0
  • "Reset" migrations

    We currently have 5 database migrations and might end up making more before launch. Perhaps we should delete them and make a single one? We won't be losing any data and it's not important to back to the previous migrations because they were never in production.

    Also, I'd recommend reading through these (if you haven't already). Migrations can get a little confusing and we sometimes do have to manually edit SQL files when we, for example, want to rename a column.

    • https://www.prisma.io/migrate
    • https://www.prisma.io/docs/concepts/components/prisma-migrate
    opened by ninest 1
  • Database functions

    Database functions

    I am going to start writing crud functions for the database. Functions like createUser, getUser, createAssignment, etc. This article provides a good starting point for how to structure the code: tsh.io/blog/dependency-injection-in-node-js. If we ever decide to not use Prisma in the future for whatever reason, it should be easy to replace it with something else while changing the minimum amount of code

    opened by ninest 2
  • Consistent styling and design tokens

    Consistent styling and design tokens

    There's currently no system for deciding the values of margin, padding, or colors. For spacing (margin, padding), I suggest we make an object of values to use everywhere. For example:

    export const spacing = {
    	xs: 5,
    	sm: 7,
    	base: 10,
    	md: 12,
    	lg: 17,
    	xl: 25,
    }
    

    So rather than having a style like

    const styles = StyleSheet.create({
      wrapper: { marginBottom: 12 }, // Should it be 10, 11, 12, 13, 14, or 15??
    });
    

    we can use

    const styles = StyleSheet.create({
      wrapper: { marginBottom: spacing.md },
    });
    

    Similar thing for colors:

    export const colors = {
    	primary: {
    		light: '#818cf8',
    		default: '#6366f1',
    		dark: '#4338ca',
    	},
    	gray: {
    		lightest: '...',
    		lighter: '...',
    		light: '...',
    		default: '...',
    		dark: '...',
    		darker: '...',
    		darkest: '...',
    	},
    	error: {
    		light: '...',
    		default: '...',
    		dark: '...',
    	},
    	...
    }
    

    This will make it easier to manage colors in once place. If you decide to introduce more themes (light, dark, black), it'll be easier to change the theme using context. Rather than going through every component and changing colors, we can just make a new colors object.

    opened by ninest 2
  • Next steps (06-01-22)

    Next steps (06-01-22)

    New components/pages:

    • [x] Additional info submission upon signup (name, year, nus id, faculty etc.)
    • [x] Profile page (this should only be visible once additional info is submitted)
    • [x] Marketplace
    • [x] Settings

    Form library:

    • [x] Set up react-hook form
    • [x] Set up yup

    Functions:

    • [x] Implement user creation in database upon signup and additional information input (sign them up as students by default/add to student table)

    Additional things

    • [x] add the form for assignment submission
    • [ ] reading and writing of user data and assignment data from the backend
    • [ ] change chat from bottom tab to being assignment specific
    • [ ] add user mode toggle (add relevant stacks for this, mainly pertaining to add assignment/teach assignment), and tutor functionality
    opened by adidoesnt 6
Owner
Aditya Banerjee
NUS Computer Science '23
Aditya Banerjee
Peer-to-peer terminal chat based on DStack

peerchat Peer-to-peer terminal chat based on DStack Recording looks ugly, but in terminal it seems to be fine peerchat Usage Commands Usage $ npm inst

DStack 7 Aug 17, 2022
Quiet Peer-to-Peer Donations

Quiet Peer-to-Peer Donations

Arcade City 7 Jun 6, 2022
An Opensource Peer-to-peer Social Network with Zero-Knowledge-Proof based authentication.

HexHoot This is an attempt to create an Opensource Peer-to-peer Social Network with Zero-Knowledge-Proof based authentication. The objective is to dem

Zenin Easa Panthakkalakath 6 Dec 28, 2022
A peer-to-peer chat app that is serverless, decentralized, and ephemeral

Chitchatter Logo provided by @ramyashreeshetty Chitchatter is a free (as in both price and freedom) communication tool. It is designed with security a

Jeremy Kahn 714 Dec 19, 2022
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
A map for 1337 Khouribga's new labs clusters. This tool will help 1337 students find available posts, and search for other students in the cluster by name or login.

1337KH Labs Clusters Map Hellow. This tool is made by 1337 Khouribga students for 1337 Khouribga students to help make their lives at the school easie

Oussama 18 Aug 8, 2022
This project is a Web application based on an external API. The API provides data about music (including artists, albums, etc) that users can access on-demand. This project was built with ES6, HTML and CSS and it is a SPA.

Capstone M2: Music App This project is a Web application based on the music API Napster built with ES6, HTML and CSS and it is a SPA. This API provide

Karla Delgado 12 Aug 29, 2022
Motionia is a lightweight simplified on demand animation library

The Ultimate & smart JS animation library! Simple fast , flexible & easy to integrate. No need to write page long CSS Keyframes that consumes a lot of

Abhi 324 Dec 30, 2022
On-demand runtime webpack compilations over HTTP.

webpack-http-server On-demand runtime webpack compilations over HTTP. Overview This package is, effectively, an Express server that exposes webpack co

Artem Zakharchenko 4 Oct 20, 2022
Suck a DAG out of a peer in the IPFS network.

dagula Suck a DAG out of a peer in the IPFS network. Install npm i dagula Usage import { Dagula } from 'dagula' import { getLibp2p } from 'dagula/p2p

Alan Shaw 11 Nov 2, 2022
A robust, minimal-server-interaction API for peer routing in the browser

Robust, minimal-server-interaction peer routing in the browser What is this? Membrane takes signalling to the browser, creating living peer networks.

Elijah Bodden 13 Jan 6, 2023
Group together Tailwind CSS modifiers like focus, peer-checked, dark:hover and more with HTML attributes 👩‍🚀

Tailwind CSS Group Classes Group together Tailwind CSS modifiers like focus, peer-checked, dark:hover and more with HTML attributes ??‍?? Using with a

Mark Mead 5 Sep 15, 2022
LearnR is an educators application that aims to bring together students and teachers on the community platform.

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

Emerenini Cynthia Ngozi 0 Sep 5, 2022
A platform designed specifically as an additional layer on top of Google Classroom for students to gain the best out of online evaluations

Peer-Learning-Platform A platform designed specifically as an additional layer on top of Google Classroom for students to gain the best out of online

Rahul Dhakar 3 Jun 12, 2022
ALU Map is a web-based platform that will help students move around ALU Rwanda Campus.

ALU-MAP ALU Map is a web-based platform that will help students move around ALU Rwanda Campus. Introduction Please refer to CONTRIBUTING.md for contri

null 5 Oct 25, 2022
GetOsLocalesCrossPlatform - A cross platform alternative to get locales used on the platform. Works on Node, Electron, NW.js and Browsers

getOsLocalesCrossPlatform A cross platform alternative to get locales used on the platform. Works on Node, Electron, NW.js and Browsers This script is

null 1 Jan 2, 2022