Prehave

Show contributions to projects you worked on


https://prehave.com

Leonard




Updates

API based interface is live

Good news! The API based interface for Prehave is now live.

How does it work?

I've made a v1 API interface available to any registered user. To get started, go to the new API docs here.

The API docs have three parts:

  • Session generation: The key to creating an authentication token based on your account. This contains instructions on using your existing username/password or using the new API token/secret combination.
  • User projects: This is the endpoint for querying and creating new projects.
  • Project progress/updates: This is the endpoint for querying and creating new updates on your projects.

Getting started

I suggest if you are getting started with the API, you should create an API token/secret. This is the most secure way to interface with the API.

You can create a API token here. The link for creating an Prehave application for token/secret access is on your user dashboard.

Once you have a token/secret pair, you can use the Session endpoint to query for a account token. The account tokens are generated to your user account, so you can only have one active authentication token per account. This means if you login using your user credentials, you will disable any other authentication tokens that are active. Vice-versa, if you use a token/secret pair to authenticate using the API, you will disable any previously setup authentication tokens.

Details on the API requests for getting an access token can be found here. Examples are posted as CURL requests, but can be duplicated in any format that works for you.

Next

Once you have a authentication token, you can use the project and projectprogress endpoints. The project endpoint will return a specific project or allow you to create a new project. The projectprogress will give you the same ability.

Currently there is no delete or update functionality through the API. Only create and query.

You can find the details for User Project and Project Progress.

Example

If you want to simply use your login credentials, you can. Below is an example of how to get your authentication token, create an application, then make an update on it.

Please note: If you copy these examples, you must update the values for passwords/tokens/ids.

Get authentication token using login credentials


curl -X POST --data '{"user_login": {"email": "[email protected]", "password": "[email protected]"}}' https://prehave.com/api/v1/sign-in

Response

```

{"auth_token":"7640480c0edd6ce2f1a70e68c590e39e"}

```

Now that I have an auth_token, I can use this to make a POST request and create a new project.

Create project using auth_token


curl -H "Content-Type: application/json" -H "Authorization: Token token=7640480c0edd6ce2f1a70e68c590e39e" -X POST -d '{"user_project":{"name": "Prehave","one_liner": "Simple websites for side projects","description": "Users can make updates to a public feed that can be used to showcase their project.","homepage": "https://prehave.com"}}' https://prehave.com/api/v1/user_projects/

Response


{"status":"Success","details":"Project was successfully created.","data":{"id":54,"name":"Prehave","description":"Users can make updates to a public feed that can be used to showcase their project.","owner_id":1,"created_at":"2017-04-05T19:22:01.250Z","updated_at":"2017-04-05T19:22:01.250Z","status_type":null,"project_image_id":null,"one_liner":"Simple websites for side projects","slug":"prehave-02617020-092a-429a-ac1e-9c6a8f71ad36","visit_id":1,"homepage":"https://prehave.com"}}

After you create your project, you will want to note the date.id value. This will be key for creating new project progresses.

Create project update using authtoken and projectid


curl -H "Content-Type: application/json" -H "Authorization: Token token=7640480c0edd6ce2f1a70e68c590e39e" -X POST -d '{"project_progress":{"project_update": "This is a curl based update"}}' https://prehave.com/api/v1/user_projects/54/project_progresses/

Response


{"status":"Success.","details":"Project progress was saved.","data":{"id":113,"project_id":54,"project_update":"This is a curl based update","created_at":"2017-04-05T19:25:42.594Z","updated_at":"2017-04-05T19:25:42.594Z"}}

Thats it

There you go, that's it! Now you know how to make API based updates and changes.

Planing something interesting?

Please let me know what kind of projects you plan to make. I'd love to see how each of you use this functionality.

I need your help

I'm a bit stuck on what to develop next. A few thoughts here:

  • Github integration to pull in commits.
    • This will give a ping back to Prehave and provide a way to keep users engaged.
  • Private by default project structure.
    • Create the ability for users to require an approval to follow a project.
  • Follower engagement tools.
    • Rather than creating something that is just one-way communication, create a way for the project followers to reply.
  • Discovery tools.
    • Create a way for projects to be more discoverable.
  • Project/post tagging.
    • Create a way for keywords to be extracted from posts. Allow for projects to be cross discoverable based on their similarities.

Please shoot me an email if you have any thoughts!

[email protected]

Email updates

I integrated two more emails for overall user experience.

  • Email subscription notification: When someone subscribes to your project for updates, you will now get an email.
  • Subscription confirmation: When a subscriber requests to follow a project, they will now get a confirmation email.

These emails should help engage your subscribers and will better engage project owners. My goal is to create a healthy back-and-forth for followers of projects. The more users post, the more people will come to their project. The more people come to see a project, the more the owner will be incentivized to post updates.

Email subscriptions are up

The Subscribe to project button on each project page is now functional. A person interested in following a project's updates can now add their email address to get email updates. Whenever a project posts an update, subscribers will get an email with the update and a link to the project.

See the email below:

Email updates

I was able to get an email vendor setup with Prehave today. I was initially planning to use Mailgun because I thought they had a high free tier for email delivery. Once I tried setting it up, I ran into too many problems and ended up using Sendgrid.

I designed the welcome email that should be sent to users after they register. I know how important the post-registration emails and drip process will be, so I designed a solid template.

See the first welcome email users get below:

Styling

I fixed up the styling around the links and code blocks.

Dashboard

Made updates to the dashboard UI. Displaying user updates in reverse cron across projects.

We now have Markdown support!

Open up the project edit page to see the full edit screen.

See below:

example

Had issues with changing the database schema for old users. Old users were having issues viewing the dashboard. Problem is now resolved.

I've added two new features that I think are going to be useful. First, based on the recommendation of a new user, I created a greater emphasis on the 'update'. Second, I built out the backend for parsing stats, as seen in the top navigation.



Adding all of my personal projects as a testing set. Looking at how the thread between applications helps discover what does/n't work.

Create the scaffold for the site using an old project.

Designed the project pages to be update focused.

Adding sparkline graphs to show contributions.

Decided to add user profiles and move the focus to quickly groking the project contributions.

Very meta. Im making an update about this project on this project.