code-corps / deprecated-code-corps-rails-api Goto Github PK
View Code? Open in Web Editor NEWRails API for Code Corps.
Home Page: https://codecorps.org
License: MIT License
Rails API for Code Corps.
Home Page: https://codecorps.org
License: MIT License
post_type
specific? Role-specific? Project type specific? We need to flesh this out.We should be able to paginate the posts since there may be quite a number them.
We should be able to handle Markdown on Comments.
We want to add validation for profanities using the obscenity gem.
@joshsmith See title
We need to consume GitHub repos in Project information, at least on the individual project pages.
We need to POST
to create a Post
.
A Project
should have a:
title:string
description:string
A Post
model is the main activity point in the app. These are of at least a few types: Idea, Issue, Progress, and Task.
Every Post
type except for a progress post has a boolean status
of open
or closed
to indicate whether it should show up in the main list of posts. This will help declutter everything, similar to how GitHub works.
A Post
should belong to both a Project
and a User
.
When retrieving an individual project, we should get the posts that project has.
We should POST
to create comments on a post.
We should be able to handle Markdown on Posts.
We want to retrieve contributors with a project.
We should have a counter cache column for the number of contributors to a given project.
We want a Skill
model that includes a title:string
and a category
. For example, Ruby
is in the Development
category.
A user should be able to post a short text-only biography.
A username and slug should be allowed to have any \w
word character: an underscore, a letter, or number. It can also have hyphens, as long as the username/slug does not begin or end with it.
A regex like this will probably work: ^[\w](?:[\w_-]*[\w])?$
for validations.
We need to add the ability to reset a password by:
We need a model that includes a title
, organization
, repository name
for a GitHub repository. A project should be able to have many of these.
Not sure what the proper name for this is.
We'd like to add the ability to @mention at some point. This will require an includes
for a project's user for any Post
, since we need to be able to quickly reference a list of associated users for the project.
We need to implement something like what's implemented here: http://blog.arkency.com/2014/01/short-urls-for-every-route-in-your-rails-app/
You would hit api.domain.com/:slug
and render either a User
or an Organization
. Since there are more users than organizations (i.e. a likelier hit), we should find users first, and then query for organizations before rendering a 404.
A user should be able to @mention users in both a Post
and a Comment
.
We need a Contributor
model that relates a User
to a Project
, with some metadata like their status in the project (admin, etc). We should look to GitHub for a good set of statuses.
We want to see the projects a user is a contributor to.
A UserSkill
model needs to relate to User
and Skill
.
We need to GET /projects
so we can retrieve a list of all them.
This should be an endpoint for contributors.
A PostImage
or CommentImage
should be able to be uploaded as a Base64 encoded file. We'll take the original filename and save that.
We'll be replacing the first occurrence of a string like ![Uploading wx4VIGt.jpg…]()
in the client-side with the actual URL of the image. I tested this on Github and if you paste that string and then drop the file in (which generates that string again), it will replace just the first instance of it, every time.
We can create a reference to a post or comment with this model as belongs_to
, but it will never be used in a has_many
. We should also probably make it belongs_to
a User
.
The image processing will need to be asynchronous as usual, but we'll have to subscribe to some async stream for it. I think some minimal resizing down should probably be done.
The URL string should absolutely have the ID of the post or comment and the ID of the image. If we ever change URLs, we may have to rely on this (with some downtime) to do URL replacement in our markdown
and body
text.
But we should be trying to make these URLs as immutable as possible.
This is what they look like at the moment:
def render_no_such_email_error
render json: {errors: {email: ["doesn't exist"]}}, status: 422
end
def render_could_not_reset_password_error
render json: {errors: {password: ["couldn't be reset"]}}, status: 422
end
I believe these should be replaced either by initializing a ActiveModel::Errors
object (so we just serialize them as validation errors), or we should define our own custom errors and have the serializer serialize those.
We want the ability to "like" posts, so we need a way for users to like them. There should probably be a counter cache column for this as well.
We should be able to update user information.
https://github.com/elabs/pundit
The existing model needs to be switched, so we can start implementing the Contributor model in #12
A user should be able to enter their Twitter handle.
We need a GET /project
endpoint for an individual project.
A user should be able to link to their website. Add standard validations for URLs.
We need a GET
/user endpoint so we can have user profiles.
We need to add an endpoint for logging in with email and password.
A Comment
should belong to a User
and a Post
. It should have a body
and a timestamp
of some sort.
We should have an icon created with Paperclip in S3 that's hosted through CloudFront.
What is the user interface like in this case? Do we select a skill from a dropfdown/auto-complete when adding it to our profile, or are we also able to create a completely new skill?
The API should return an error body to the client application that provides some useful information for error handling on the user's side.
We should be able to see a user's skills on thier profile.
We need an endpoint for managing a user's skills. It should ideally handle:
POST
DELETE
PUT
Initially, I thought it should be GET "/skills"
, but now that I think about it, since we do have skill categories, we should probably have a GET "/skill_categories"
, with an include of skills.
That way, through an autocomplete feature, we could fetch the data in a hierarchical form. It could go either way, though.
Set up https://github.com/flyerhzm/bullet to detect existing (and potential future) N+1 queries and fix them.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.