🎉 Thanks for willing to contribute! 🎉
Working on your first Pull Request? You can learn how from this free videos How to Contribute to an Open Source Project on GitHub.
DevFAQ is organised into a monorepo with Turborepo. You'll find frontend (app) and backend (api) in the apps directory.
- Frontend is written in Next.js (React) with TypeScript.
- Backend is a REST API, and uses Fastify, PostgreSQL, and TypeScript.
- Make sure you have Docker installed and
docker composecommand is available. - Fork and clone the repo.
developis the default branch and you should base your work off of it. - Run
pnpm installinside the repo to install all the dependencies. - Run
pnpm devto start both frontend and backend locally. - In order for everything to work smoothly, you'll need to add two entries to your
/etc/hosts. See Configuring localhost domain section. - Remember to add
.env*files to each app located inappsdirectory. Forapps/apiit will be.env- example file with variables is named.env-exampleand you can find it inapps/api. Forapps/app, example env file is named.env.local-exampleand it is located inapps/app.
DevFAQ uses cookies for storing the session token. The cookie is httpOnly, secure (on production) and sameSite=Lax which means you'll need to run frontend and backend on the same domain for it to work. To do it locally, add the following lines to your /etc/hosts:
127.0.0.1 api.devfaq.localhost
127.0.0.1 app.devfaq.localhost
Now you should be able to access your app at app.devfaq.localhost:3000 and the API at api.devfaq.localhost:3002/.
There are only a few tests and we definitely need more! To run all tests execute the following command:
pnpm test
If you need to run only www or only api tests, you can do it as follows:
pnpm test --filter=www
pnpm test --filter=api
After you're done modifying the codebase, push the changes to your fork, and create a PR against the develop branch in this repo. Once you do that, several tests will be run automatically which help us with the review process. Read the output from the TypeOfWebBot carefully 😊
Once merged, the app will be automatically deployed to staging.devfaq.pl. A release to production (app.devfaq.pl) will be done manually by one of the codeowners.
Please check out the open issues.
If you have any suggestions or found any bugs, don't hesitate to report them!
❤️ ❤️ ❤️ Thank you! ❤️ ❤️ ❤️