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.
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 someone, 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 straightforward 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.
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).
- Clone the repository!
$ git clone [email protected]:Journaly/journaly.git
- Locate the
.env.example
file and copy the contents into a new.env
file alongside it. - Navigate to
packages/web
- Run
npm ci
- Run
npm run build
-
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.
-
-
Start up your Postgres shell and create your user
$ psql postgres $ create user <your_username> with createdb password '<your_password>';
-
Create your local instance of Journaly DB and give your user permissions
$ create database journaly_db; $ alter user <your_username> with superuser;
-
Update your
.env
file with your new postgres username & password. -
Set the env var
DATABASE_URL
to be the value in your.env
file (the server will consult the.env
file but for standalone scripts, you must set the environment variable). This looks like:export DATABASE_URL='postgresql://<user>:<password>@localhost:5432/<db_name>'
-
Seed the database with:
$ npm run db:seed
BOOM! You now have some users, along with a wee selection of posts :)
-
Finally apply database migrations to your new database instance:
$ npm run migrate:apply
You've got a local Journaly PostgreSQL DB, woohoo! ๐
- Start up your psql
journaly_db
shell:psql <your_db_url>
- Take a snapshot of the DB's current state:
npm run db:snapshot
(createssnapshot.sql
) - Restore your database to exactly the state captured in
snapshot.sql
:npm run db:restore
- Update the generated GQL queries/mutations for use on the front end:
npm run codegen
The seed script contains a handful of test users and posts to cut down on data creation efforts. Here are some users you can log in as:
ID | Password | Description | |
---|---|---|---|
1 | [email protected] | password | Administrator account |
2 | [email protected] | password | Moderator account |
3 | [email protected] | password | Standard user with indefinite premium subscription and posts. Kind of our "kitchen sink" account. |
4 | [email protected] | password | Standard user with comments and posts, no premium subscription. |
To run the entire app in local development mode, simply run npm run dev
from the packages/web
directory!
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
}
}
}
Usage:
npm run grant-free-subscription <user id> <months>
Be sure to set the following env vars:
DATABASE_URL
FREE_PRICE_ID
STRIPE_SECRET_KEY
- Debugging Journaly With VS Code
- Creating New Pages
- Internationalization - i18n
- Event Tracking
- Working With Images
- E2E Tests
If you'd like to become a contributor -- awesome! Please read our contributing guide to get started :)
If you'd like to help translate Journaly into your native language, we'd love to have your help! Head over to the translations site to get started.