/journaly

A foreign language journaling application.

Primary LanguageTypeScript

Journaly

Welcome to the Journaly repository!

A foreign language journaling platform for exchanging feedback with native or advanced speakers and building community around shared interests and languages.

Why?

We believe that WRITING is perhaps the most undervalued and under-utilized activities for improving foreign language skills. Some major reasons for this are:

  • Writing is relatively effortful and practicing it consistently requires building a habit around it.
  • It is hard to find people to give you feedback.
  • Even once finding someone, figuring out how best to give someone feedback isn't obvious and takes a lot of effort.
  • Once you get feedback from soneone, it isn't easy to actually apply, store, organize, and keep track of it over time.

Journaly is about striving to build excellent software with beautiful, simple, and intuitive User Interface & User Experience Design that solves each of the above problems for our users:

  • We make the writing experience delightful, enjoyable, and easy to engage in; helping users build healthful and sustainable writing habits.
  • We make it incredibly straightfoward to find people to provide users feedback. In fact, users just have to write and the community finds THEM.
  • We build intuitive tools that make it incredibly easy to sweep through someone's post and give them feedback exactly where it belongs.
  • Feedback stays neatly organized and is easy to digest and find again later.

Architecture

Journaly consists of multiple independent services/packages that are all deployed separately. We manage the deployment of these services with our own Cloud Infrastructure in Amazon Web Services (AWS).

Here is an overview of the project setup:

|-- journaly/
|---- docs/
|---- cypress/
|---- packages/
|------ web/ # Our core application that users engage with on the web
|------ j-mail/ # An application handling transactional email via a messaging queue and scheduled jobs against the DB
|------ j-db-client/ # A database client that can be imported into any service to interact with the db
|-------- schema.prisma # our database schema
|-------- migrations/

More detailed documentation can be found within each directory (WIP).

Getting Started (in progress)

Initial Setup

  1. Clone the repository!
    $ git clone git@github.com:Journaly/journaly.git
  2. Locate the .env.example file and copy the contents into a new .env file alongside it.
  3. Navigate to packages/web
  4. Run npm ci
  5. Run npm run build

Setting Up Your Local DB Instance

  1. Install Postgres
  • For Mac users, we recommend using Homebrew. Linux users will probably want to use your distro's postgres package manager Note that this set your Postgres DB to run when your computer starts up and will stay running in the background.

    $ brew install postgres
    $ brew services start postgresql
  • Windows users should download and install Postgres from postgresql.org.

  1. Start up your Postgres shell and create your user

    $ psql postgres
    $ create user <your_username> with createdb password '<your_password>';
  2. Create your local instance of Journaly DB and give your user permissions

    $ create database journaly_db;
    $ alter user <your_username> with superuser;
  3. Update your .env file with your new postgres username & password. Copy and paste your root .env into j-db-client/prisma/.env. You should end up with two of the same file, one in root and the other in j-db-client.

  4. Finally, from the packages/j-db-client directory, apply database migrations to your new database instance:

    $ npm run migrate:up

    You've got a local Journaly PostgreSQL DB, woohoo! 🎉

Useful Commands For Working With Your DB

NOTE: All DB commands/scripts are run from within the packages/j-db-client directory. Detailed documentation can be found here

  • Start up your psql journaly_db shell: psql <your_db_url>
  • Wipe out the database, and reinsert the seed data: npm run reseed-db
  • Update the generated GQL queries/mutations for use on the front end: npm run codegen

Running Journaly

  1. To run the entire app in local development mode, simply run npm run dev from the root of the project!
  2. Let's seed that baby DB! From the root of the repo, run npm run reseed-db

BOOM! You now have some users, along with a wee selection of posts :)

NOTE: the playground is currently not working, we are working on fixing this. This doesn't impact your ability to work on the project

To marvel at the results, go to http://localhost:3000/api/playground and try the following query:

query feed {
  feed(Published: true) {
    Id
    Title
    Body
    Published
    author {
      Id
      Name
      Email
    }
  }
}

More Helpful Docs

  1. Debugging Journaly With VS Code
  2. Creating New Pages
  3. Internationalization - i18n
  4. Event Tracking
  5. Working With Images
  6. E2E Tests

Contributing To Journaly

If you'd like to become a contributor -- awesome! Please read our contributing guide to get started :)