Giter Site home page Giter Site logo

fairfield-programming / backend-server Goto Github PK

View Code? Open in Web Editor NEW
26.0 2.0 14.0 21.95 MB

๐Ÿ“  The backend of the Fairfield Programming Association website.

Home Page: https://fairfieldprogramming.org/

License: MIT License

JavaScript 97.00% HTML 2.85% Dockerfile 0.15%
node nodejs node-js nodejs-server server http-server http backend javascript authentication

backend-server's People

Contributors

djsiddz avatar fairfield-programming-bot avatar github4maninder avatar jls47 avatar joel-strand avatar massigy avatar neilchaudhari avatar nikitalejnev avatar william-mcgonagle avatar yasamnoya avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

backend-server's Issues

Revamp Duck Generator System to Allow for Direct Import of SVG

Idea

Currently, the duck system is a little stupid. I designed it so that it would work well with a low number of items, but I have started to realize that people want more and more things to choose from. That is why I have to rebuild the duck system from the ground up.

  1. To do this, I need to first create a new storage format for the duck information, that will be pretty easy, I just need to figure out how it will look. Information about that will be in this issue.

  2. From there, I need to build a parser to interpret the storage format. Information about how the parser is going to work will be in this issue.

  3. After that, I want all of the duck items to be stored in a very simple way. For this, I am thinking maybe to do a server or just read from the file system directly. I am not quite sure yet, but information about that will be in this issue.

  4. And finally, I need to build a system for generating the final duck SVG from the duck items (Todo 3) and the duck storage format (Todo 4). Information about the duck SVG generation system will be in this issue.

Todo

  • General
    • Build Basic SVG Parser
    • Build Duck Format Parser
    • Build a System for Generating Duck SVG
    • Figure Out How to Store the Duck Items
  • Testing
    • SVG Library Testing
    • GET /duck
    • GET /duck/:id
    • GET /duck/:id/:zoom
  • Endpoints
    • GET /duck
    • GET /duck/:id
    • GET /duck/:id/:zoom

Create an Endpoint to Follow a User

Idea

Full Idea Here - #45

There are currently endpoints being worked on that let users see who someone is following and who they are followed by, but there needs to be an endpoint for following someone.

The endpoint path will be /user/:id/follow and it will be accessible using a post request. It will need to require authentication to determine the user id, and it should properly handle all edge cases (user doesn't exist, not logged in, etc).

Todo

  • Auth Required for Endpoint
  • Endpoints
    • POST /user/:id/follow
  • Testing
    • POST /user/:id/follow

Add a Friend System

Is your feature request related to a problem? Please describe.
Users want to be able to interact with one another but they are not able to if they cannot friend each other. This system would also let us build a chat system and other features later on.

Describe the solution you'd like
We could add in a friend system to the server by using the sequelize relationship system. That would let people friend each other and accept friend requests.

Describe alternatives you've considered
I've considered doing a system like the one that Github and Instagram has where you can follow people and then they can follow you back. I think that this system would be much simpler to implement.

Additional context
I will link some other issues here on what we need to do to accomplish this.

Delete Accounts

Idea

Users might not want their account after a certain amount of time. If a user deletes their account, all of their user data should be deleted along with any data that they created. This means that any chats they participated in, any events they RSVP'd to, etc, will be deleted.

Todo

  • Deleting account deletes all data
  • Endpoints
    • Delete Account Endpoint (need to be logged in, and password is required)
  • Testing
    • Delete Account Endpoint

User System

Idea

The user system needs to be robust and yet simple. The main features behind it will be the biographies, status, and profile pictures. The profile picture system was already completed, so to finish it off, all I will need to do is link it using URLs. Then, I need to add a biography system, and I might want to force users to not use bad language (so I may have to build a new library for that). And then finally, the statuses will require their own endpoint because they are more 'real-time' than the other endpoints.

Todo

  • Create a List of Vulgar Words
  • Build Vulgar Detection Library
  • Force Authentication on all Endpoints
  • Endpoints
    • Set Status
    • Get Status
    • Set Account Data
    • Get Account
  • Testing
    • Set Status
    • Get Status
    • Set Account Data
    • Get Account

Add Documentation to Vulgar Detector

Idea

The backend server is getting huge, but we do not have a ton of documentation. This is a huge problem because there are people that would like to work on the project but are not sure where to start or what our code does.

One of the parts of our system that is relatively unknown is the vulgar detector. I had to build this system to check all of the biographies and posts, and it works quite well at the moment (that's beside the point). We need to add some basic documentation that describes how the vulgar detector works and how to use it.

You can find the code for the vulgar detector here, and it should be readable. If you would like to do this, comment below, and I'll assign you to the issue.

Todo

  • Document the GetVulgarWords() method
  • Document the TokenizeString() method
  • Document the DetectVulgarWords() method

Create an Endpoint for Blocking a User

Idea

Full Idea Here - #45

Right now we are working on a friend system, but what would a friend system be without the ability to block users. That is why we need to add an endpoint for blocking users.

The path of the endpoint would be /user/:id/block and the only way to access it would be through a post request. Proper authentication is needed for this endpoint, and if the user is already blocked, the server should tell the client this.

Todo

  • Endpoints
    • POST /user/:id/block
  • Testing
    • POST /user/:id/block

RSVP System

Idea

The RSVP system should allow users to subscribe to events. This subscription will say that a user is going to go to a certain event. The user should not be able to subscribe to the event if they are not eligible to (I.E, the event is for delegates but the user isn't one). The users will then be notified of any changes to the event or anything that the event hosts would like the users to know.

Todo

  • Allow Users to Subscribe to an Event
  • Block Users from Subscribing if not Eligible
  • Add Email Alerts for the Event
  • Allow Users to Unsubscribe from an Event

Need Testing for Duck Jokes

About

I finished the whole duck joke system but I first off need to refactor it so that it supports indexing. And then secondly, I completely forgot to add a test suite for the jokes.

I wish I could test if the duck puns were funny or not, but I'm pretty sure all of the tests would fail.

Todo

  • Refactor Duck Joke System
    • Build using File System
    • Create a Central Lib File (similar to SVG duck system)
  • Add Endpoints
    • To Get Joke Count
    • To Get a Random Joke
    • To Get Joke at Id
    • To Get All Jokes as JSON Array
  • Add Tests
    • To Get Joke Count
    • To Get a Random Joke
    • To Get Joke at Id
    • To Get All Jokes as JSON Array

Add Fairfield Programming Association to Github Explore Page

Idea

Right now, the FPA is a fairly young open-source organization that needs help to grow. To do this, we need to get our name heard, so we need someone who is not yet a contributor to our project to help out by creating a pull request on the 'github/explore' repo. Just add the 'fairfield-programming/fairfield-programming.github.io' to this file, and you have helped the FPA immensely.

This file is a list of Github Pages examples, which our repo is.

Todo

  • Add our website repo to the 'open-source-organizations' Readme file

More Duck Item Ideas Needed

Right now there are a couple of hats and eyes that users can add to their ducks, but we need more options.

If you have any ideas for things you want to be added to the ducks, leave a comment below!

Cool Duck

Duck Joke Generator

There needs to be an endpoint that lets people query it and see duck jokes.

Change Password

Idea

Users may have leaked their password online or just need to change it for a number of different reasons. There needs to be some endpoints for changing the user's password. The user must also be logged in to use this endpoint or else it would defeat the purpose immensely.

Todo

  • Allow Users to Change Passwords
  • Users can only change passwords if logged in
  • Password cannot match existing password
  • Endpoints
    • Set Password
  • Testing
    • Set Password

Email Verification

Idea

Users are a difficult part of programming because there are always bad users. Email verification stops users from creating spam accounts and it also lets us determine where groups of spam accounts may be. This is why we need a system for users to verify their emails.

Todo

  • Send Verification Email to Users
  • Add Email Bool to User in Database
  • Restrict User from Actions Until Email is Verified

Add Fairfield Programming Association to Github Explore Page

Idea

Right now, the FPA is a fairly young open-source organization that needs help to grow. To do this, we need to get our name heard, so we need someone who is not yet a contributor to our project to help out by creating a pull request on the 'github/explore' repo. Just add the 'fairfield-programming/fairfield-programming.github.io' to this file, and you have helped the FPA immensely.

This page is for open-source organizations, which the Fairfield Programming Association is, so you would be following all of the correct guidelines by contributing it.

Todo

  • Add our website repo to the 'open-source-organizations' Readme file

Add Friend System to Database

Idea

Full Idea Here - #45

The friend system that we are currently working on needs a database to manage the friend connections. Right now we are using Sequelize, and this should support a full friend system without any problems.

The friend system should support multiple things in one foul-swoop: following, blocking, friend requests, and it should be forward compatible to any future things added in. To do this, the table that stored the relationships between users should have an integer column called type. Depending on the type of relationship, we can determine if it's a friend request, block, or full friendship.

Todo

  • Add Relationships from Users to Users
  • Add a Column that Determines the Type of Relationship

Create an Endpoint to Query Following

Idea

Full Idea Here - #45

Users need to see what accounts they are following. To do this, there needs to be a single endpoint that can just list all of the accounts that a user is following along with the profile picture, name, and account id. This will help our frontend team a lot because only the important stuff will be loaded.

The endpoint will be at /user/:id/following.

Todo

  • Endpoint
    • GET /user/:id/following
  • Testing
    • GET /user/:id/following

Build a System to Store the Duck Items

Idea

Currently, the duck system is a little stupid. I designed it so that it would work well with a low number of items, but I have started to realize that people want more and more things to choose from. That is why I have to rebuild the duck system from the ground up.

  1. To do this, I need to first create a new storage format for the duck information, that will be pretty easy, I just need to figure out how it will look. Information about that will be in this issue.

  2. From there, I need to build a parser to interpret the storage format. Information about how the parser is going to work will be in this issue.

  3. After that, I want all of the duck items to be stored in a very simple way. For this, I am thinking maybe to do a server or just read from the file system directly. I am not quite sure yet, but information about that will be in this issue.

  4. And finally, I need to build a system for generating the final duck SVG from the duck items (Todo 3) and the duck storage format (Todo 4). Information about the duck SVG generation system will be in this issue.

Todo

  • General
    • Build Basic SVG Parser
    • Build Duck Format Parser
    • Build a System for Generating Duck SVG
    • Figure Out How to Store the Duck Items
  • Testing
    • SVG Library Testing
    • GET /duck
    • GET /duck/:id
    • GET /duck/:id/:zoom
  • Endpoints
    • GET /duck
    • GET /duck/:id
    • GET /duck/:id/:zoom

Make Events Owned by Users

Idea

Events are great but they should only be deletable by the person that created them, and they should only be able to be edited by the person that created them as well. This will stop spam users from deleting events that users worked hard to build.

Todo

  • Add a relationship between events and users where users own multiple events
  • Add auth to all of the events so that only the owner of the event can edit it

Automatically RSVP the Creator of an Event

Idea

Just for the sake of efficiency and simplicity, we know that whoever is creating an event is probably going to go to said event. So, we can put that into our API as a default.

Todo

In the 'create event endpoint', the creator of the event should be automatically RSVP'd to the event.

Create an Endpoint to Query Followers

Idea

Full Idea Here - #45

Users need to see who they are followed by, so we are going to add in an endpoint where they can check what users are following them.

The endpoint will be /user/:id/followers

Todo

  • Endpoints
    • Add an endpoint for querying who a user is followed by
  • Testing
    • Test the previous endpoint to make sure it works

Create a New Format for Ducks

Idea

Currently, the duck system is a little stupid. I designed it so that it would work well with a low number of items, but I have started to realize that people want more and more things to choose from. That is why I have to rebuild the duck system from the ground up.

  1. To do this, I need to first create a new storage format for the duck information, that will be pretty easy, I just need to figure out how it will look. Information about that will be in this issue.

  2. From there, I need to build a parser to interpret the storage format. Information about how the parser is going to work will be in this issue.

  3. After that, I want all of the duck items to be stored in a very simple way. For this, I am thinking maybe to do a server or just read from the file system directly. I am not quite sure yet, but information about that will be in this issue.

  4. And finally, I need to build a system for generating the final duck SVG from the duck items (Todo 3) and the duck storage format (Todo 4). Information about the duck SVG generation system will be in this issue.

Todo

  • General
    • Build Basic SVG Parser
    • Build Duck Format Parser
    • Build a System for Generating Duck SVG
    • Figure Out How to Store the Duck Items
  • Testing
    • SVG Library Testing
    • GET /duck
    • GET /duck/:id
    • GET /duck/:id/:zoom
  • Endpoints
    • GET /duck
    • GET /duck/:id
    • GET /duck/:id/:zoom

More Duck Jokes Needed

If you have any duck jokes, feel free to drop a pull request onto the repository or commit directly if you can. Currently, we have a list of the following jokes, but you can always comment jokes that are not on this list and you can leave response emojis on jokes you either like or don't like.

Add Documentation to Duck Generator Library

Idea

The duck generator is a really great system, but the only problem is that there is no documentation for it. All of the code for the file can be found inside of the src/routes/Duck/ folder. This is where all of the code for generating ducks can be found, but it all needs to be documented so it can be easily understood for new members of the project.

Todo

  • Add some information about how duck strings are stored
    • Show what hex numbers mean what
    • This issue has some information about that - #38
  • duckGenerator.js
    • Document the parseDuckString() method
    • Document the getItemString() method
    • Document the generateDuck() method

Add Version Number to Duck Generator to Allow for Forward Compatability

Idea

Pretty much one of the big problems with the duck generator is that there needs to be forward and backward support. Right now, there is not, so I am thinking we should just get rid of the whole system and create something new instead. So, the new format will need to support versioning as a default and all future formats will need to follow that versioning system.

The issue with the information about formatting and where the versioning will actually be implemented is this issue.

Create a Parser for the New Duck Storage Format

Idea

Currently, the duck system is a little stupid. I designed it so that it would work well with a low number of items, but I have started to realize that people want more and more things to choose from. That is why I have to rebuild the duck system from the ground up.

  1. To do this, I need to first create a new storage format for the duck information, that will be pretty easy, I just need to figure out how it will look. Information about that will be in this issue.

  2. From there, I need to build a parser to interpret the storage format. Information about how the parser is going to work will be in this issue.

  3. After that, I want all of the duck items to be stored in a very simple way. For this, I am thinking maybe to do a server or just read from the file system directly. I am not quite sure yet, but information about that will be in this issue.

  4. And finally, I need to build a system for generating the final duck SVG from the duck items (Todo 3) and the duck storage format (Todo 4). Information about the duck SVG generation system will be in this issue.

Todo

  • General
    • Build Basic SVG Parser
    • Build Duck Format Parser
    • Build a System for Generating Duck SVG
    • Figure Out How to Store the Duck Items
  • Testing
    • SVG Library Testing
    • GET /duck
    • GET /duck/:id
    • GET /duck/:id/:zoom
  • Endpoints
    • GET /duck
    • GET /duck/:id
    • GET /duck/:id/:zoom

Build Auth Middleware

Idea

I need to build the middleware for the authorization. Pretty much there will be a bearer token in the authentication header and that will be the JWT token. This will then be checked to make sure that the user has the correct authorization.

Todo

  • Read the Auth Token
  • Set the Req.Auth token to false if not signed in
  • Set the Req.Auth token to be the user data if they are signed in

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.