arobson / Upward

open source project for the tech community - let's learn from each other

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

heroku-next-postgres

This is a Next.js project bootstrapped with create-next-app.

Contributing

Technologies we use

If you want to use another type of package, please check with us on our slack channel

First, install the project dependencies with npm

Install the dependencies for the project with npm which is a shortcut for npm install. npm is a package manager that downloads packages from the npm Registry of open source packages that can help with many development tasks from compiling your React app so that it downloads faster for users to converting time between timezones or replacing words written in English into Spanish, Swahili, or Mandarin.

You'll need to run npm (or npm install) often to keep up to date with the npm packages other people may be adding to the project or updating to keep the site secure. You can't run npm too many times so don't worry about that; once a day is a good habit, and if the app won't start start for some reason running npm to make sure your dependencies are up to date is always the first step in troubleshooting to fix things.

Next, run the database migrations

Create a .env file and add:

DATABASE_URL="postgres://bajeonmlxpbfdq:bbe0a9d989587bb4c4b66aac1c3e4c0af75f8347c0b6128e1bb7d2a8fbc213d7@ec2-3-214-136-47.compute-1.amazonaws.com:5432/d1p1l0ndqdjtj4"

We use prisma as an ORM to postgres to connect directly to the database. See example in index.tsx

Download the prisma studio to connect directly to the heroku database:

For development: we use prisma to connect to a heroku database on staging

npx prisma generate

Finally, run the development server

Run npm run dev, then open http://localhost:3000 with your browser to see the result.

Where things are in the app

You can start editing the home page by modifying pages/index.js. The page auto-updates as you edit the file.

API routes can be accessed on http://localhost:3000/api/hello. This endpoint can be edited in pages/api/hello.js.

The pages/api directory is mapped to /api/*. Files in this directory are treated as API routes instead of React pages.

Preparing for a Pull Request

TK note about mentors helping every step of the way as requested, invitation to ask lots of questions in Slack, read other people's code in code reviews, etc.....

All of these steps can be run in a single command: npm run ci-at-home if you want to know ahead of time if a pull request will pass the checks.

Linting Your Code

We use Prettier to keep the code uniform and easy to read following the StandardJS Styleguide . You can check if your code will pass our testing system's linting step by running npm run lint (which in turn runs npx prettier .). If the code doesn't pass you can fix many linting errors with npm run format (npx prettier --write).

On the Prettier website you'll find lots of information about plugins and extensions you can install for your text editor (we recommend Visual Studio Code) that will automate styling your code when you save or as you type, and don't forget about npm run format.

Creating a Pull Request on GitHub

Advanced Features

Typescript

Types Provided By NextJS

Alice: It's really difficult to use typescript half way.... I'm gonna have to think about this one

Learn More

To learn more about Next.js, take a look at the following resources:

You can check out the Next.js GitHub repository - your feedback and contributions are welcome!

Node Resources:

React Resources:

Styles

About

open source project for the tech community - let's learn from each other

License:GNU General Public License v3.0


Languages

Language:TypeScript 95.8%Language:SCSS 2.8%Language:Shell 1.4%