This is a Next.js project bootstrapped with create-next-app
.
-
After cloning the repo, install dependencies.
npm run install # or yarn install
-
Connect typeorm with a postgres database. For now, create a local postgresql instance and a
.env
in the root folder. This file will contain sensitive data required to interact with external APIs like Google Auth or Github Auth. Then, setup local databases with psql:
npm run db:setup
# or
yarn db:setup
-
Inside the
.env
file add,TYPEORM_URL={Your-Database-Url-Here}
for localhost, this url will look something like:postgres://admin:admin@localhost:5432/writzsol_dev
-
Add additional TYPEORM env. variables to your
.env
file:APP_ENV="LOCALHOST" NEXT_PUBLIC_SITE_URL="http://localhost:3000" TYPEORM_ENTITIES="../../../lib/graphql/server/models/**/*.ts" TYPEORM_MIGRATIONS="../../../lib/graphql/server/migrations/**/*.ts" TYPEORM_SUBSCRIBERS="../../../lib/graphql/server/subscribers/**/*.ts" TYPEORM_ENTITIES_DIR="../../../lib/graphql/server/models" TYPEORM_MIGRATIONS_DIR="../../../lib/graphql/server/migrations" TYPEORM_SUBSCRIBERS_DIR="../../../lib/graphql/server/subscribers"
-
Run typeorm migrate:
yarn db:migrate:local && yarn db:migrate:local:test
-
See more about what is needed for the '.env' file here: https://next-auth.js.org/getting-started/example. You may need to get a secret & client_id from both github and google. However, Github is the easiest clientId & secret to create.
OR
If you have access to our vercel deployments, simply run the vercel CLI command:
vercel env pull
and type in http://localhost:3000
as the NEXTAUTH_URL for development in the generated .env
file.
-
Run the development server:
npm run dev # or yarn dev
-
Open http://localhost:3000 with your browser to see the result.
Using tools like prettier, eslint, & husky will help keep clean looking code for every commit. However, we need some conventions for managing changes on GitHub.
Generally, titles in GitHub will be all lowercase using dashes -
to represent spaces.
- feat-*-{issue_id} denotes a feature branch where * is the feature's name
- poc-*-{issue_id} denotes a Proof of Concept (POC) branch where * is the POC's name.
- bug-*-{issue_id} denotes a branch used to fix a bug/issue; where * is the bug's title.
- misc-*-{issue_id} denotes a miscellanous branch where * is a short description.
Once each branch's purpose has been fulfilled, a pull request to the main branch is created. This request is then reviewed and, eventually, marked as ready for merge. During merge, all commits will be squashed to represent the feature title. Finally, vercel will automatically run a new deployment.
- feat-* identifies a feature, providing all necessary information for implementation.
- bug-* identifies a bug within the application, providing any screenshots or context detailing the issue.
- poc-* identifies a Proof of Concenpt (POC) that should be completed before implementing a feature.
- Further conventions for Issues may developed as time goes on.
-
To learn more about Writzsol, checkout our wiki hosted on Github.
-
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
We are using vercel to host our application during development. Check it out here: https://writzsol.vercel.app