All Projects → charliewilco → downwrite

charliewilco / downwrite

Licence: MIT license
✍️ Markdown writing application that's down right, neat.

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to downwrite

Gatsby Starter Procyon
An opinionated Gatsby starter designed for trash-eating pandas.
Stars: ✭ 88 (-14.56%)
Mutual labels:  apollo, draft-js
graphql-blog-client
🚀 React Apollo client for a GraphQL blog.
Stars: ✭ 15 (-85.44%)
Mutual labels:  apollo, draft-js
hasura-node-monolith-example
Example of a monolithic web application using Hasura GraphQL Engine + Node.js + Next.js
Stars: ✭ 25 (-75.73%)
Mutual labels:  apollo
webpack-everything
Vue cli template with webpack, vuex, vue router, eslint, image compression, graphql, apollo, server side rendering, code splitting and progressive web app (PWA) capabilities
Stars: ✭ 19 (-81.55%)
Mutual labels:  apollo
instagram-clone
Instagram clone using apollo, react and graphQl (hasura-graphQl engine)
Stars: ✭ 44 (-57.28%)
Mutual labels:  apollo
nest-next-sample
NestJS + Next.js sample application / Backend and Frontend use only TypeScript!!!
Stars: ✭ 110 (+6.8%)
Mutual labels:  apollo
GitHunt-Polymer
An example of a client-side app built with Polymer and Apollo Client.
Stars: ✭ 13 (-87.38%)
Mutual labels:  apollo
recipes-next-hasura
A lightweight app to explore and create recipes - Built with Next.js, Hasura, and Chakra-UI
Stars: ✭ 30 (-70.87%)
Mutual labels:  apollo
ios-graphql
iOS code examples with GraphQL, Apollo & more
Stars: ✭ 78 (-24.27%)
Mutual labels:  apollo
teamdaily
TeamDaily
Stars: ✭ 15 (-85.44%)
Mutual labels:  apollo
matters-web
Website of Matters.News, built with Next.js.
Stars: ✭ 70 (-32.04%)
Mutual labels:  apollo
bookshelf
My GraphQL playground
Stars: ✭ 64 (-37.86%)
Mutual labels:  apollo
members
Managing People (Members), CRUD with Dashboard
Stars: ✭ 36 (-65.05%)
Mutual labels:  apollo
wagtaildraftail
🐦📝🍸 Draft.js editor for Wagtail, built upon Draftail and draftjs_exporter
Stars: ✭ 23 (-77.67%)
Mutual labels:  draft-js
future-of-gql-servers
The future of GraphQL servers (GraphQL Europe 2018)
Stars: ✭ 27 (-73.79%)
Mutual labels:  apollo
react-chat-app
A real-time chat application with Node.js, Prisma, GraphQL, Next.js, React.js and Apollo.
Stars: ✭ 61 (-40.78%)
Mutual labels:  apollo
ctrip-apollo
The most delightful and handy Node.js client for ctrip apollo configuration service.
Stars: ✭ 56 (-45.63%)
Mutual labels:  apollo
react-native-instagram-clone
Instagram Clone (light version) — Graphql + React (ios, android, web)
Stars: ✭ 29 (-71.84%)
Mutual labels:  apollo
apollo-client-ws
GraphQL WebSocket Network Interface for Apollo Client
Stars: ✭ 13 (-87.38%)
Mutual labels:  apollo
boilerplate
Boilerplate for @prisma-cms
Stars: ✭ 22 (-78.64%)
Mutual labels:  apollo

Downwrite

Node CI E2E Testing

About 🤔🦄🎉

A place to write. ✍️

So the idea here was simple build a simple markdown writing application. Markdown is a huge deal and all the cool tools kept getting shut down and naively,I thought, how hard can this really be? 🤔📝📦

So I've had poorly designed iterations of this thing for every year, on the year as one of these services got shut down. When Canvas shut down this last year, I started to get a little more serious about this idea. 💡 🔭

During planning out some of my quarterly goals at my last job I decided to go a little more full-stack with Node and start to really work through the process of building a microservice. Since I'm never really one to learning languages and frameworks in the abstract, I decided to take up Downwrite as an excuse to build those microservices. 📡💸🌎

Why Markdown 🧐🤨📋

Markdown is probably the most efficient and universal tool for conveying syntax, semantics and structure across platforms. ⬇️

Originally coined by John Gruber (Daring Fireball) it was originally conceived as a text to HTML and is the staple of static site generators, OSS as well as a fair amount of comment sections, notetaking applications or any documentation tool. 🛠

These shortcuts are almost as ubiquitous as cmd + b for bold or cmd + i for italics. ⌨️

Bottomline: markdown is data. It is a method for describing semantics of data and is data itself.

Features 🔥🚀

This is meant to be a simple writing application with some key features:

  • Write wherever you are in markdown
  • Share what you've written if you want
  • Upload a markdown file from your machine
  • Export to a static markdown file for your blog, etc.

Setup 📲⚙️

This project uses Node (v12.18.x), TypeScript and pnpm.

brew cask install pnpm
pnpm install

Personally use fnm to manage my node versions.

fnm install
fnm use

Environment

To get started create an .env file in the root of your project with the following

SECRET_KEY="SECRET SECRETS ARE NO FUN"
CURRENT_DB_ADDRESS="127.0.0.1:27017/downwrite"

Client ⚡️🦊

Logos for Related Projects

Setup

Run in your terminal from the root of the project.

pnpm dev

Open http://localhost:3000 in your browser.

UI 📝

This is the client-side of the application, it uses Next.js and is a pretty stock implementation of how Next handles routing to different views. 👨‍💻🤜🦑🤯

Downwrite needs to server side rendered to make sharing an entry as easy as possible. Next.js' data-fetching API makes it the perfect candidate. So when the page calls getServerSideProps() it fetches the data directly from the database (DB creditentials aren't exposed to the client build at all because of the bundling features inside Next 😁) and for the initial render it has data available instead of a skeleton screen. 🤖☠️💀

For the Editor this project uses Draft.js and Draft.js Plugins. Markdown syntax is used inline and autogenerates the related rich text _hello_ becomes "hello" as you type.💻⌨️🔏

For styles I just used the built-in CSS support in Next.js

Serverless Functions 🌎

To update the data, this project calls endpoints at /api/.... to enable this we're using Next'js API Routes. These are serverless functions so we don't need to keep a server or database connectioin running all the time, with serverless functions you're essentially calling the API on-demand.

This project also depends on MongoDB 🍍 for data persistence, you should see this gist on how to setup MongoDB on your machine.

To authenticate we're using JWT to call the basic CRUD functions. Basically this is using a stateless auth model, more about that here. 🔐

Related Documentation 📚

Integration Testing 🌈🦁🐛

Logos for Related Projects

pnpm test

Info 📝🧪

Short hand: page is just a representation of whatever the headless browser, Puppeteer has rendered at that given moment.

Using Puppeteer I write assertions like this:

describe("Feature", () => {
  it("does this thing", async () => {
    await page.waitForSelector("#selector");
    await page.click("#selector");
    await page.waitForSelector("#other-selector");
  });
});

This approach accomplishes two things:

  • Ensures if an await statement errors or catch() the block will cause a failure
  • Makes the test sequential and simpler to write

Related Documentation 📚

Workflow 👷‍♀️🚧

Working on this project it uses GitHub actions to run the tests and deploys using vercel for easy rollback and immutable deployments.

License ⚖️💣🛡⚔️

MIT License

Copyright (c) 2022 Charlie Peters

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].